xref: /netbsd-src/libexec/rexecd/rexecd.8 (revision 01869ca4d24a86379a68731bf9706a9f0820fe4e)
1.\"	$NetBSD: rexecd.8,v 1.13 2017/07/03 21:35:49 wiz Exp $
2.\"
3.\" Copyright (c) 1983, 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"     from: @(#)rexecd.8	8.3 (Berkeley) 6/1/94
31.\"
32.Dd June 1, 1994
33.Dt REXECD 8
34.Os
35.Sh NAME
36.Nm rexecd
37.Nd remote execution server
38.Sh SYNOPSIS
39.Nm
40.Sh DESCRIPTION
41.Nm
42is the server for the
43.Xr rexec 3
44routine.
45The server provides remote execution facilities with authentication
46based on user names and passwords.
47.Pp
48.Nm
49listens for service requests at the port indicated in
50the ``exec'' service specification; see
51.Xr services 5 .
52When a service request is received the following protocol
53is initiated:
54.Bl -enum
55.It
56The server reads characters from the socket up to a NUL
57.Pq Ql \e0
58byte.
59The resultant string is interpreted as an
60.Tn ASCII
61number, base 10.
62.It
63If the number received in step 1 is non-zero,
64it is interpreted as the port number of a secondary
65stream to be used for the
66.Em stderr .
67A second connection is then created to the specified
68port on the client's machine.
69.It
70A NUL terminated user name of at most 16 characters
71is retrieved on the initial socket.
72.It
73A NUL terminated, unencrypted password of at most
7416 characters is retrieved on the initial socket.
75.It
76A NUL terminated command to be passed to a
77shell is retrieved on the initial socket.
78The length of the command is limited by the upper bound on the size
79of the system's argument list.
80.It
81.Nm
82then validates the user as is done at login time and, if the
83authentication was successful, changes to the user's home directory,
84and establishes the user and group protections of the user.
85If any of these steps fail the connection is
86aborted with a diagnostic message returned.
87.It
88A NUL byte is returned on the initial socket and the command line
89is passed to the normal login shell of the user.
90The shell inherits the network connections established by
91.Nm .
92.El
93.Sh DIAGNOSTICS
94Except for the last one listed below,
95all diagnostic messages are returned on the initial socket,
96after which any network connections are closed.
97An error is indicated by a leading byte with a value of
981 (0 is returned in step 7 above upon successful completion
99of all the steps prior to the command execution).
100.Pp
101.Bl -tag -width Ds
102.It Sy username too long
103The name is
104longer than 16 characters.
105.It Sy password too long
106The password is longer than 16 characters.
107.It Sy command too long
108The command line passed exceeds the size of the argument
109list (as configured into the system).
110.It Sy Login incorrect.
111No password file entry for the user name existed.
112.It Sy Password incorrect.
113The wrong password was supplied.
114.It Sy \&No remote directory.
115The
116.Xr chdir 2
117to the home directory failed.
118.It Sy Try again.
119A
120.Xr fork 2
121by the server failed.
122.It Sy <shellname>: ...
123The user's login shell could not be started.
124This message is returned
125on the connection associated with the
126.Em stderr ,
127and is not preceded by a flag byte.
128.El
129.Sh SEE ALSO
130.Xr rexec 3
131.Sh HISTORY
132The
133.Nm
134command appeared in
135.Bx 4.2 .
136.Sh BUGS
137Indicating ``Login incorrect'' as opposed to ``Password incorrect''
138is a security breach which allows people to probe a system for users
139with null passwords.
140.Pp
141A facility to allow all data and password exchanges to be encrypted should be
142present.
143.Sh SECURITY CONSIDERATIONS
144As the passwords exchanged by the client and
145.Nm
146are not encrypted, it is
147.Em strongly
148recommended that this service is not enabled.
149