Using HP-UX Internet Services (February 2007)

6 Executing Commands with remsh
remsh allows you to execute commands on a remote HP-UX or UNIX host. remsh is
similar to rsh command in 4.2 BSD and later versions.
Enabling remsh
Before you can use remsh to execute commands on a remote host, you must configure
the remote host in one of the following methods:
You must have an account on the remote host with the same login name as your
local login name, and the name of your local host must be in the remote host’s
/etc/hosts.equiv file.
You must have an account on the remote host, and the name of your local host and
your local login name must be in a .rhosts file in your home directory on the
remote host.
For more information, see “Creating a $HOME/.rhosts File on a Remote Host”
(page 17).
Using remsh
The remsh command is of the following syntax:
remsh remote_host [-l remote_login_name] command[ ;command...]
If you do type any command with remsh on the command line, remsh interprets any
option in the command line as rlogin option and runs the rlogin command.
Shell metacharacters, such as, <, |, or >>, are interpreted on the local host, only if you
enclose them in double quotes. For example, the following command creates newfile
on the host basil; without the quotes, it would create newfile on the local host:
remsh basil cat my_message ">" newfile
IMPORTANT: Do not use remsh to run an interactive command, such as vi or more.
remsh hangs with some interactive commands. To run interactive commands, log into
the remote host with rlogin.
The remsh Command Examples
The following are some remsh command examples:
Enabling remsh 35