Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)

User Commands (p - r) rsh(1)
NAME
rsh - Executes the specied command remotely
SYNOPSIS
rsh [-d][-l user] hostname command [argument ...]
rsh [-d] hostname [-l user] command [argument ...]
hostname [-l user][command][argument ...]
FLAGS
-d Turns on socket debugging (using the setsockopt() function) on the Transmission Con-
trol Protocol (TCP) sockets used for communication with the remote host.
-l user Species that rsh is to log in to the remote host using user instead of the users local
user name. If this ag is not specied, the local and remote user names are the same.
DESCRIPTION
The remote shell command (rsh) executes command at hostname. The rsh command sends the
standard input le from the local host to the remote command and receives the standard output
and standard error les from the remote command.
If the name of the le from which rsh is executed is anything other than rsh, rsh takes this name
as its hostname operand. This feature allows you to create a symbolic link to rsh in the name of
the host that, when executed, invokes a remote shell on that host. If you create a directory and
populate it with symbolic links in the names of commonly used hosts, then, by including the
directory in your shells search path, you can run rsh by typing hostname to your shell.
If you do not specify the -l ag, the local user name is used at the remote host. If -l user is
entered, the specied user name is used at the remote host. In either case, the remote host allows
access only if at least one of the following conditions is satised:
The local user ID is not the super ID, and the name of the local host is listed as an
equivalent host in the remote /etc/hosts.equiv le.
The remote users home directory contains a $HOME/.rhosts le that lists the local host
and user name.
For security reasons, any $HOME/.rhosts le must be owned by either the remote user or the
super ID, and only the owner should have write access.
In addition to the preceding conditions, rsh also allows access to the remote host if the remote
user account does not have a password dened. However, for security reasons, use of a password
on all user accounts is recommended.
While the remote command is executing, pressing the Interrupt, Terminate, or Quit key sequence
sends the corresponding signal to the remote process. However, pressing the Stop key sequence
stops only the local process. Normally, when the remote command terminates, the local rsh pro-
cess terminates.
To have shell metacharacters interpreted on the remote host, place the metacharacters inside ´´
(single quotes). Otherwise, the metacharacters are interpreted by the local shell.
EXAMPLES
In the following examples, the local host host1 is listed in the /etc/hosts.equiv le at the remote
host host2.
1. To check the amount of free disk space on the remote host host2,enter:
$ rsh host2 df
527188-003 Hewlett-Packard Company 757