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