Class RLoginClient
RCommandClient, from which it is derived, and uses the rcmd() facility implemented in
 RCommandClient to implement the functionality of the rlogin command that first appeared in 4.2BSD Unix. rlogin is a command used to log in to a
 remote machine from a trusted host, sometimes without issuing a password. The trust relationship is the same as described in the documentation for
 RCommandClient.
 
 As with virtually all the client classes in org.apache.commons.net, this class derives from SocketClient. But it relies on the connection methods defined
 in RcommandClient which ensure that the local Socket will originate from an acceptable rshell port. The way to use RLoginClient is to first connect to the
 server, call the rlogin()  method, and then fetch the connection's input and output streams. Interaction with the remote command is
 controlled entirely through the I/O streams. Once you have finished processing the streams, you should invoke
 disconnect()  to clean up properly.
 
 The standard output and standard error streams of the remote process are transmitted over the same connection, readable from the input stream returned by
 getInputStream() 
 
 Unlike RExecClient and RCommandClient, it is not possible to tell the rlogind daemon to return the standard error stream over a separate connection.
 getErrorStream()  will always return null. The standard input of the remote process can be
 written to through the output stream returned by getOutputSream() 
- See Also:
- 
Field SummaryFieldsFields inherited from class org.apache.commons.net.bsd.RCommandClientMAX_CLIENT_PORT, MIN_CLIENT_PORTFields inherited from class org.apache.commons.net.bsd.RExecClient_errorStream_, NULL_CHARFields inherited from class org.apache.commons.net.SocketClient_defaultPort_, _hostname_, _input_, _output_, _serverSocketFactory_, _socket_, _socketFactory_, _timeout_, connectTimeout, NETASCII_EOL, remoteInetSocketAddress
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidSame as the other rlogin method, but no terminal speed is defined.voidLogins into a remote machine through the rlogind daemon on the server to which the RLoginClient is connected.Methods inherited from class org.apache.commons.net.bsd.RCommandClientconnect, connect, connect, connect, connect, connect, rcommand, rcommandMethods inherited from class org.apache.commons.net.bsd.RExecClientdisconnect, getErrorStream, getInputStream, getOutputStream, isRemoteVerificationEnabled, rexec, rexec, setRemoteVerificationEnabledMethods inherited from class org.apache.commons.net.SocketClient_connectAction_, addProtocolCommandListener, applySocketAttributes, checkOpenOutputStream, connect, connect, createCommandSupport, fireCommandSent, fireReplyReceived, getCharset, getCharsetName, getCommandSupport, getConnectTimeout, getDefaultPort, getDefaultTimeout, getKeepAlive, getLocalAddress, getLocalPort, getProxy, getReceiveBufferSize, getRemoteAddress, getRemoteInetSocketAddress, getRemotePort, getSendBufferSize, getServerSocketFactory, getSoLinger, getSoTimeout, getTcpNoDelay, isAvailable, isConnected, removeProtocolCommandListener, setCharset, setConnectTimeout, setDefaultPort, setDefaultTimeout, setKeepAlive, setProxy, setReceiveBufferSize, setSendBufferSize, setServerSocketFactory, setSocketFactory, setSoLinger, setSoTimeout, setTcpNoDelay, verifyRemote
- 
Field Details- 
DEFAULT_PORTThe default rlogin port. Set to 513 in BSD UNIX and according to RFC 1282.- See Also:
 
 
- 
- 
Constructor Details- 
RLoginClientpublic RLoginClient()The default RLoginClient constructor. Initializes the default port toDEFAULT_PORT.
 
- 
- 
Method Details- 
rloginpublic void rlogin(String localUserName, String remoteUserName, String terminalType) throws IOException Same as the other rlogin method, but no terminal speed is defined.- Parameters:
- localUserName- the local user
- remoteUserName- the remote user
- terminalType- the terminal type
- Throws:
- IOException- on error
 
- 
rloginpublic void rlogin(String localUserName, String remoteUserName, String terminalType, int terminalSpeed) throws IOException Logins into a remote machine through the rlogind daemon on the server to which the RLoginClient is connected. After calling this method, you may interact with the remote login shell through its standard input and output streams. Standard error is sent over the same stream as standard output. You will typically be able to detect the termination of the remote login shell after reaching end of file on its standard output (accessible throughgetInputStream()). Disconnecting from the server or closing the process streams before reaching end of file will terminate the remote login shell in most cases.If user authentication fails, the rlogind daemon will request that a password be entered interactively. You will be able to read the prompt from the output stream of the RLoginClient and write the password to the input stream of the RLoginClient. - Parameters:
- localUserName- The user account on the local machine that is trying to log in to the remote host.
- remoteUserName- The account name on the server that is being logged in to.
- terminalType- The name of the user's terminal (e.g., "vt100", "network", etc.)
- terminalSpeed- The speed of the user's terminal, expressed as a baud rate or bps (e.g., 9600 or 38400)
- Throws:
- IOException- If the rlogin() attempt fails. The exception will contain a message indicating the nature of the failure.
 
 
-