REXEC(1c,C) AIX TCP/IP User's Guide REXEC(1c,C) ------------------------------------------------------------------------------- rexec PURPOSE Executes commands one at a time on a foreign host in a secure environment. SYNTAX +--------+ rexec ---| +----+ |--- hostname --- command ---| +-| -d |-+ ^| -n || |+----+| +------+ DESCRIPTION The rexec command executes a command on the specified foreign host. The user is prompted for a valid user ID and password (if applicable) for the foreign host. The rexec command sends and receives data over a TCP connection. The rexec command also allows you to run interactive commands remotely, provided that they do not require a full screen display. In interactive processing, rexec sends all characters typed at the local keyboard to the foreign host until the EOF character is sent. If the shell running on the foreign host is csh, rexec sends SIGINT and SIGQUIT to the foreign host. For each user who concurrently runs commands on a host with rexec, the host must have one PTY configured. That is, if three users on host1 are using rexec to run commands on host2 concurrently, host2 must have three PTYs configured. In the PTY definitions, the auto enable and logger keywords must be set to false. FLAGS The rexec command options are: -d Is an optional flag that provides a debug service. The -d flag causes rexec to print debug statements to the file rexec.log in the current directory. -n Is an optional flag that disables an automatic login feature. By default rexec searches the $HOME/.netrc file for the user's ID and password on the foreign host. PARAMETERS Processed July 12, 1991 REXEC(1c,C) 1 REXEC(1c,C) AIX TCP/IP User's Guide REXEC(1c,C) hostname Is a required parameter that specifies the name of the host where the command is to be executed. hostname can be in octal, dotted decimal, or name (alphanumeric) form. command A required parameter that specifies the command to be executed on the foreign host. If command (the command name, together with flags or parameters) contains embedded blanks, it may be enclosed in double quotes (" "). EXAMPLES 1. To execute the date command on foreign host,host1: $ rexec host1 date Name (host1:tom): tom Password (host1:tom): [date command output] $ _ 2. To list the directory of user tom on the foreign host, host1: $ rexec host1 "li -l /u/tom" Name (host1:tom): tom Password (host1:tom): [listing of tom's directory on foreign host] $ _ 3. To list the /tmp directory of the foreign host, host1: $ rexec host1 "li /tmp" Name (host1:tom): tom Password (host1:tom): [listing of /tmp on foreign host] $ 4. To start a shell (csh) on the foreign host, host1 enter: $ rexec host1 csh Name (host1:tom): tom Password (host1:tom): % . . . [EOF to end the foreign shell.] 5. To use the automatic login feature for the user ID "tom" on the foreign host, host1, create a file called .netrc in the user's home directory on host1 using the following format: Processed July 12, 1991 REXEC(1c,C) 2 REXEC(1c,C) AIX TCP/IP User's Guide REXEC(1c,C) machine hostname login userid password password where: hostname is the name of the host on which the userid exists, host1 in this example. userid is the user ID on the host, tom in this example. password is the password for the userid. For example, machine host1 login tom password tomspswd Now user "tom" will not be queried for his user ID and password when he executes a command such as: $ rexec host1 date For more information on the format of the .netrc file, see "The .netrc File." FILES /etc/hosts Name to address map table ./rexec.log Debugging statements $HOME/.netrc User IDs and passwords for remote login. RELATED INFORMATION In this book: "rexecd" ".rhosts" "hosts.equiv" ".netrc" Processed July 12, 1991 REXEC(1c,C) 3