1*01869ca4Swiz.\" $NetBSD: rexecd.8,v 1.13 2017/07/03 21:35:49 wiz Exp $ 2da5c78b3Smrg.\" 3da5c78b3Smrg.\" Copyright (c) 1983, 1991, 1993 4da5c78b3Smrg.\" The Regents of the University of California. All rights reserved. 561f28255Scgd.\" 661f28255Scgd.\" Redistribution and use in source and binary forms, with or without 761f28255Scgd.\" modification, are permitted provided that the following conditions 861f28255Scgd.\" are met: 961f28255Scgd.\" 1. Redistributions of source code must retain the above copyright 1061f28255Scgd.\" notice, this list of conditions and the following disclaimer. 1161f28255Scgd.\" 2. Redistributions in binary form must reproduce the above copyright 1261f28255Scgd.\" notice, this list of conditions and the following disclaimer in the 1361f28255Scgd.\" documentation and/or other materials provided with the distribution. 148e6ab883Sagc.\" 3. Neither the name of the University nor the names of its contributors 1561f28255Scgd.\" may be used to endorse or promote products derived from this software 1661f28255Scgd.\" without specific prior written permission. 1761f28255Scgd.\" 1861f28255Scgd.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1961f28255Scgd.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2061f28255Scgd.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2161f28255Scgd.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2261f28255Scgd.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2361f28255Scgd.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2461f28255Scgd.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2561f28255Scgd.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2661f28255Scgd.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2761f28255Scgd.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2861f28255Scgd.\" SUCH DAMAGE. 2961f28255Scgd.\" 30da5c78b3Smrg.\" from: @(#)rexecd.8 8.3 (Berkeley) 6/1/94 3161f28255Scgd.\" 32da5c78b3Smrg.Dd June 1, 1994 3361f28255Scgd.Dt REXECD 8 34f1247650Sgarbled.Os 3561f28255Scgd.Sh NAME 3661f28255Scgd.Nm rexecd 3761f28255Scgd.Nd remote execution server 3861f28255Scgd.Sh SYNOPSIS 39966d406aSenami.Nm 4061f28255Scgd.Sh DESCRIPTION 41966d406aSenami.Nm 4261f28255Scgdis the server for the 4361f28255Scgd.Xr rexec 3 445ce6614aSfairroutine. 455ce6614aSfairThe server provides remote execution facilities with authentication 465ce6614aSfairbased on user names and passwords. 4761f28255Scgd.Pp 48966d406aSenami.Nm 4961f28255Scgdlistens for service requests at the port indicated in 5061f28255Scgdthe ``exec'' service specification; see 5161f28255Scgd.Xr services 5 . 5261f28255ScgdWhen a service request is received the following protocol 5361f28255Scgdis initiated: 5461f28255Scgd.Bl -enum 5561f28255Scgd.It 565ce6614aSfairThe server reads characters from the socket up to a NUL 5761f28255Scgd.Pq Ql \e0 585ce6614aSfairbyte. 595ce6614aSfairThe resultant string is interpreted as an 6061f28255Scgd.Tn ASCII 6161f28255Scgdnumber, base 10. 6261f28255Scgd.It 6361f28255ScgdIf the number received in step 1 is non-zero, 6461f28255Scgdit is interpreted as the port number of a secondary 6561f28255Scgdstream to be used for the 6661f28255Scgd.Em stderr . 6761f28255ScgdA second connection is then created to the specified 6861f28255Scgdport on the client's machine. 6961f28255Scgd.It 7061f28255ScgdA NUL terminated user name of at most 16 characters 7161f28255Scgdis retrieved on the initial socket. 7261f28255Scgd.It 7361f28255ScgdA NUL terminated, unencrypted password of at most 7461f28255Scgd16 characters is retrieved on the initial socket. 7561f28255Scgd.It 7661f28255ScgdA NUL terminated command to be passed to a 775ce6614aSfairshell is retrieved on the initial socket. 785ce6614aSfairThe length of the command is limited by the upper bound on the size 795ce6614aSfairof the system's argument list. 8061f28255Scgd.It 81966d406aSenami.Nm 825ce6614aSfairthen validates the user as is done at login time and, if the 835ce6614aSfairauthentication was successful, changes to the user's home directory, 845ce6614aSfairand establishes the user and group protections of the user. 8561f28255ScgdIf any of these steps fail the connection is 8661f28255Scgdaborted with a diagnostic message returned. 8761f28255Scgd.It 885ce6614aSfairA NUL byte is returned on the initial socket and the command line 895ce6614aSfairis passed to the normal login shell of the user. 905ce6614aSfairThe shell inherits the network connections established by 91990562bfSwiz.Nm . 9261f28255Scgd.El 9361f28255Scgd.Sh DIAGNOSTICS 9461f28255ScgdExcept for the last one listed below, 9561f28255Scgdall diagnostic messages are returned on the initial socket, 9661f28255Scgdafter which any network connections are closed. 9761f28255ScgdAn error is indicated by a leading byte with a value of 9861f28255Scgd1 (0 is returned in step 7 above upon successful completion 9961f28255Scgdof all the steps prior to the command execution). 10061f28255Scgd.Pp 10161f28255Scgd.Bl -tag -width Ds 10261f28255Scgd.It Sy username too long 10361f28255ScgdThe name is 10461f28255Scgdlonger than 16 characters. 10561f28255Scgd.It Sy password too long 10661f28255ScgdThe password is longer than 16 characters. 10761f28255Scgd.It Sy command too long 10861f28255ScgdThe command line passed exceeds the size of the argument 10961f28255Scgdlist (as configured into the system). 11061f28255Scgd.It Sy Login incorrect. 11161f28255ScgdNo password file entry for the user name existed. 11261f28255Scgd.It Sy Password incorrect. 113da5c78b3SmrgThe wrong password was supplied. 11461f28255Scgd.It Sy \&No remote directory. 11561f28255ScgdThe 1165ce6614aSfair.Xr chdir 2 1175ce6614aSfairto the home directory failed. 11861f28255Scgd.It Sy Try again. 11961f28255ScgdA 1205ce6614aSfair.Xr fork 2 12161f28255Scgdby the server failed. 122*01869ca4Swiz.It Sy <shellname>: ... 12361f28255ScgdThe user's login shell could not be started. 12461f28255ScgdThis message is returned 12561f28255Scgdon the connection associated with the 12661f28255Scgd.Em stderr , 12761f28255Scgdand is not preceded by a flag byte. 12861f28255Scgd.El 12961f28255Scgd.Sh SEE ALSO 13061f28255Scgd.Xr rexec 3 131110806f7Swiz.Sh HISTORY 132110806f7SwizThe 133110806f7Swiz.Nm 134110806f7Swizcommand appeared in 135110806f7Swiz.Bx 4.2 . 13661f28255Scgd.Sh BUGS 13761f28255ScgdIndicating ``Login incorrect'' as opposed to ``Password incorrect'' 13861f28255Scgdis a security breach which allows people to probe a system for users 13961f28255Scgdwith null passwords. 14061f28255Scgd.Pp 14161f28255ScgdA facility to allow all data and password exchanges to be encrypted should be 14261f28255Scgdpresent. 143fc907569Slukem.Sh SECURITY CONSIDERATIONS 144fc907569SlukemAs the passwords exchanged by the client and 145fc907569Slukem.Nm 146fc907569Slukemare not encrypted, it is 147fc907569Slukem.Em strongly 148fc907569Slukemrecommended that this service is not enabled. 149