BSD 4_2 development
[unix-history] / usr / man / man8 / rshd.8c
CommitLineData
ccea61f9
C
1.TH RSHD 8C "4 March 1983"
2.UC 4
3.SH NAME
4rshd \- remote shell server
5.SH SYNOPSIS
6.B /etc/rshd
7.SH DESCRIPTION
8.I Rshd
9is the server for the
10.IR rcmd (3X)
11routine and, consequently, for the
12.IR rsh (1C)
13program. The server provides remote execution facilities
14with authentication based on privileged port numbers.
15.PP
16.I Rshd
17listens for service requests at the port indicated in
18the ``cmd'' service specification; see
19.IR services (5).
20When a service request is received the following protocol
21is initiated:
22.IP 1)
23The server checks the client's source port.
24If the port is not in the range 0-1023, the server
25aborts the connection.
26.IP 2)
27The server reads characters from the socket up
28to a null (`\e0') byte. The resultant string is
29interpreted as an ASCII number, base 10.
30.IP 3)
31If the number received in step 1 is non-zero,
32it is interpreted as the port number of a secondary
33stream to be used for the
34.BR stderr .
35A second connection is then created to the specified
36port on the client's machine. The source port of this
37second connection is also in the range 0-1023.
38.IP 4)
39The server checks the client's source address.
40If the address is associated with a host for which no
41corresponding entry exists in the host name data base (see
42.IR hosts (5)),
43the server aborts the connection.
44.IP 5)
45A null terminated user name of at most 16 characters
46is retrieved on the initial socket. This user name
47is interpreted as a user identity to use on the
48.BR server 's
49machine.
50.IP 6)
51A null terminated user name of at most 16 characters
52is retrieved on the initial socket. This user name
53is interpreted as the user identity on the
54.BR client 's
55machine.
56.IP 7)
57A null terminated command to be passed to a
58shell is retrieved on the initial socket. The length of
59the command is limited by the upper bound on the size of
60the system's argument list.
61.IP 8)
62.I Rshd
63then validates the user according to the following steps.
64The remote user name is looked up in the password file
65and a
66.I chdir
67is performed to the user's home directory. If either
68the lookup or
69.I chdir
70fail, the connection is terminated.
71If the user is not the super-user, (user id 0), the file
72.I /etc/hosts.equiv
73is consulted for a list of hosts considered ``equivalent''.
74If the client's host name is present in this file, the
75authentication is considered successful. If the lookup
76fails, or the user is the super-user, then the file
77.I .rhosts
78in the home directory of the remote user is checked for
79the machine name and identity of the user on the client's
80machine. If this lookup fails, the connection is terminated.
81.IP 9)
82A null byte is returned on the connection associated
83with the
84.B stderr
85and the command line is passed to the normal login
86shell of the user. The
87shell inherits the network connections established
88by
89.IR rshd .
90.SH DIAGNOSTICS
91All diagnostic messages are returned on the connection
92associated with the
93.BR stderr ,
94after which any network connections are closed.
95An error is indicated by a leading byte with a value of
961 (0 is returned in step 9 above upon successful completion
97of all the steps prior to the command execution).
98.PP
99.B ``locuser too long''
100.br
101The name of the user on the client's machine is
102longer than 16 characters.
103.PP
104.B ``remuser too long''
105.br
106The name of the user on the remote machine is
107longer than 16 characters.
108.PP
109.B ``command too long ''
110.br
111The command line passed exceeds the size of the argument
112list (as configured into the system).
113.PP
114.B ``Hostname for your address unknown.''
115.br
116No entry in the host name database existed for
117the client's machine.
118.PP
119.B ``Login incorrect.''
120.br
121No password file entry for the user name existed.
122.PP
123.B ``No remote directory.''
124.br
125The
126.I chdir
127command to the home directory failed.
128.PP
129.B ``Permission denied.''
130.br
131The authentication procedure described above failed.
132.PP
133.B ``Can't make pipe.''
134.br
135The pipe needed for the
136.BR stderr ,
137wasn't created.
138.PP
139.B ``Try again.''
140.br
141A
142.I fork
143by the server failed.
144.PP
145.B ``/bin/sh: ...''
146.br
147The user's login shell could not be started.
148.SH SEE ALSO
149rsh(1C),
150rcmd(3X)
151.SH BUGS
152The authentication procedure used here assumes the integrity
153of each client machine and the connecting medium. This is
154insecure, but is useful in an ``open'' environment.
155.PP
156A facility to allow all data exchanges to be encrypted should be
157present.