Commit | Line | Data |
---|---|---|
d8a59ffe KM |
1 | .\" Copyright (c) 1983 Regents of the University of California. |
2 | .\" All rights reserved. The Berkeley software License Agreement | |
3 | .\" specifies the terms and conditions for redistribution. | |
4 | .\" | |
2ca7130d | 5 | .\" @(#)rshd.8 6.1 (Berkeley) %G% |
d8a59ffe | 6 | .\" |
2ca7130d | 7 | .TH RSHD 8C "" |
d8a59ffe KM |
8 | .UC 5 |
9 | .SH NAME | |
10 | rshd \- remote shell server | |
11 | .SH SYNOPSIS | |
12 | .B /etc/rshd | |
13 | .SH DESCRIPTION | |
14 | .I Rshd | |
15 | is the server for the | |
16 | .IR rcmd (3X) | |
17 | routine and, consequently, for the | |
18 | .IR rsh (1C) | |
19 | program. The server provides remote execution facilities | |
20 | with authentication based on privileged port numbers. | |
21 | .PP | |
22 | .I Rshd | |
23 | listens for service requests at the port indicated in | |
24 | the ``cmd'' service specification; see | |
25 | .IR services (5). | |
26 | When a service request is received the following protocol | |
27 | is initiated: | |
28 | .IP 1) | |
29 | The server checks the client's source port. | |
30 | If the port is not in the range 0-1023, the server | |
31 | aborts the connection. | |
32 | .IP 2) | |
33 | The server reads characters from the socket up | |
34 | to a null (`\e0') byte. The resultant string is | |
35 | interpreted as an ASCII number, base 10. | |
36 | .IP 3) | |
37 | If the number received in step 1 is non-zero, | |
38 | it is interpreted as the port number of a secondary | |
39 | stream to be used for the | |
40 | .BR stderr . | |
41 | A second connection is then created to the specified | |
42 | port on the client's machine. The source port of this | |
43 | second connection is also in the range 0-1023. | |
44 | .IP 4) | |
45 | The server checks the client's source address. | |
46 | If the address is associated with a host for which no | |
47 | corresponding entry exists in the host name data base (see | |
48 | .IR hosts (5)), | |
49 | the server aborts the connection. | |
50 | .IP 5) | |
51 | A null terminated user name of at most 16 characters | |
52 | is retrieved on the initial socket. This user name | |
53 | is interpreted as a user identity to use on the | |
54 | .BR server 's | |
55 | machine. | |
56 | .IP 6) | |
57 | A null terminated user name of at most 16 characters | |
58 | is retrieved on the initial socket. This user name | |
59 | is interpreted as the user identity on the | |
60 | .BR client 's | |
61 | machine. | |
62 | .IP 7) | |
63 | A null terminated command to be passed to a | |
64 | shell is retrieved on the initial socket. The length of | |
65 | the command is limited by the upper bound on the size of | |
66 | the system's argument list. | |
67 | .IP 8) | |
68 | .I Rshd | |
69 | then validates the user according to the following steps. | |
70 | The remote user name is looked up in the password file | |
71 | and a | |
72 | .I chdir | |
73 | is performed to the user's home directory. If either | |
74 | the lookup or | |
75 | .I chdir | |
76 | fail, the connection is terminated. | |
77 | If the user is not the super-user, (user id 0), the file | |
78 | .I /etc/hosts.equiv | |
79 | is consulted for a list of hosts considered ``equivalent''. | |
80 | If the client's host name is present in this file, the | |
81 | authentication is considered successful. If the lookup | |
82 | fails, or the user is the super-user, then the file | |
83 | .I .rhosts | |
84 | in the home directory of the remote user is checked for | |
85 | the machine name and identity of the user on the client's | |
86 | machine. If this lookup fails, the connection is terminated. | |
87 | .IP 9) | |
88 | A null byte is returned on the connection associated | |
89 | with the | |
90 | .B stderr | |
91 | and the command line is passed to the normal login | |
92 | shell of the user. The | |
93 | shell inherits the network connections established | |
94 | by | |
95 | .IR rshd . | |
96 | .SH DIAGNOSTICS | |
97 | All diagnostic messages are returned on the connection | |
98 | associated with the | |
99 | .BR stderr , | |
100 | after which any network connections are closed. | |
101 | An error is indicated by a leading byte with a value of | |
102 | 1 (0 is returned in step 9 above upon successful completion | |
103 | of all the steps prior to the command execution). | |
104 | .PP | |
105 | .B ``locuser too long'' | |
106 | .br | |
107 | The name of the user on the client's machine is | |
108 | longer than 16 characters. | |
109 | .PP | |
110 | .B ``remuser too long'' | |
111 | .br | |
112 | The name of the user on the remote machine is | |
113 | longer than 16 characters. | |
114 | .PP | |
115 | .B ``command too long '' | |
116 | .br | |
117 | The command line passed exceeds the size of the argument | |
118 | list (as configured into the system). | |
119 | .PP | |
120 | .B ``Hostname for your address unknown.'' | |
121 | .br | |
122 | No entry in the host name database existed for | |
123 | the client's machine. | |
124 | .PP | |
125 | .B ``Login incorrect.'' | |
126 | .br | |
127 | No password file entry for the user name existed. | |
128 | .PP | |
129 | .B ``No remote directory.'' | |
130 | .br | |
131 | The | |
132 | .I chdir | |
133 | command to the home directory failed. | |
134 | .PP | |
135 | .B ``Permission denied.'' | |
136 | .br | |
137 | The authentication procedure described above failed. | |
138 | .PP | |
139 | .B ``Can't make pipe.'' | |
140 | .br | |
141 | The pipe needed for the | |
142 | .BR stderr , | |
143 | wasn't created. | |
144 | .PP | |
145 | .B ``Try again.'' | |
146 | .br | |
147 | A | |
148 | .I fork | |
149 | by the server failed. | |
150 | .PP | |
151 | .B ``/bin/sh: ...'' | |
152 | .br | |
153 | The user's login shell could not be started. | |
154 | .SH SEE ALSO | |
155 | rsh(1C), | |
156 | rcmd(3X) | |
157 | .SH BUGS | |
158 | The authentication procedure used here assumes the integrity | |
159 | of each client machine and the connecting medium. This is | |
160 | insecure, but is useful in an ``open'' environment. | |
161 | .PP | |
162 | A facility to allow all data exchanges to be encrypted should be | |
163 | present. |