1 .\" Copyright (c) 1983 Regents of the University of California.
2 .\" All rights reserved. The Berkeley software License Agreement
3 .\" specifies the terms and conditions for redistribution.
5 .\" @(#)rshd.8c 6.3 (Berkeley) 5/24/86
7 .TH RSHD 8 "May 24, 1986"
10 rshd \- remote shell server
12 .B "shell stream tcp nowait root /usr/sbin/in.rshd in.rshd"
14 .B "tcpd shell /usr/sbin/in.rshd"
19 routine and, consequently, for the
21 program. The server provides remote execution facilities
22 with authentication based on privileged port numbers from trusted hosts.
25 listens for service requests at the port indicated in
26 the ``cmd'' service specification; see
28 When a service request is received the following protocol
31 The server checks the client's source port.
32 If the port is not in the range 0-1023, the server
33 aborts the connection.
35 The server reads characters from the socket up
36 to a null (`\e0') byte. The resultant string is
37 interpreted as an ASCII number, base 10.
39 If the number received in step 1 is non-zero,
40 it is interpreted as the port number of a secondary
41 stream to be used for the
43 A second connection is then created to the specified
44 port on the client's machine. The source port of this
45 second connection is also in the range 0-1023.
47 The server checks the client's source address
48 and requests the corresponding host name (see
49 .BR gethostbyaddr (3N),
53 If the hostname cannot be determined,
54 the dot-notation representation of the host address is used.
56 A null terminated user name of at most 16 characters
57 is retrieved on the initial socket. This user name
58 is interpreted as the user identity on the
62 A null terminated user name of at most 16 characters
63 is retrieved on the initial socket. This user name
64 is interpreted as a user identity to use on the
68 A null terminated command to be passed to a
69 shell is retrieved on the initial socket. The length of
70 the command is limited by the upper bound on the size of
71 the system's argument list.
74 then validates the user according to the following steps.
75 The local (server-end) user name is looked up in the password file
78 is performed to the user's home directory. If either
81 fail, the connection is terminated.
82 If the user is not the super-user, (user id 0), the file
84 is consulted for a list of hosts considered ``equivalent''.
85 If the client's host name is present in this file, the
86 authentication is considered successful. If the lookup
87 fails, or the user is the super-user, then the file
89 in the home directory of the remote user is checked for
90 the machine name and identity of the user on the client's
91 machine. If this lookup fails, the connection is terminated.
93 A null byte is returned on the initial socket
94 and the command line is passed to the normal login
95 shell of the user. The
96 shell inherits the network connections established
100 Except for the last one listed below,
101 all diagnostic messages
102 are returned on the initial socket,
103 after which any network connections are closed.
104 An error is indicated by a leading byte with a value of
105 1 (0 is returned in step 9 above upon successful completion
106 of all the steps prior to the execution of the login shell).
108 .B ``locuser too long''
110 The name of the user on the client's machine is
111 longer than 16 characters.
113 .B ``remuser too long''
115 The name of the user on the remote machine is
116 longer than 16 characters.
118 .B ``command too long ''
120 The command line passed exceeds the size of the argument
121 list (as configured into the system).
123 .B ``Login incorrect.''
125 No password file entry for the user name existed.
127 .B ``No remote directory.''
131 command to the home directory failed.
133 .B ``Permission denied.''
135 The authentication procedure described above failed.
137 .B ``Can't make pipe.''
139 The pipe needed for the
147 by the server failed.
149 .B ``<shellname>: ...''
151 The user's login shell could not be started. This message is returned
152 on the connection associated with the
154 and is not preceded by a flag byte.
159 The authentication procedure used here assumes the integrity
160 of each client machine and the connecting medium. This is
161 insecure, but is useful in an ``open'' environment.
163 A facility to allow all data exchanges to be encrypted should be
166 A more extensible protocol should be used.