rshd(8) CLIX rshd(8)
NAME
rshd - Runs a remote shell server
SYNOPSIS
/usr/ip32/tcpip/rshd
DESCRIPTION
The rshd command is the server for the rcmd() function and, consequently,
for the rcmd command. The rshd server provides remote execution
facilities with authentication based on select port numbers from certain
hosts.
The rshd command listens for service requests at the port indicated in the
cmd service specification (see services(4)). When a service request is
received, the following protocol is initiated:
1. The server checks the client source port. If the port is not in the
0-1023 range, the server aborts the connection.
2. The server reads characters from the socket up to a null (\0) byte.
The resulting string is interpreted as an ASCII number, base 10.
3. If the number received in step 2 is nonzero, it is interpreted as the
port number of a secondary stream to be used for stderr. A second
connection is then created to the specified port on the client
machine. The source port of this second connection is also in the 0-
1023 range.
4. The server passes the client source address to the gethostbyaddr()
function to obtain the corresponding hostname. If the hostname cannot
be determined, the server will use the dot-notation representation of
the Internet address as the client's hostname in step 8.
5. A null-terminated username of 16 characters (maximum) is retrieved on
the initial socket. This username is interpreted as the user identity
on the client machine.
6. A null-terminated username of 16 characters (maximum) is retrieved on
the initial socket. This username is interpreted as a user identity
to use on the server machine.
7. A null-terminated command to be passed to a shell is retrieved on the
initial socket. The command length is limited by the upper boundary
on the size of the system's argument list.
8. The rshd server then authenticates the client-end user from step 5
according to the following steps.
2/94 - Intergraph Corporation 1
rshd(8) CLIX rshd(8)
a. The server-end username from step 6 is looked up in the password
file and a chdir() function is performed on the user's home
directory.
b. If either the lookup or chdir() fails, the connection is
terminated.
c. If the server-end user does not have a password, the
authentication is successful.
d. If the server-end user is not the superuser (user ID 0), the
/etc/hosts.equiv file is consulted for a list of equivalent hosts.
If the client hostname (or its alias) is present in this file and
the client-end and server-end usernames are identical, the
authentication is successful.
e. If the lookup fails or the server-end user is the superuser, the
.rhosts file in the home directory of the server-end user is
checked for the machine name and identity of the client-end user.
If this lookup fails, the connection is terminated.
9. A null byte is returned on the initial socket and the command line is
passed to the normal login shell of the server-end user. The shell
inherits the network connections established by rshd.
EXAMPLES
The rshd server is spawned by the inetd daemon when an rcmd or an rcp
connection is requested by the user (on the client side).
FILES
.rhosts
Remote user access list.
/etc/services
Service name database.
/etc/hosts
Hostname database.
/etc/hosts.equiv
Host equivalency name database.
NOTES
The authentication procedure (described in step 8 in the DESCRIPTION
section) assumes the integrity of each client machine and the connecting
medium. This is insecure, but is useful in an open environment.
CAUTIONS
2 Intergraph Corporation - 2/94
rshd(8) CLIX rshd(8)
If a local (server-end) user does not have a password, the
/etc/hosts.equiv and .rhosts files are not checked. Instead, all users
from all hosts will be able to gain access as this user. As a security
precaution, a system manager should encourage all users to have a
password. Users with no password should be given restricted privileges.
DIAGNOSTICS
Except for the last message listed, all rshd diagnostic messages are
returned on the initial socket. After the messages are returned, any
network connections are closed.
Locuser too long.
The name of the user on the client's machine is longer than 16
characters.
Remuser too long.
The name of the user on the remote machine is longer than 16
characters.
Command too long.
The command line passed exceeds the size of the argument list (as
configured into the system).
Login incorrect.
No password file entry for the username existed.
No remote directory.
The chdir() function call to the home directory failed.
Permission denied.
The authentication procedure (described in step 8 in the
DESCRIPTION section) failed.
Cannot make pipe.
The pipe needed for stderr was not created.
Try again.
A fork() function call by the server failed.
Shellname: ...
The user's login shell could not be started. This message is
returned on the connection associated with stderr and is not
preceded by a flag byte.
EXIT VALUES
The rshd command exits with a value of 0 if successful. If unsuccessful,
it exits with a nonzero value.
RELATED INFORMATION
2/94 - Intergraph Corporation 3
rshd(8) CLIX rshd(8)
Commands: inetd(8), rcmd(1), rcp(1),
Functions: gethostbyaddr(3), rcmd(3), chdir(2), fork(2)
Files: services(4), hosts(4)
4 Intergraph Corporation - 2/94