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