Initial import from FreeBSD RELENG_4:
[games.git] / libexec / rexecd / rexecd.8
1 .\" Copyright (c) 1983, 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 .\"     @(#)rexecd.8    8.2 (Berkeley) 12/11/93
33 .\" $FreeBSD: src/libexec/rexecd/rexecd.8,v 1.9.2.4 2001/08/16 10:44:16 ru Exp $
34 .\"
35 .Dd September 23, 1994
36 .Dt REXECD 8
37 .Os
38 .Sh NAME
39 .Nm rexecd
40 .Nd remote execution server
41 .Sh SYNOPSIS
42 .Nm
43 .Op Fl i
44 .Sh DESCRIPTION
45 .Nm Rexecd
46 is the server for the
47 .Xr rexec 3
48 routine.  The server provides remote execution facilities
49 with authentication based on user names and
50 passwords.
51 .Pp
52 .Nm Rexecd
53 listens for service requests at the port indicated in
54 the ``exec'' service specification; see
55 .Xr services 5 .
56 When a service request is received the following protocol
57 is initiated:
58 .Bl -enum
59 .It
60 The server reads characters from the socket up
61 to a NUL
62 .Pq Ql \e0
63 byte.  The resultant string is
64 interpreted as an
65 .Tn ASCII
66 number, base 10.
67 .It
68 If the number received in step 1 is non-zero,
69 it is interpreted as the port number of a secondary
70 stream to be used for the
71 .Em stderr .
72 A second connection is then created to the specified
73 port on the client's machine.
74 .It
75 A NUL terminated user name of at most 16 characters
76 is retrieved on the initial socket.
77 .It
78 A NUL terminated, unencrypted password of at most
79 16 characters is retrieved on the initial socket.
80 .It
81 A NUL terminated command to be passed to a
82 shell is retrieved on the initial socket.  The length of
83 the command is limited by the upper bound on the size of
84 the system's argument list.
85 .It
86 .Nm Rexecd
87 then validates the user as is done at login time
88 and, if the authentication was successful, changes
89 to the user's home directory, and establishes the user
90 and group protections of the user.
91 If any of these steps fail the connection is
92 aborted with a diagnostic message returned.
93 .It
94 A NUL byte is returned on the initial socket
95 and the command line is passed to the normal login
96 shell of the user.  The
97 shell inherits the network connections established
98 by
99 .Nm .
100 .El
101 .Sh CAVEATS
102 .Nm Rexecd
103 will not allow root logins unless the
104 .Fl i
105 option is given on the command line (typically in
106 .Pa /etc/inetd.conf ) .
107 It will also disallow access for users listed in
108 .Pa /etc/ftpusers ,
109 or users with no passwords, which were all serious security holes.
110 The entire concept of rexec/rexecd is a major security hole and an example
111 of how not to do things.
112 .Nm Rexecd
113 is disabled by default in
114 .Pa /etc/inetd.conf .
115 .Sh DIAGNOSTICS
116 Except for the last one listed below,
117 all diagnostic messages are returned on the initial socket,
118 after which any network connections are closed.
119 An error is indicated by a leading byte with a value of
120 1 (0 is returned in step 7 above upon successful completion
121 of all the steps prior to the command execution).
122 .Pp
123 .Bl -tag -width Ds
124 .It Sy username too long
125 The name is
126 longer than 16 characters.
127 .It Sy password too long
128 The password is longer than 16 characters.
129 .It Sy command too long
130 The command line passed exceeds the size of the argument
131 list (as configured into the system).
132 .It Sy Login incorrect.
133 No password file entry for the user name existed.
134 .It Sy Password incorrect.
135 The wrong password was supplied.
136 .It Sy \&No remote directory.
137 The
138 .Xr chdir
139 command to the home directory failed.
140 .It Sy Try again.
141 A
142 .Xr fork 2
143 by the server failed.
144 .It Sy <shellname>: ...
145 The user's login shell could not be started.
146 This message is returned
147 on the connection associated with the
148 .Em stderr ,
149 and is not preceded by a flag byte.
150 .El
151 .Sh SEE ALSO
152 .Xr rexec 3
153 .Sh BUGS
154 A facility to allow all data and password exchanges to be encrypted should be
155 present.
156 .Sh HISTORY
157 The
158 .Nm
159 command appeared in
160 .Bx 4.2 .