Allows command execution on a remote host.
int rexec (Host, Port, User, Passwd, Command, ErrFileDescParam) char **Host; int Port; char *User, *Passwd, *Command; int *ErrFileDescParam;
The rexec subroutine allows the calling process to start commands on a remote host.
If the rexec connection succeeds, a socket in the Internet domain of type SOCK_STREAM is returned to the calling process and is given to the remote command as standard input and standard output.
Host | Contains the name of a remote host that is listed in the /etc/hosts file or /etc/resolv.config file. If the name of the host is not found in either file, the rexec subroutine is unsuccessful. |
Port | Specifies the well-known DARPA Internet port to use for the
connection. A pointer to the structure that contains the necessary port can be
obtained by issuing the following library call:
getservbyname("exec","tcp") |
User and Passwd | Points to a user ID and password valid at the host. If these parameters are not supplied, the rexec subroutine takes the following actions until finding a user ID and password to send to the remote host: |
Command | Points to the name of the command to be executed at the remote host. |
ErrFileDescParam | Specifies one of the following values: |
Upon successful completion, the system returns a socket to the remote command.
If the rexec subroutine is unsuccessful, the system returns a -1 indicating that the specified host name does not exist.
The rexec subroutine is part of Base Operating System (BOS) Runtime.
All applications containing the rexec subroutine must be compiled with _BSD set to a specific value. Acceptable values are 43 and 44. In addition, all socket applications must include the BSD libbsd.a library.
/etc/hosts | Contains host names and their addresses for hosts in a network. This file is used to resolve a host name into an Internet address. | |
/etc/resolv.conf | Contains the name server and domain name. | |
$HOME/.netrc | Contains automatic login information. |
The getservbyname subroutine, rcmd subroutine, rresvport subroutine, ruserok subroutine.
The rexecd daemon.
The TCP/IP Overview for System Management in AIX Version 4.3 System Management Guide: Communications and Networks.
Sockets Overview in AIX Version 4.3 Communications Programming Concepts.