HP-UX Reference (11i v2 07/12) - 1 User Commands N-Z (vol 2)

r
remsh(1) remsh(1)
-k realm Obtain tickets from the remote host in the specified realm instead of the remote host’s
default realm as specified in the configuration file
krb.realms .
-P Disable Kerberos authentication.
If command, is not specified, instead of executing a single command, you will be logged in on the remote
host using rlogin (see rlogin(1)). Any rlogin
options typed in on the command line are transmitted to
rlogin.Ifnocommand and the option
-P are specified, rlogin will be invoked with -P to indicate
that Kerberos authentication (or secure access) is not necessary. This means that if a password is
requested, the password will be sent in cleartext. If command is specified, options specific to
rlogin are
ignored by
remsh.
By default, remsh reads its standard input and sends it to the remote command because
remsh has no
way to determine whether the remote command requires input. The
-n option redirects standard input to
remsh from /dev/null . This is useful when running a shell script containing a
remsh command, since
otherwise remsh may use input not intended for it. The
-n option is also useful when running remsh in
the background from a job control shell,
/usr/bin/csh
or /usr/bin/ksh . Otherwise, remsh stops
and waits for input from the terminal keyboard for the remote command.
/usr/bin/sh automatically
redirects its input from
/dev/null when jobs are run in the background.
Host names for remote hosts can also be commands (linked to remsh) in the directory
/usr/hosts .If
this directory is specified in the
$PATH environment variable, you can omit remsh. For example, if
remotehost is the name of a remote host, /usr/hosts/remotehost
is linked to remsh, and if
/usr/hosts is in your search path, the command
remotehost command
executes command on remotehost , and the command
remotehost
is equivalent to
rlogin remotehost
The rexec command works in the same way as remsh except that it uses the rexec()
library routine
and
rexecd for command execution (see rexec(3N) and rexecd(1M)) and does not support Kerberos
authentication. rexec prompts for a password before executing the command instead of using
hosts.equiv for authentication. It should be used in instances where a password to a remote account is
known but there are insufficient permissions for remsh.
EXAMPLES
Shell metacharacters that are not quoted are interpreted on the local host; quoted metacharacters are
interpreted on the remote host. Thus the command line:
remsh otherhost cat remotefile >> localfile
appends the remote file remotefile to the local file localfile, while the command line
remsh otherhost cat remotefile ">>" otherremotefile
appends remotefile to the remote file otherremotefile
.
If the remote shell is
/usr/bin/sh , the following command line sets up the environment for the remote
command before executing the remote command:
remsh otherhost . .profile 2>&- \; command
The 2>&- throws away error messages generated by executing .profile when stdin and stdout are not
aterminal.
The following command line runs remsh in the background on the local system, and the output of the
remote command comes to your terminal asynchronously:
remsh otherhost -n command &
The background remsh completes when the remote command does.
The following command line causes remsh to return immediately without waiting for the remote command
to complete:
remsh otherhost -n "command 1>&- 2>&- &"
208 Hewlett-Packard Company 2 HP-UX 11i Version 2: December 2007 Update