SYNOPSIS
rexec
[username@hostname]
[
rexec
[
DESCRIPTION
rexec executes the specified command on a remote host. The remote host must be running a rexecd service (or daemon) for rexec to connect to.
If a remote user name is not specified with either the
Non-quoted shell metacharacters on the command line are interpreted on the local machine, while quoted metacharacters are interpreted on the remote machine. For example, the command
rexec otherhost cat remotefile >> localfile
appends the remote file remotefile to the local file localfile, while
rexec otherhost cat remotefile \>\> other_remotefile
appends remotefile to other_remotefile.
rexec copies its standard input to the remote command,
the standard output of the remote command to its standard output, and
the standard error of the remote command to its standard error (unless you
specify
rexec normally terminates when the remote command does.
Options
-D -
enables socket debugging on the TCP sockets used for communication with the remote host. This option also the displays the user name sent to the rexecd service (or daemon).
-l username-
specifies the remote user name to be used when executing the command. This can also be specified by including username@hostname on the command line.
-N -
does not generate a separate standard error stream. All output is sent to standard output. This is useful when you are running an interactive command. For example,
rexec -N localhost cmd rexec -N localhost sh -i
-n -
redirects input from the special device /dev/nul.
-p password-
specifies the password of the specified user on the remote host.
If no password is specified, the ~/.netrc file is checked for "machine hostname login username password string" combination. If a password is not found, the user is prompted to enter a password.
Troubleshooting
If you are having trouble connecting to rexecd on a remote host, here are some possible solutions to your problems.
If you are receiving connection to server failed error, it usually implies that either there is no rexecd service (or daemon) running on the remote host or that there were more concurrent rexec requests than the remote host could handle.
Most versions of rexecd have a limit to the length of user name they can handle. On some UNIX systems, this limit is as low as 14 characters. As a result, you may receive an error message stating that the user name is too long. If you receive this message, make sure that the user name specified is valid on the remote host.
ENVIRONMENT VARIABLES
- TK_REXEC_RETRY_IF_LOGIN_INCORRECT
-
When this environment variable is set and rexec fails with a "login incorrect" message from rexecd, rexec will make one additional attempt to connect.
DIAGNOSTICS
Possible exit status values are:
ACKNOWLEDGEMENT
This product includes software developed by the University of California, Berkeley and its contributors.
PORTABILITY
All UNIX systems. Windows 2000. Windows XP. Windows Server 2003. Windows Vista.
AVAILABILITY
MKS Toolkit for System Administrators
MKS Toolkit for Developers
MKS Toolkit for Interoperability
MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
- Commands:
- rexecd
- File Formats:
- netrc
MKS Toolkit Connectivity Solutions Guide
MKS Toolkit 9.2 Documentation Build 16.