]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - libexec/rshd/rshd.8
This commit was generated by cvs2svn to compensate for changes in r95908,
[FreeBSD/FreeBSD.git] / libexec / rshd / 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 .\" $FreeBSD$
34 .\"
35 .Dd June 4, 1993
36 .Dt RSHD 8
37 .Os
38 .Sh NAME
39 .Nm rshd
40 .Nd remote shell server
41 .Sh SYNOPSIS
42 .Nm
43 .Op Fl \&?DLaln
44 .Sh DESCRIPTION
45 The
46 .Nm
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
53 with authentication based on privileged port numbers from trusted hosts.
54 .Pp
55 The
56 .Nm
57 server
58 listens for service requests at the port indicated in
59 the
60 .Dq cmd
61 service specification; see
62 .Xr services 5 .
63 When a service request is received the following protocol
64 is initiated:
65 .Bl -enum
66 .It
67 The server checks the client's source port.
68 If the port is not in the range 512-1023, the server
69 aborts the connection.
70 .It
71 The server reads characters from the socket up
72 to a
73 .Tn NUL
74 (`\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 or the hostname and address do
94 not match after verification,
95 the dot-notation representation of the host address is used.
96 .It
97 A null terminated user name of at most 16 characters
98 is retrieved on the initial socket.  This user name
99 is interpreted as the user identity on the
100 .Em client Ns 's
101 machine.
102 .It
103 A null terminated user name of at most 16 characters
104 is retrieved on the initial socket.  This user name
105 is interpreted as a user identity to use on the
106 .Em server Ns 's
107 machine.
108 .It
109 A null terminated command to be passed to a
110 shell is retrieved on the initial socket.  The length of
111 the command is limited by the upper bound on the size of
112 the system's argument list.
113 .It
114 .Nm Rshd
115 then validates the user using
116 .Xr ruserok 3 ,
117 which uses the file
118 .Pa /etc/hosts.equiv
119 and the
120 .Pa .rhosts
121 file found in the user's home directory.  The
122 .Fl l
123 option prevents
124 .Xr ruserok 3
125 from doing any validation based on the user's
126 .Pa .rhosts
127 file,
128 unless the user is the superuser.
129 .It
130 If the file
131 .Pa /var/run/nologin
132 exists and the user is not the superuser,
133 the connection is closed.
134 The name of the nologin file may be overridden
135 using the nologin capability in
136 .Pa /etc/login.conf
137 according to the local user's login class,
138 which may also be used to restrict
139 .Xr rsh 1
140 access by
141 login time (times.allow and times.deny capabilities)
142 and remote host (hosts.allow and hosts.deny capabilities).
143 .It
144 A
145 .Tn NUL
146 byte is returned on the initial socket
147 and the command line is passed to the normal login
148 shell of the user.  The
149 shell inherits the network connections established
150 by
151 .Nm .
152 .El
153 .Pp
154 The options are as follows:
155 .Bl -tag -width indent
156 .It Fl \&?
157 Display the usage message, and exit.
158 .It Fl D
159 Sets the TCP_NODELAY socket option, which improves the performance
160 of small back-to-back writes at the expense of additional network
161 traffic.
162 .It Fl L
163 Causes all successful accesses to be logged to
164 .Xr syslogd 8
165 as
166 .Li auth.info
167 messages.
168 .It Fl a
169 This flag is ignored, and is present for compatability purposes.
170 .It Fl l
171 Do not use the user's
172 .Pa .rhosts
173 file for authentication, unless the user is the superuser.
174 .It Fl n
175 Turn off transport level keepalive messages.  This will prevent sessions
176 from timing out if the client crashes or becomes unreachable.
177 .El
178 .Sh DIAGNOSTICS
179 Except for the last one listed below,
180 all diagnostic messages
181 are returned on the initial socket,
182 after which any network connections are closed.
183 An error is indicated by a leading byte with a value of
184 1 (0 is returned in step 10 above upon successful completion
185 of all the steps prior to the execution of the login shell).
186 .Bl -tag -width indent
187 .It Sy Locuser too long.
188 The name of the user on the client's machine is
189 longer than 16 characters.
190 .It Sy Ruser too long.
191 The name of the user on the remote machine is
192 longer than 16 characters.
193 .It Sy Command too long.
194 The command line passed exceeds the size of the argument
195 list (as configured into the system).
196 .It Sy Login incorrect.
197 No password file entry for the user name existed
198 or the authentication procedure described above failed.
199 .It Sy Remote directory.
200 The
201 .Xr chdir 2
202 function to the home directory failed.
203 .It Sy Logins not available right now.
204 .Xr Rsh 1
205 was attempted outside the allowed hours defined in
206 .Pa /etc/login.conf
207 for the local user's login class.
208 .It Sy Can't make pipe.
209 The pipe needed for the
210 .Em stderr ,
211 wasn't created.
212 .It Sy Can't fork; try again.
213 A
214 .Xr fork 2
215 by the server failed.
216 .It Sy <shellname>: ...
217 The user's login shell could not be started.  This message is returned
218 on the connection associated with the
219 .Em stderr ,
220 and is not preceded by a flag byte.
221 .El
222 .Sh SEE ALSO
223 .Xr rlogin 1 ,
224 .Xr rsh 1 ,
225 .Xr gethostbyaddr 3 ,
226 .Xr rcmd 3 ,
227 .Xr ruserok 3 ,
228 .Xr auth.conf 5 ,
229 .Xr hosts 5 ,
230 .Xr hosts.equiv 5 ,
231 .Xr login.conf 5 ,
232 .Xr nologin 5 ,
233 .Xr services 5 ,
234 .Xr named 8 ,
235 .Xr rlogind 8 ,
236 .Xr syslogd 8
237 .Sh FILES
238 .Bl -tag -width /var/run/nologin -compact
239 .It Pa /etc/hosts
240 .It Pa /etc/hosts.equiv
241 .It Pa /etc/login.conf
242 .It Ev $HOME Ns Pa /.rhosts
243 .It Pa /var/run/nologin
244 .Pp
245 .It Pa /etc/pam.conf
246 If
247 .Nm
248 is configured with PAM support, it uses
249 .Pa /etc/pam.conf
250 entries with service name
251 .Dq rsh .
252 Authentication modules requiring passwords (such as
253 .Nm pam_unix )
254 are not supported.
255 .El
256 .Sh BUGS
257 The authentication procedure used here assumes the integrity
258 of each client machine and the connecting medium.  This is
259 insecure, but is useful in an
260 .Dq open
261 environment.
262 .Pp
263 A facility to allow all data exchanges to be encrypted should be
264 present.
265 .Pp
266 A more extensible protocol (such as Telnet) should be used.
267 .Sh HISTORY
268 IPv6 support was added by WIDE/KAME project.