]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - libexec/rshd/rshd.8
MFC r320644:
[FreeBSD/stable/10.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. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     @(#)rshd.8      8.1 (Berkeley) 6/4/93
29 .\" $FreeBSD$
30 .\"
31 .Dd July 3, 2017
32 .Dt RSHD 8
33 .Os
34 .Sh NAME
35 .Nm rshd
36 .Nd remote shell server
37 .Sh SYNOPSIS
38 .Nm
39 .Op Fl aDLln
40 .Sh DEPRECATION NOTICE
41 .Nm
42 is deprecated and will be removed from future versions of the
43 .Fx
44 base system.
45 If
46 .Nm
47 is still required, it can be installed from ports or packages
48 (net/bsdrcmds).
49 .Sh DESCRIPTION
50 The
51 .Nm
52 utility
53 is the server for the
54 .Xr rcmd 3
55 routine and, consequently, for the
56 .Xr rsh 1
57 utility.
58 The server provides remote execution facilities
59 with authentication based on privileged port numbers from trusted hosts.
60 .Pp
61 The
62 .Nm
63 utility listens for service requests at the port indicated in
64 the
65 .Dq cmd
66 service specification; see
67 .Xr services 5 .
68 When a service request is received the following protocol
69 is initiated:
70 .Bl -enum
71 .It
72 The server checks the client's source port.
73 If the port is not in the range 512-1023, the server
74 aborts the connection.
75 .It
76 The server reads characters from the socket up
77 to a
78 .Tn NUL
79 (`\e0') byte.
80 The resultant string is
81 interpreted as an
82 .Tn ASCII
83 number, base 10.
84 .It
85 If the number received in step 2 is non-zero,
86 it is interpreted as the port number of a secondary
87 stream to be used for the
88 .Em stderr .
89 A second connection is then created to the specified
90 port on the client's machine.
91 The source port of this
92 second connection is also in the range 512-1023.
93 .It
94 The server checks the client's source address
95 and requests the corresponding host name (see
96 .Xr gethostbyaddr 3 ,
97 .Xr hosts 5
98 and
99 .Xr named 8 ) .
100 If the hostname cannot be determined or the hostname and address do
101 not match after verification,
102 the dot-notation representation of the host address is used.
103 .It
104 A null terminated user name of at most 16 characters
105 is retrieved on the initial socket.
106 This user name
107 is interpreted as the user identity on the
108 .Em client Ns 's
109 machine.
110 .It
111 A null terminated user name of at most 16 characters
112 is retrieved on the initial socket.
113 This user name
114 is interpreted as a user identity to use on the
115 .Em server Ns 's
116 machine.
117 .It
118 A null terminated command to be passed to a
119 shell is retrieved on the initial socket.
120 The length of
121 the command is limited by the upper bound on the size of
122 the system's argument list.
123 .It
124 The
125 .Nm
126 utility then validates the user using
127 .Xr ruserok 3 ,
128 which uses the file
129 .Pa /etc/hosts.equiv
130 and the
131 .Pa .rhosts
132 file found in the user's home directory.
133 The
134 .Fl l
135 option prevents
136 .Xr ruserok 3
137 from doing any validation based on the user's
138 .Pa .rhosts
139 file,
140 unless the user is the superuser.
141 .It
142 A
143 .Tn NUL
144 byte is returned on the initial socket
145 and the command line is passed to the normal login
146 shell of the user.
147 The
148 shell inherits the network connections established
149 by
150 .Nm .
151 .El
152 .Pp
153 The options are as follows:
154 .Bl -tag -width indent
155 .It Fl a
156 This flag is ignored, and is present for compatibility purposes.
157 .It Fl D
158 Sets the TCP_NODELAY socket option, which improves the performance
159 of small back-to-back writes at the expense of additional network
160 traffic.
161 .It Fl L
162 Causes all successful accesses to be logged to
163 .Xr syslogd 8
164 as
165 .Li auth.info
166 messages.
167 .It Fl l
168 Do not use the user's
169 .Pa .rhosts
170 file for authentication, unless the user is the superuser.
171 .It Fl n
172 Turn off transport level keepalive messages.
173 This will prevent sessions
174 from timing out if the client crashes or becomes unreachable.
175 .El
176 .Sh FILES
177 .Bl -tag -width /var/run/nologin -compact
178 .It Pa /etc/hosts
179 .It Pa /etc/hosts.equiv
180 .It Pa /etc/login.conf
181 .It Ev $HOME Ns Pa /.rhosts
182 .Pp
183 .It Pa /etc/pam.conf
184 .Nm
185 uses
186 .Pa /etc/pam.conf
187 entries with service name
188 .Dq rsh .
189 Authentication modules requiring passwords (such as
190 .Nm pam_unix )
191 are not supported.
192 .El
193 .Sh DIAGNOSTICS
194 Except for the last one listed below,
195 all diagnostic messages
196 are returned on the initial socket,
197 after which any network connections are closed.
198 An error is indicated by a leading byte with a value of
199 1 (0 is returned in step 10 above upon successful completion
200 of all the steps prior to the execution of the login shell).
201 .Bl -tag -width indent
202 .It Sy Locuser too long.
203 The name of the user on the client's machine is
204 longer than 16 characters.
205 .It Sy Ruser too long.
206 The name of the user on the remote machine is
207 longer than 16 characters.
208 .It Sy Command too long.
209 The command line passed exceeds the size of the argument
210 list (as configured into the system).
211 .It Sy Login incorrect.
212 No password file entry for the user name existed
213 or the authentication procedure described above failed.
214 .It Sy Remote directory.
215 The
216 .Xr chdir 2
217 function to the home directory failed.
218 .It Sy Logins not available right now.
219 The
220 .Xr rsh 1
221 utility was attempted outside the allowed hours defined in
222 .Pa /etc/login.conf
223 for the local user's login class.
224 .It Sy Can't make pipe.
225 The pipe needed for the
226 .Em stderr ,
227 was not created.
228 .It Sy Can't fork; try again.
229 A
230 .Xr fork 2
231 by the server failed.
232 .It Sy <shellname>: ...
233 The user's login shell could not be started.
234 This message is returned
235 on the connection associated with the
236 .Em stderr ,
237 and is not preceded by a flag byte.
238 .El
239 .Sh SEE ALSO
240 .Xr rlogin 1 ,
241 .Xr rsh 1 ,
242 .Xr gethostbyaddr 3 ,
243 .Xr rcmd 3 ,
244 .Xr ruserok 3 ,
245 .Xr hosts 5 ,
246 .Xr hosts.equiv 5 ,
247 .Xr login.conf 5 ,
248 .Xr services 5 ,
249 .Xr named 8 ,
250 .Xr rlogind 8 ,
251 .Xr syslogd 8
252 .Sh HISTORY
253 IPv6 support was added by WIDE/KAME project.
254 .Sh BUGS
255 The authentication procedure used here assumes the integrity
256 of each client machine and the connecting medium.
257 This is
258 insecure, but is useful in an
259 .Dq open
260 environment.
261 .Pp
262 A facility to allow all data exchanges to be encrypted should be
263 present.
264 .Pp
265 Post-PAM,
266 .Fx
267 also needs the following patch applied besides properly configuring
268 .Pa .rhosts :
269 .Bd -literal -offset indent
270 --- etc/pam.d/rsh.orig  Wed Dec 17 14:36:20 2003
271 +++ etc/pam.d/rsh       Wed Dec 17 14:30:43 2003
272 @@ -9 +9 @@
273 -auth   required        pam_rhosts.so   no_warn
274 +auth   required        pam_rhosts.so   no_warn allow_root
275 .Ed
276 .Pp
277 A more extensible protocol (such as Telnet) should be used.