The rlogin command allows you to log in to other UNIX machines on your network.
To remotely log in to another machine, type:
$ rlogin machinename |
where machinename is the name of the remote machine.
If a password prompt appears, type the password for the remote machine and press Return. If your machine name is in the other machine's /etc/hosts.equiv file, the other machine "trusts" your machine name and won't require you to type the password.
In the example above, user keithp logged in to lonesome at the directory /home/keithp, as indicated by the pwd command. When you log in to a machine where you don't have a home directory, rlogin displays a message stating that you have no home directory on the remote machine and logs you in to the root (/) directory of that machine:
There may be times when you want to log in to a remote machine as someone else. For example, if you're working on someone else's machine (using their username) and you want to log in to your own machine as yourself. The -l option to rlogin allows you to do this. The command syntax is:
rlogin machinename -l username
For example, the following shows how user keithp on machine blue would log in to machine lonesome as earl:
Note that when you log in to a remote machine as someone else, you are placed in that user's home directory.
If you try to log in to a remote machine whose name isn't known to your machine, rlogin searches unsuccessfully through the hosts database and then displays a notification as follows:
$ rlogin stranger stranger: unknown host $ |
Normally you terminate an rlogin connection by typing logout at the end of a work session. If for some reason you can't terminate a session in this manner, you can abort the connection by typing a tilde character followed by a period (~.) at the beginning of a line. The login connection to the remote machine is aborted and you are placed back at your original machine.
If you log in to a series of machines, gaining access to each machine through another machine, and you use ~. to abort the connection to any of the machines in the series, you are returned to your original machine:
If you want to back up to an intermediate rlogin connection, use two tildes followed by a period (~~.) as follows:
When you want to suspend an rlogin connection so you can return to it later, type the tilde character (~) followed by Ctrl-Z. The rlogin connection becomes a stopped process and you are placed back at the machine from which you logged in.
To reactivate the connection, type fg. Alternatively, you can type the percentage sign (%) followed by the process number of the stopped process (the default for %, if no process number is included, is the process most recently suspended).
Similar to aborting rlogin with ~~., typing two tildes and Ctrl-Z suspends the current rlogin and places you at an intermediate rlogin.
After logging in to a variety of remote machines, perhaps under different login names, you might need to verify exactly where you are. Typing who am i displays the name of the machine you're currently logged into as well as your current identity.
Type man rlogin at the command prompt or refer to the man Pages(1): User Commands.