[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Commands Reference, Volume 4

rexec Command

Purpose

Executes commands one at a time on a remote host.

Syntax

rexec-d | -n ] [ -i ] Host Command

Description

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.

Flags

-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.

Parameters

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.

Examples

  1. To execute the date command on a remote host, enter:
    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.

  2. To override the automatic login feature and execute the date command on a remote host, enter:
    rexec -n host1 date
    Enter your name and password when prompted.

    The output from the date command is now displayed on the local system.

  3. To list the directory of another user on a remote host, enter:
    rexec host1 li -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.

Related Information

Network Overview in AIX Version 4.3 System Management Guide: Communications and Networks.

The ftp command, rlogin command, rsh command, securetcpip command.

The rexecd daemon.

The .netrc file format.


[ Previous | Next | Contents | Glossary | Home | Search ]