


_O_n_l_i_n_e _M_a_n_u_a_l        System Manager Commands             rshd(8c)



NNNNAAAAMMMMEEEE
     rshd - remote shell server

SSSSYYYYNNNNTTTTAAAAXXXX
     ////eeeettttcccc////rrrrsssshhhhdddd

DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
     _R_s_h_d is the server for the _r_c_m_d(3x) routine and, conse-
     quently, for the _r_s_h(1c) program.  The server provides
     remote execution facilities with authentication based on
     privileged port numbers from trusted hosts.

     _R_s_h_d listens for service requests at the port indicated in
     the ``cmd'' service specification; see _s_e_r_v_i_c_e_s(5).  When a
     service request is received the following protocol is ini-
     tiated:

     1)   The server checks the client's source port.  If the
          port is not in the range 0-1023, the server aborts the
          connection.

     2)   The server reads characters from the socket up to a
          null (`\0') byte.  The resultant string is interpreted
          as an ASCII number, base 10.

     3)   If the number received in step 1 is non-zero, it is
          interpreted as the port number of a secondary stream to
          be used for the ssssttttddddeeeerrrrrrrr.  A second connection is then
          created to the specified port on the client's machine.
          The source port of this second connection is also in
          the range 0-1023.

     4)   The server checks the client's source address and
          requests the corresponding host name (see
          _g_e_t_h_o_s_t_b_y_a_d_d_r(3n), _h_o_s_t_s(5) and _n_a_m_e_d(8)).  If the
          hostname cannot be determined, the dot-notation
          representation of the host address is used.

     5)   A null terminated user name of at most 16 characters is
          retrieved on the initial socket.  This user name is
          interpreted as the user identity on the cccclllliiiieeeennnntttt's
          machine.

     6)   A null terminated user name of at most 16 characters is
          retrieved on the initial socket.  This user name is
          interpreted as a user identity to use on the sssseeeerrrrvvvveeeerrrr's
          machine.

     7)   A null terminated command to be passed to a shell is
          retrieved on the initial socket.  The length of the
          command is limited by the upper bound on the size of
          the system's argument list.

     8)   _R_s_h_d then validates the user according to the following
          steps.  The local (server-end) user name is looked up
          in the password file and a _c_h_d_i_r is performed to the
          user's home directory.  If either the lookup or _c_h_d_i_r
          fail, the connection is terminated.  If the user is not
          the super-user, (user id 0), the file /_e_t_c/_h_o_s_t_s._e_q_u_i_v






          is consulted for a list of hosts considered
          ``equivalent''.  If the client's host name is present
          in this file, the authentication is considered success-
          ful.  If the lookup fails, or the user is the super-
          user, then the file ._r_h_o_s_t_s in the home directory of
          the remote user is checked for the machine name and
          identity of the user on the client's machine.  If this
          lookup fails, the connection is terminated.

     9)   A null byte is returned on the initial socket and the
          command line is passed to the normal login shell of the
          user.  The shell inherits the network connections esta-
          blished by _r_s_h_d.

DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
     Except for the last one listed below, all diagnostic mes-
     sages are returned on the initial socket, after which any
     network connections are closed.  An error is indicated by a
     leading byte with a value of 1 (0 is returned in step 9
     above upon successful completion of all the steps prior to
     the execution of the login shell).

     ````````llllooooccccuuuusssseeeerrrr ttttoooooooo lllloooonnnngggg''''''''
     The name of the user on the client's machine is longer than
     16 characters.

     ````````rrrreeeemmmmuuuusssseeeerrrr ttttoooooooo lllloooonnnngggg''''''''
     The name of the user on the remote machine is longer than 16
     characters.

     ````````ccccoooommmmmmmmaaaannnndddd ttttoooooooo lllloooonnnngggg ''''''''
     The command line passed exceeds the size of the argument
     list (as configured into the system).

     ````````LLLLooooggggiiiinnnn iiiinnnnccccoooorrrrrrrreeeecccctttt....''''''''
     No password file entry for the user name existed.

     ````````NNNNoooo rrrreeeemmmmooootttteeee ddddiiiirrrreeeeccccttttoooorrrryyyy....''''''''
     The _c_h_d_i_r command to the home directory failed.

     ````````PPPPeeeerrrrmmmmiiiissssssssiiiioooonnnn ddddeeeennnniiiieeeedddd....''''''''
     The authentication procedure described above failed.

     ````````CCCCaaaannnn''''tttt mmmmaaaakkkkeeee ppppiiiippppeeee....''''''''
     The pipe needed for the ssssttttddddeeeerrrrrrrr, wasn't created.

     ````````TTTTrrrryyyy aaaaggggaaaaiiiinnnn....''''''''
     A _f_o_r_k by the server failed.

     ````````<<<<sssshhhheeeellllllllnnnnaaaammmmeeee>>>>:::: ............''''''''
     The user's login shell could not be started.  This message
     is returned on the connection associated with the ssssttttddddeeeerrrrrrrr,
     and is not preceded by a flag byte.

SSSSEEEEEEEE AAAALLLLSSSSOOOO
     User Commands(1): rsh
     Library Functions(3): rcmd

LLLLIIIIMMMMIIIITTTTAAAATTTTIIIIOOOONNNNSSSS
     The authentication procedure used here assumes the integrity






     of each client machine and the connecting medium.  This is
     insecure, but is useful in an ``open'' environment.

     A facility to allow all data exchanges to be encrypted
     should be present.

     A more extensible protocol should be used.

December 1989                      TX System Manager's Reference



















































