Initial import from FreeBSD RELENG_4:
[games.git] / crypto / kerberosIV / man / rshd.8
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 August 25, 1996
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 ailnkvxLP
43 .Op Fl p Ar portnumber
44 .Sh DESCRIPTION
45 The
46 .Nm rshd
47 server
48 is the server for the 
49 .Xr rcmd 3
50 routine and, consequently, for the
51 .Xr rsh 1
52 program.  The server provides remote execution facilities with
53 kerberos-based authentication or traditional pseudo-authentication
54 with privileged port numbers from trusted hosts.
55 .Pp
56 The
57 .Nm rshd
58 server
59 listens for service requests at the port indicated in
60 the ``cmd'' service specification; see
61 .Xr services 5 .
62 When a service request is received
63 .Nm rshd
64 verifies the kerberos ticket supplied by the user.
65 .Pp
66 For non-kerberised connections, the following protocol is initiated:
67 .Bl -enum
68 .It
69 The server checks the client's source port.
70 If the port is not in the range 512-1023, the server
71 aborts the connection.
72 .It
73 The server reads characters from the socket up
74 to a null (`\e0') byte.  The resultant string is
75 interpreted as an
76 .Tn ASCII
77 number, base 10.
78 .It
79 If the number received in step 2 is non-zero,
80 it is interpreted as the port number of a secondary
81 stream to be used for the 
82 .Em stderr .
83 A second connection is then created to the specified
84 port on the client's machine.  The source port of this
85 second connection is also in the range 512-1023.
86 .It
87 The server checks the client's source address
88 and requests the corresponding host name (see
89 .Xr gethostbyaddr 3 ,
90 .Xr hosts 5
91 and
92 .Xr named 8 ) .
93 If the hostname cannot be determined,
94 the dot-notation representation of the host address is used.
95 The addresses for the hostname are requested,
96 verifying that the name and address correspond.
97 If address verification fails, the connection is aborted
98 with the message, ``Host address mismatch.''
99 .It
100 A null terminated user name of at most 16 characters
101 is retrieved on the initial socket.  This user name
102 is interpreted as the user identity on the
103 .Em client Ns 's
104 machine.
105 .It
106 A null terminated user name of at most 16 characters
107 is retrieved on the initial socket.  This user name
108 is interpreted as a user identity to use on the
109 .Sy server Ns 's
110 machine.
111 .It
112 A null terminated command to be passed to a
113 shell is retrieved on the initial socket.  The length of
114 the command is limited by the upper bound on the size of
115 the system's argument list.  
116 .It
117 .Nm Rshd
118 then validates the user using
119 .Xr ruserok 3 ,
120 which uses the file
121 .Pa /etc/hosts.equiv
122 and the
123 .Pa .rhosts
124 file found in the user's home directory.  The
125 .Fl l
126 option prevents
127 .Xr ruserok 3
128 from doing any validation based on the user's ``.rhosts'' file,
129 unless the user is the superuser.
130 .It
131 If the file 
132 .Pa /etc/nologin
133 exists and the user is not the superuser,
134 the connection is closed.
135 .It
136 A null byte is returned on the initial socket
137 and the command line is passed to the normal login
138 shell of the user.  The
139 shell inherits the network connections established
140 by
141 .Nm rshd .
142 .El
143 .Pp
144 Transport-level keepalive messages are enabled unless the
145 .Fl n
146 option is present.
147 The use of keepalive messages allows sessions to be timed out
148 if the client crashes or becomes unreachable.
149 .Pp
150 The
151 .Fl L
152 option causes all successful accesses to be logged to
153 .Xr syslogd 8
154 as
155 .Li auth.info
156 messages.
157 .Bl -tag -width Ds
158 .It Fl k
159 Enable kerberos authentication.
160 .It Fl i
161 Do not expect to be spawned by inetd and create a socket and listen on
162 it yourself.
163 .It Fl p portnumber
164 Specifies the port number it should listen on in case the
165 .It Fl i
166 flag has been given.
167 .It Fl v
168 Vacuous, echo "Remote host requires Kerberos authentication" and exit.
169 .It Fl x
170 Provides an encrypted communications channel. This option requires the
171 .Fl k
172 flag.
173 .It Fl P
174 AFS only! Doesn't put the remote proccess in a new PAG.
175 .El
176 .Sh DIAGNOSTICS
177 Except for the last one listed below,
178 all diagnostic messages
179 are returned on the initial socket,
180 after which any network connections are closed.
181 An error is indicated by a leading byte with a value of
182 1 (0 is returned in step 10 above upon successful completion
183 of all the steps prior to the execution of the login shell).
184 .Bl -tag -width indent
185 .It Sy Locuser too long.
186 The name of the user on the client's machine is
187 longer than 16 characters.
188 .It Sy Ruser too long.
189 The name of the user on the remote machine is
190 longer than 16 characters.
191 .It Sy Command too long  .
192 The command line passed exceeds the size of the argument
193 list (as configured into the system).
194 .It Sy Login incorrect.
195 No password file entry for the user name existed.
196 .It Sy Remote directory.
197 The 
198 .Xr chdir
199 command to the home directory failed.
200 .It Sy Permission denied.
201 The authentication procedure described above failed.
202 .It Sy Can't make pipe.
203 The pipe needed for the 
204 .Em stderr ,
205 wasn't created.
206 .It Sy Can't fork; try again. 
207 A
208 .Xr fork
209 by the server failed.
210 .It Sy <shellname>: ...
211 The user's login shell could not be started.  This message is returned
212 on the connection associated with the
213 .Em stderr ,
214 and is not preceded by a flag byte.
215 .El
216 .Sh SEE ALSO
217 .Xr rsh 1 ,
218 .Xr rcmd 3 ,
219 .Xr ruserok 3
220 .Sh BUGS
221 A more extensible protocol (such as Telnet) should be used.