8.3 Remote Connections
The rlogin command allows remote login access to another host in the local network. rlogin passes information about the local environment, including the value of the TERM environment variable, to the remote host.
The rsh command provides the ability to invoke a Unix shell on a remote host in the local network for the purpose of executing a shell command there. This capability is similar to the "shell escape" function commonly available from within such Unix software systems as editors and email.
The rcp command provides the ability to copy files from the local host to a remote host in the local network.
rlogin [ -l username ] remote_host
rsh [ -l username ] remote_host [ command ]
rcp [ [user1]@host1:]original_filename [ [user2]@host2:]new_filename
where the parts in brackets () are optional. rcp does not prompt for passwords, so you must have permission to execute remote commands on the specified machines as the selected user on each machine.
-l username connect as the user, username, on the remote host (rlogin & rsh)
The .rhosts file, if it exists in the user's home directory on the remote host, permits rlogin, rsh, or rcp access to that remote host without prompting for a password for that account. The .rhosts file contains an entry for each remote host and username from which the owner of the .rhosts file may wish to connect. Each entry in the .rhosts file is of the form:
where listing the remote_user is optional. For instance, if Heather Jones wants to be able to connect to machine1 (where her username is heather) from machine2 (where her username is jones), or from machine 3 (where her username is heather, the same as for machine1), she could create a .rhosts file in her home directory on machine1. The contents of this file could be:
On a system-wide basis the file /etc/hosts.equiv serves the same purpose for all users, except the super-user. Such a file with the contents:
allows any user from remote_machine to remote connect to this machine without a password, as the same username on this machine.
An /etc/hosts.equiv file with the contents:
allows remote_user, on remote_machine, to remote connect to this machine as any local user, except the super-user.
/etc/hosts.equiv and ~/.rhosts files should be used with caution.
The Secure SHell (SSH) versions of the rcp, rsh, and rlogin programs are freely available and provide much greater security.