Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ rshd(1M) — GL2 W2.4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

rcp(1C)

rsh(1C)

rcmd(3N)

RSHD(1M)  —  Silicon Graphics

NAME

rshd − remote shell server

SYNOPSIS

/etc/rshd

DESCRIPTION

rshd is the server for the rcmd(3N) routine and, consequently, for the rsh(1C) and rcp(1C) programs.  It provides remote execution facilities with authentication based on privileged port numbers. 

rshd listens for service requests at the “cmd” port (ID = 514).  When a service request is received, the following protocol is initiated:

1.The server checks the client’s source port.  If the port number is not in the range 0 to 1023, the server aborts the connection. 

2.The server reads characters up to a null (\0) byte from the socket.  The resultant string is interpreted as a decimal number. 

3.A nonzero port number (Step 1) is the port number of a secondary stream to be used for the stderr.  A second connection is made to the specified port on the client machine.  The source port of this second connection is also in the range 0 to 1023. 

4.The server checks the client source address.  If the address is associated with an unknown host [see hosts(4)], the server aborts the connection. 

5.The initial socket retrieves a null-terminated user name (16 characters maximum).  This is interpreted as the user identity on the server machine. 

6.The initial socket retrieves a null-terminated user name (16 characters maximum).  This is interpreted as the user on the client machine. 

7.The initial socket retrieves a null-terminated command (to a shell).  The maximum command length is the upper bound of the system argument list. 

8.rshd then validates the user according to the following steps:

a.The remote user name is looked up in the password file and a chdir to the user’s home directory occurs.  If either the lookup or chdir fail, the connection is terminated. 

b.If the user is not the super user (user ID 0), rshd looks for “equivalent” hosts in the file /etc/hosts.equiv.  If the client host name is listed, it has been authenticated. 

c.If the lookup fails, or if the user is the super user, the file .rhosts in the remote user’s home directory is checked for the client machine name and user identity.  If this lookup fails, the connection is terminated. 

9.A null byte is returned on the stderr connection and the command line is passed to the normal login shell of the user.  The shell inherits the network connections established by rshd. 

DIAGNOSTICS

All diagnostic messages are returned on the stderr connection; then any network connections are closed.  An error is indicated by a 1 in the leading byte (Step 9 returns to a 0). 

locuser too long
The user name on the client machine is more than 16 characters.

remuser too long
The user name on the remote machine is more than 16 characters.

command too long
The command line passed exceeds the (system-configured) argument list size.

Hostname for your address unknown.
No entry in the host name database exists for the client machine.

Login incorrect.
No password exists for this user name.

No remote directory.
Could not chdir to the home directory. 

Permission denied.
The authentication procedure described above failed.

Can’t make pipe.
The pipe needed for the stderr wasn’t created. 

Try again.
The server did not fork.

/bin/sh: ...
The user’s login shell could not be started.

SEE ALSO

rcp(1C), rsh(1C), rcmd(3N)

BUGS

This authentication procedure assumes the integrity of each client machine and the connecting medium.  This is insecure, but useful in an “open” environment. 

As noted in select(3N), select only works properly on sockets and pseudoterminals.  This, in combination with the fact that nonblocking I/O is not supported on some versions of UNIX (for instance, SYSTEM III), means that signals from the remote user will not be properly communicated to the command that is being run. 

Version 2.4  —  September 29, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026