*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> rexec (3)              
Title
Content
Arch
Section
 

rexec(3)

Contents


NAME    [Toc]    [Back]

       rexec, rexec_r - Allow command execution on a remote host

SYNOPSIS    [Toc]    [Back]

       #include <netdb.h> #include <unistd.h>

       int rexec(
               char **host,
               int port,
               char *user,
               char *passwd,
               char *command,
               int *err_file_desc );

       The  following  function is supported in order to maintain
       backward compatibility with previous versions of the operating
 system: int rexec_r(
               char **host,
               int port,
               char *user,
               char *passwd,
               char *command,
               int *err_file_desc,
               struct hostent_data *host_data );

LIBRARY    [Toc]    [Back]

       Standard C Library (libc)

PARAMETERS    [Toc]    [Back]

       Contains  the  name of a remote host that is listed in the
       /etc/hosts file or /etc/resolv.conffile.  If the  name  of
       the  host  is not found in either file, the rexec() fails.
       Specifies the well-known 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")  Points  to a user ID
              that is valid on the host.  Points to the  password
              of  the  specified  user ID on the host.  Points to
              the name of the  command  to  be  executed  at  the
              remote  host.  Specifies the file to which standard
              error from the remote command is sent.

              If the err_file_desc parameter  is  0  (zero),  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.  In this
              case, however, it may be possible to  send  out-ofband
 data to the remote command.

              If  the err_file_desc parameter is nonzero, an auxiliary
 channel to a control process is set up,  and
              a  descriptor for it is placed in the err_file_desc
              parameter. The control process provides  diagnostic
              output  from the remote command on this channel and
              also accepts bytes as signal  numbers  to  be  forwarded
  to  the process group of the command.  This
              diagnostic  information  does  not  include  remote
              authorization failure, since this connection is set
              up after authorization  has  been  verified.   Perthread
 data for reentrant version.

DESCRIPTION    [Toc]    [Back]

       The rexec() (remote execution) function allows the calling
       process to execute 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.

       The user and passwd parameters specify a valid user ID and
       the associated password for that user on the remote  host.
       If  the  user  and passwd parameters are not supplied, the
       rexec() function takes the following actions until finding
       a  user  ID  and  password  to send to the remote host: It
       searches the current environment for the user ID and password
  on  the  remote  host.   It searches the user's home
       directory for a file called $HOME/.netrc that  contains  a
       user  ID  and password.  It prompts the user for a user ID
       and password.

       Note that action 3 does not apply when using rexec_r().

NOTES    [Toc]    [Back]

       The  rexec_r()  function  is  the  reentrant  version   of
       rexec().   It  is  supported in order to maintain backward
       compatibility with previous versions of the operating system.
   The  netdb.h  header  file defines the hostent_data
       structures.

RETURN VALUES    [Toc]    [Back]

       Upon successful completion, the system  returns  a  socket
       descriptor to the remote command. Otherwise, a value of -1
       is returned, indicating that the specified  hostname  does
       not exist.

FILES    [Toc]    [Back]

       Contains hostnames and their addresses for hosts in a network.
  This file is used to resolve  a  hostname  into  an
       Internet  address.   Contains  the  name server and domain
       name.  Contains automatic login information.

SEE ALSO    [Toc]    [Back]

      
      
       Functions:   getservbyname(3),   rcmd(3),    rresvport(3),
       ruserok(3).

       Commands: rexecd(8).



                                                         rexec(3)
[ Back ]
 Similar pages
Name OS Title
rsh Tru64 Executes a specified command on a remote host or logs into a remote host
rcmd Tru64 Allow execution of commands on a remote host
rcmd_r Tru64 Allow execution of commands on a remote host
ssh Tru64 Secure Shell client remote login and command execution application
ssh2 Tru64 Secure Shell client remote login and command execution application
on HP-UX execute command on remote host with environment similar to local
rcp Tru64 Copies files on the same host, between a local host and a remote host, and between two remote hosts
t6rhdb_get_host IRIX TSIX Remote Host DataBase get host information
t6rhdb_put_host IRIX TSIX Remote Host DataBase get host information
time OpenBSD time command execution
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service