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