|
|
| HCLIENT
RshLogin(
|
|
|
LPCTSTR
lpszRemoteHost, |
|
|
|
|
UINT
nRemotePort, |
|
|
|
|
UINT nTimeout, |
|
|
|
|
DWORD
dwReserved, |
|
|
|
|
LPCTSTR
lpszUserName, |
|
|
|
|
LPCTSTR
lpszTerminal |
|
|
| );
|
The RshLogin function is used to establish a terminal
session with the remote server.
Parameters
- lpszRemoteHost
- A pointer to the name of the remote host to connect to; this
may be a fully-qualified domain name, or an IP address.
- nRemotePort
- The port number the remote server is listening on. A value of
zero specifies that the default port should be used.
- nTimeout
- The number of seconds that the client will wait for a response
before failing the operation; a value of zero indicates that the
client should wait an indefinite period of time.
- dwReserved
- A reserved parameter. This value should always be zero.
- lpszUserName
- A pointer to a null-terminated string which specifies the
username used to authenticate the client session.
- lpszTerminal
- A pointer to a null-terminated string which specifies the
terminal type which the client will be identified as using during
the session. If no particular terminal emulation is required, this
parameter may be NULL.
Return Value
If the function succeeds, the return value is a handle to a
client session. If the function fails, the return value is
INVALID_CLIENT. To get extended error information, call
RshGetLastError.
Remarks
The RshLogin function uses host equivalence, where the
client is permitted to login without requiring a password. Host
equivalence must be configured by the server administrator and it
is typically restricted to specific users. Note that if configured
improperly, host equivalence can introduce a significant security
loophole. Refer to your UNIX system documentation for more
information about host equivalence and the various remote command
services. Note that if there is no host equivalence for the local
host and the user account requires a password, the system will
prompt for a password.
On UNIX based systems, the terminal name specified by the
lpszTerminal parameter corresponds to a termcap or terminfo
entry as set in the TERM environment variable. On Windows based
systems which implement the rlogin service, this parameter may be
ignored and the server will assume that the client is capable of
displaying ANSI escape sequences. On VMS systems, the terminal name
should correspond to the terminal type used with the SET
TERMINAL/DEVICE command.
If this parameter is passed as NULL pointer or an empty string,
a default terminal type named "unknown" will be used. On most UNIX
and VMS systems this defines a terminal which is not capable of
cursor positioning using control or escape sequences. This terminal
type may not be recognized and an error may be displayed when the
user logs in indicating that the terminal type is invalid.
Refer to the documentation for the server system to determine
what terminal type names are available to you. Remember that on
UNIX systems, the terminal type is case-sensitive. Some of the more
common terminal types are:
| Terminal Type |
| Description |
| ansi |
This terminal type is usually
available on UNIX based servers. This specifies that the client is
capable of displaying standard ANSI escape sequences for cursor
control. |
| dumb |
This terminal type typically
specifies a terminal display which does not support control or
escape sequences for cursor positioning. If you do not want escape
sequences embedded in the data stream and the server returns an
error if the terminal type is not specified, try using this
terminal type. |
| pcansi |
This terminal type is usually
available on UNIX based servers. This specifies that the client is
a using a PC terminal emulator that supports basic ANSI escape
sequences for cursor control. This may also enable escape sequences
which can set the display colors. |
| vt100 |
This terminal type is usually
available on UNIX and VMS based servers. On some VMS systems this
string may need to be specified as DEC-VT100. This specifies that
the client is capable of emulating a DEC VT100 terminal. The VT100
supports many of the same cursor control sequences as an ANSI
terminal. |
| vt220 |
This terminal type is usually
available on UNIX and VMS based servers. On some VMS systems this
string may need to be specified as DEC-VT220. This specifies that
the client is capable of emulating a DEC VT220 terminal, which is a
later version of the VT100. |
| vt320 |
This terminal type is usually
available on UNIX and VMS based servers. On some VMS systems this
string may need to be specified as DEC-VT320. This specifies that
the client is capable of emulating a DEC VT320 terminal, which is
similar to the VT100 and VT220 and provides advanced features such
as the ability to set display colors. |
| xterm |
This terminal type is may be
available on UNIX based servers which have X Windows installed.
This specifies that the client is a using the X Windows xterm
emulator which supports standard ANSI escape sequences for cursor
control. |
Requirements
Client: Requires Windows Vista, Windows XP or Windows
2000 Professional.
Server: Requires Windows Server 2008, Windows Server 2003 or
Windows 2000 Server.
Header: Include cstools6.h.
Library: Use csrshav6.lib.
Unicode: Implemented as Unicode and ANSI versions.
See Also
RshAsyncExecute, RshAsyncLogin, RshDisconnect, RshExecute, RshInitialize, RshSearch, RshUninitialize
|
|