RLoginClient is very similar to
org.apache.commons.net.bsd.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 login 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
org.apache.commons.net.bsd.RCommandClient.
As with virtually all of 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
org.apache.commons.net.bsd.RExecClient#disconnectto 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
org.apache.commons.net.bsd.RExecClient#getInputStream
Unlike RExecClient and RCommandClient, it is
not possible to tell the rlogind daemon to return the standard error
stream over a separate connection.
org.apache.commons.net.bsd.RExecClient#getErrorStreamwill always return null.
The standard input of the remote process can be written to through
the output stream returned by
org.apache.commons.net.bsd.RExecClient#getOutputStream