]> git.saurik.com Git - apple/network_cmds.git/blame - rshd.tproj/rshd.8
network_cmds-115.tar.gz
[apple/network_cmds.git] / rshd.tproj / rshd.8
CommitLineData
b7080c8e
A
1.\" Copyright (c) 1983, 1989, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\" This product includes software developed by the University of
15.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)rshd.8 8.1 (Berkeley) 6/4/93
33.\"
34.Dd June 4, 1993
35.Dt RSHD 8
36.Os BSD 4.2
37.Sh NAME
38.Nm rshd
39.Nd remote shell server
40.Sh SYNOPSIS
41.Nm rshd
42.Op Fl alnL
43.Sh DESCRIPTION
44The
45.Nm rshd
46server
47is the server for the
48.Xr rcmd 3
49routine and, consequently, for the
50.Xr rsh 1
51program. The server provides remote execution facilities
52with authentication based on privileged port numbers from trusted hosts.
53.Pp
54The
55.Nm rshd
56server
57listens for service requests at the port indicated in
58the ``cmd'' service specification; see
59.Xr services 5 .
60When a service request is received the following protocol
61is initiated:
62.Bl -enum
63.It
64The server checks the client's source port.
65If the port is not in the range 512-1023, the server
66aborts the connection.
67.It
68The server reads characters from the socket up
69to a null (`\e0') byte. The resultant string is
70interpreted as an
71.Tn ASCII
72number, base 10.
73.It
74If the number received in step 2 is non-zero,
75it is interpreted as the port number of a secondary
76stream to be used for the
77.Em stderr .
78A second connection is then created to the specified
79port on the client's machine. The source port of this
80second connection is also in the range 512-1023.
81.It
82The server checks the client's source address
83and requests the corresponding host name (see
84.Xr gethostbyaddr 3 ,
85.Xr hosts 5
86and
87.Xr named 8 ) .
88If the hostname cannot be determined,
89the dot-notation representation of the host address is used.
90If the hostname is in the same domain as the server (according to
91the last two components of the domain name),
92or if the
93.Fl a
94option is given,
95the addresses for the hostname are requested,
96verifying that the name and address correspond.
97If address verification fails, the connection is aborted
98with the message, ``Host address mismatch.''
99.It
100A null terminated user name of at most 16 characters
101is retrieved on the initial socket. This user name
102is interpreted as the user identity on the
103.Em client Ns 's
104machine.
105.It
106A null terminated user name of at most 16 characters
107is retrieved on the initial socket. This user name
108is interpreted as a user identity to use on the
109.Sy server Ns 's
110machine.
111.It
112A null terminated command to be passed to a
113shell is retrieved on the initial socket. The length of
114the command is limited by the upper bound on the size of
115the system's argument list.
116.It
117.Nm Rshd
118then validates the user using
119.Xr ruserok 3 ,
120which uses the file
121.Pa /etc/hosts.equiv
122and the
123.Pa .rhosts
124file found in the user's home directory. The
125.Fl l
126option prevents
127.Xr ruserok 3
128from doing any validation based on the user's ``.rhosts'' file,
129unless the user is the superuser.
130.It
131If the file
132.Pa /etc/nologin
133exists and the user is not the superuser,
134the connection is closed.
135.It
136A null byte is returned on the initial socket
137and the command line is passed to the normal login
138shell of the user. The
139shell inherits the network connections established
140by
141.Nm rshd .
142.El
143.Pp
144Transport-level keepalive messages are enabled unless the
145.Fl n
146option is present.
147The use of keepalive messages allows sessions to be timed out
148if the client crashes or becomes unreachable.
149.Pp
150The
151.Fl L
152option causes all successful accesses to be logged to
153.Xr syslogd 8
154as
155.Li auth.info
156messages.
157.Sh DIAGNOSTICS
158Except for the last one listed below,
159all diagnostic messages
160are returned on the initial socket,
161after which any network connections are closed.
162An error is indicated by a leading byte with a value of
1631 (0 is returned in step 10 above upon successful completion
164of all the steps prior to the execution of the login shell).
165.Bl -tag -width indent
166.It Sy Locuser too long.
167The name of the user on the client's machine is
168longer than 16 characters.
169.It Sy Ruser too long.
170The name of the user on the remote machine is
171longer than 16 characters.
172.It Sy Command too long .
173The command line passed exceeds the size of the argument
174list (as configured into the system).
175.It Sy Login incorrect.
176No password file entry for the user name existed.
177.It Sy Remote directory.
178The
179.Xr chdir
180command to the home directory failed.
181.It Sy Permission denied.
182The authentication procedure described above failed.
183.It Sy Can't make pipe.
184The pipe needed for the
185.Em stderr ,
186wasn't created.
187.It Sy Can't fork; try again.
188A
189.Xr fork
190by the server failed.
191.It Sy <shellname>: ...
192The user's login shell could not be started. This message is returned
193on the connection associated with the
194.Em stderr ,
195and is not preceded by a flag byte.
196.El
197.Sh SEE ALSO
198.Xr rsh 1 ,
199.Xr rcmd 3 ,
200.Xr ruserok 3
201.Sh BUGS
202The authentication procedure used here assumes the integrity
203of each client machine and the connecting medium. This is
204insecure, but is useful in an ``open'' environment.
205.Pp
206A facility to allow all data exchanges to be encrypted should be
207present.
208.Pp
209A more extensible protocol (such as Telnet) should be used.