Executes commands one at a time on a remote host.
rexec [ -a ][ -d | -n ] [ -i ] Host Command
The /usr/bin/rexec command executes a command on the specified remote host.
The rexec command provides an automatic login feature by checking for a $HOME/.netrc file that contains the user name and password to use at the remote host. If such an entry is not found or if your system is operating in secure mode (see the securetcpip command), the rexec command prompts for a valid user name and password for the remote host. In both cases, rexec causes rexecd on the remote system to use the default compat login authentication method for the user. rexecd does not look at the /etc/security/user file on the remote system for alternative authentication methods. You can also override the automatic login feature by specifying the -n flag on the rexec command line.
-a | Indicates the standard error of the remote command is the same as standard output. No provision is made for sending arbitrary signals to the remote process. |
-d | Enables socket-level debugging. |
-i | Prevents reading the stdin. |
-n | Prevents automatic login. With the -n flag specified, the rexec command prompts for a user name and password to use at the remote host, rather than searching for a $HOME/.netrc file. |
Command | Specifies the command, including any flags or parameters, to be executed on the remote host. |
Host | Specifies in alphanumeric form the name of the host where the command is to be executed. |
rexec host1 date
The output from the date command is now displayed on the local system. In this example, the $HOME/.netrc file on the local host contains a user name and password valid at the remote host.
If you do not have a valid entry in the $HOME/.netrc file for the remote host, you will be prompted for your login ID and password. After you have entered the requested login information, the output from the date command is displayed on the local system.
The output from the date command is now displayed on the local system.
rexec host1 ls -l /home/karen
The directory listing of user karen on remote host host1 is displayed on the local system.
If you do not have a valid entry in the $HOME/.netrc file for the remote host, you will be prompted for your login id and password. After you have entered the requested login information, the directory listing of user karen on remote host host1 is displayed on the local system.
Network Overview in AIX 5L Version 5.2 System Management Guide: Communications and Networks.
The ftp command, rlogin command, rsh command, securetcpip command.
The rexecd daemon.
The .netrc file format.