diff options
author | Colin Watson <cjwatson@debian.org> | 2006-05-12 07:53:24 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2006-05-12 07:53:24 +0000 |
commit | 3e2e0ac10674d77618c4c7339e18b83ced247492 (patch) | |
tree | 8c7fd1c2333a75d57aa1cb5dfaee2310b1f3d37a /sshd.0 | |
parent | 56cf3dc50961bcc871a2d86984049e80c24d6456 (diff) | |
parent | 16704d57999d987fb8d9ba53379841a79f016d67 (diff) |
Import OpenSSH 4.3p2.
Diffstat (limited to 'sshd.0')
-rw-r--r-- | sshd.0 | 566 |
1 files changed, 566 insertions, 0 deletions
@@ -0,0 +1,566 @@ | |||
1 | SSHD(8) OpenBSD System Manager's Manual SSHD(8) | ||
2 | |||
3 | NAME | ||
4 | sshd - OpenSSH SSH daemon | ||
5 | |||
6 | SYNOPSIS | ||
7 | sshd [-46Ddeiqt] [-b bits] [-f config_file] [-g login_grace_time] | ||
8 | [-h host_key_file] [-k key_gen_time] [-o option] [-p port] [-u len] | ||
9 | |||
10 | DESCRIPTION | ||
11 | sshd (OpenSSH Daemon) is the daemon program for ssh(1). Together these | ||
12 | programs replace rlogin and rsh, and provide secure encrypted communica- | ||
13 | tions between two untrusted hosts over an insecure network. | ||
14 | |||
15 | sshd listens for connections from clients. It is normally started at | ||
16 | boot from /etc/rc. It forks a new daemon for each incoming connection. | ||
17 | The forked daemons handle key exchange, encryption, authentication, com- | ||
18 | mand execution, and data exchange. | ||
19 | |||
20 | sshd can be configured using command-line options or a configuration file | ||
21 | (by default sshd_config(5)); command-line options override values speci- | ||
22 | fied in the configuration file. sshd rereads its configuration file when | ||
23 | it receives a hangup signal, SIGHUP, by executing itself with the name | ||
24 | and options it was started with, e.g., /usr/sbin/sshd. | ||
25 | |||
26 | The options are as follows: | ||
27 | |||
28 | -4 Forces sshd to use IPv4 addresses only. | ||
29 | |||
30 | -6 Forces sshd to use IPv6 addresses only. | ||
31 | |||
32 | -b bits | ||
33 | Specifies the number of bits in the ephemeral protocol version 1 | ||
34 | server key (default 768). | ||
35 | |||
36 | -D When this option is specified, sshd will not detach and does not | ||
37 | become a daemon. This allows easy monitoring of sshd. | ||
38 | |||
39 | -d Debug mode. The server sends verbose debug output to the system | ||
40 | log, and does not put itself in the background. The server also | ||
41 | will not fork and will only process one connection. This option | ||
42 | is only intended for debugging for the server. Multiple -d op- | ||
43 | tions increase the debugging level. Maximum is 3. | ||
44 | |||
45 | -e When this option is specified, sshd will send the output to the | ||
46 | standard error instead of the system log. | ||
47 | |||
48 | -f configuration_file | ||
49 | Specifies the name of the configuration file. The default is | ||
50 | /etc/ssh/sshd_config. sshd refuses to start if there is no con- | ||
51 | figuration file. | ||
52 | |||
53 | -g login_grace_time | ||
54 | Gives the grace time for clients to authenticate themselves (de- | ||
55 | fault 120 seconds). If the client fails to authenticate the user | ||
56 | within this many seconds, the server disconnects and exits. A | ||
57 | value of zero indicates no limit. | ||
58 | |||
59 | -h host_key_file | ||
60 | Specifies a file from which a host key is read. This option must | ||
61 | be given if sshd is not run as root (as the normal host key files | ||
62 | are normally not readable by anyone but root). The default is | ||
63 | /etc/ssh/ssh_host_key for protocol version 1, and | ||
64 | /etc/ssh/ssh_host_rsa_key and /etc/ssh/ssh_host_dsa_key for pro- | ||
65 | tocol version 2. It is possible to have multiple host key files | ||
66 | for the different protocol versions and host key algorithms. | ||
67 | |||
68 | -i Specifies that sshd is being run from inetd(8). sshd is normally | ||
69 | not run from inetd because it needs to generate the server key | ||
70 | before it can respond to the client, and this may take tens of | ||
71 | seconds. Clients would have to wait too long if the key was re- | ||
72 | generated every time. However, with small key sizes (e.g., 512) | ||
73 | using sshd from inetd may be feasible. | ||
74 | |||
75 | -k key_gen_time | ||
76 | Specifies how often the ephemeral protocol version 1 server key | ||
77 | is regenerated (default 3600 seconds, or one hour). The motiva- | ||
78 | tion for regenerating the key fairly often is that the key is not | ||
79 | stored anywhere, and after about an hour it becomes impossible to | ||
80 | recover the key for decrypting intercepted communications even if | ||
81 | the machine is cracked into or physically seized. A value of ze- | ||
82 | ro indicates that the key will never be regenerated. | ||
83 | |||
84 | -o option | ||
85 | Can be used to give options in the format used in the configura- | ||
86 | tion file. This is useful for specifying options for which there | ||
87 | is no separate command-line flag. For full details of the op- | ||
88 | tions, and their values, see sshd_config(5). | ||
89 | |||
90 | -p port | ||
91 | Specifies the port on which the server listens for connections | ||
92 | (default 22). Multiple port options are permitted. Ports speci- | ||
93 | fied in the configuration file with the Port option are ignored | ||
94 | when a command-line port is specified. Ports specified using the | ||
95 | ListenAddress option override command-line ports. | ||
96 | |||
97 | -q Quiet mode. Nothing is sent to the system log. Normally the be- | ||
98 | ginning, authentication, and termination of each connection is | ||
99 | logged. | ||
100 | |||
101 | -t Test mode. Only check the validity of the configuration file and | ||
102 | sanity of the keys. This is useful for updating sshd reliably as | ||
103 | configuration options may change. | ||
104 | |||
105 | -u len This option is used to specify the size of the field in the utmp | ||
106 | structure that holds the remote host name. If the resolved host | ||
107 | name is longer than len, the dotted decimal value will be used | ||
108 | instead. This allows hosts with very long host names that over- | ||
109 | flow this field to still be uniquely identified. Specifying -u0 | ||
110 | indicates that only dotted decimal addresses should be put into | ||
111 | the utmp file. -u0 may also be used to prevent sshd from making | ||
112 | DNS requests unless the authentication mechanism or configuration | ||
113 | requires it. Authentication mechanisms that may require DNS in- | ||
114 | clude RhostsRSAAuthentication, HostbasedAuthentication, and using | ||
115 | a from="pattern-list" option in a key file. Configuration op- | ||
116 | tions that require DNS include using a USER@HOST pattern in | ||
117 | AllowUsers or DenyUsers. | ||
118 | |||
119 | AUTHENTICATION | ||
120 | The OpenSSH SSH daemon supports SSH protocols 1 and 2. Both protocols | ||
121 | are supported by default, though this can be changed via the Protocol op- | ||
122 | tion in sshd_config(5). Protocol 2 supports both RSA and DSA keys; pro- | ||
123 | tocol 1 only supports RSA keys. For both protocols, each host has a | ||
124 | host-specific key, normally 2048 bits, used to identify the host. | ||
125 | |||
126 | Forward security for protocol 1 is provided through an additional server | ||
127 | key, normally 768 bits, generated when the server starts. This key is | ||
128 | normally regenerated every hour if it has been used, and is never stored | ||
129 | on disk. Whenever a client connects, the daemon responds with its public | ||
130 | host and server keys. The client compares the RSA host key against its | ||
131 | own database to verify that it has not changed. The client then gener- | ||
132 | ates a 256-bit random number. It encrypts this random number using both | ||
133 | the host key and the server key, and sends the encrypted number to the | ||
134 | server. Both sides then use this random number as a session key which is | ||
135 | used to encrypt all further communications in the session. The rest of | ||
136 | the session is encrypted using a conventional cipher, currently Blowfish | ||
137 | or 3DES, with 3DES being used by default. The client selects the encryp- | ||
138 | tion algorithm to use from those offered by the server. | ||
139 | |||
140 | For protocol 2, forward security is provided through a Diffie-Hellman key | ||
141 | agreement. This key agreement results in a shared session key. The rest | ||
142 | of the session is encrypted using a symmetric cipher, currently 128-bit | ||
143 | AES, Blowfish, 3DES, CAST128, Arcfour, 192-bit AES, or 256-bit AES. The | ||
144 | client selects the encryption algorithm to use from those offered by the | ||
145 | server. Additionally, session integrity is provided through a crypto- | ||
146 | graphic message authentication code (hmac-sha1 or hmac-md5). | ||
147 | |||
148 | Finally, the server and the client enter an authentication dialog. The | ||
149 | client tries to authenticate itself using host-based authentication, pub- | ||
150 | lic key authentication, challenge-response authentication, or password | ||
151 | authentication. | ||
152 | |||
153 | Regardless of the authentication type, the account is checked to ensure | ||
154 | that it is accessible. An account is not accessible if it is locked, | ||
155 | listed in DenyUsers or its group is listed in DenyGroups . The defini- | ||
156 | tion of a locked account is system dependant. Some platforms have their | ||
157 | own account database (eg AIX) and some modify the passwd field ( `*LK*' | ||
158 | on Solaris and UnixWare, `*' on HP-UX, containing `Nologin' on Tru64, a | ||
159 | leading `*LOCKED*' on FreeBSD and a leading `!!' on Linux). If there is | ||
160 | a requirement to disable password authentication for the account while | ||
161 | allowing still public-key, then the passwd field should be set to some- | ||
162 | thing other than these values (eg `NP' or `*NP*' ). | ||
163 | |||
164 | System security is not improved unless rshd, rlogind, and rexecd are dis- | ||
165 | abled (thus completely disabling rlogin and rsh into the machine). | ||
166 | |||
167 | COMMAND EXECUTION AND DATA FORWARDING | ||
168 | If the client successfully authenticates itself, a dialog for preparing | ||
169 | the session is entered. At this time the client may request things like | ||
170 | allocating a pseudo-tty, forwarding X11 connections, forwarding TCP con- | ||
171 | nections, or forwarding the authentication agent connection over the se- | ||
172 | cure channel. | ||
173 | |||
174 | Finally, the client either requests a shell or execution of a command. | ||
175 | The sides then enter session mode. In this mode, either side may send | ||
176 | data at any time, and such data is forwarded to/from the shell or command | ||
177 | on the server side, and the user terminal in the client side. | ||
178 | |||
179 | When the user program terminates and all forwarded X11 and other connec- | ||
180 | tions have been closed, the server sends command exit status to the | ||
181 | client, and both sides exit. | ||
182 | |||
183 | LOGIN PROCESS | ||
184 | When a user successfully logs in, sshd does the following: | ||
185 | |||
186 | 1. If the login is on a tty, and no command has been specified, | ||
187 | prints last login time and /etc/motd (unless prevented in the | ||
188 | configuration file or by ~/.hushlogin; see the FILES section). | ||
189 | |||
190 | 2. If the login is on a tty, records login time. | ||
191 | |||
192 | 3. Checks /etc/nologin; if it exists, prints contents and quits | ||
193 | (unless root). | ||
194 | |||
195 | 4. Changes to run with normal user privileges. | ||
196 | |||
197 | 5. Sets up basic environment. | ||
198 | |||
199 | 6. Reads the file ~/.ssh/environment, if it exists, and users are | ||
200 | allowed to change their environment. See the | ||
201 | PermitUserEnvironment option in sshd_config(5). | ||
202 | |||
203 | 7. Changes to user's home directory. | ||
204 | |||
205 | 8. If ~/.ssh/rc exists, runs it; else if /etc/ssh/sshrc exists, | ||
206 | runs it; otherwise runs xauth. The ``rc'' files are given the | ||
207 | X11 authentication protocol and cookie in standard input. | ||
208 | |||
209 | 9. Runs user's shell or command. | ||
210 | |||
211 | AUTHORIZED_KEYS FILE FORMAT | ||
212 | ~/.ssh/authorized_keys is the default file that lists the public keys | ||
213 | that are permitted for RSA authentication in protocol version 1 and for | ||
214 | public key authentication (PubkeyAuthentication) in protocol version 2. | ||
215 | AuthorizedKeysFile may be used to specify an alternative file. | ||
216 | |||
217 | Each line of the file contains one key (empty lines and lines starting | ||
218 | with a `#' are ignored as comments). Each RSA public key consists of the | ||
219 | following fields, separated by spaces: options, bits, exponent, modulus, | ||
220 | comment. Each protocol version 2 public key consists of: options, key- | ||
221 | type, base64 encoded key, comment. The options field is optional; its | ||
222 | presence is determined by whether the line starts with a number or not | ||
223 | (the options field never starts with a number). The bits, exponent, mod- | ||
224 | ulus and comment fields give the RSA key for protocol version 1; the com- | ||
225 | ment field is not used for anything (but may be convenient for the user | ||
226 | to identify the key). For protocol version 2 the keytype is ``ssh-dss'' | ||
227 | or ``ssh-rsa''. | ||
228 | |||
229 | Note that lines in this file are usually several hundred bytes long (be- | ||
230 | cause of the size of the public key encoding) up to a limit of 8 kilo- | ||
231 | bytes, which permits DSA keys up to 8 kilobits and RSA keys up to 16 | ||
232 | kilobits. You don't want to type them in; instead, copy the | ||
233 | identity.pub, id_dsa.pub or the id_rsa.pub file and edit it. | ||
234 | |||
235 | sshd enforces a minimum RSA key modulus size for protocol 1 and protocol | ||
236 | 2 keys of 768 bits. | ||
237 | |||
238 | The options (if present) consist of comma-separated option specifica- | ||
239 | tions. No spaces are permitted, except within double quotes. The fol- | ||
240 | lowing option specifications are supported (note that option keywords are | ||
241 | case-insensitive): | ||
242 | |||
243 | from="pattern-list" | ||
244 | Specifies that in addition to public key authentication, the | ||
245 | canonical name of the remote host must be present in the comma- | ||
246 | separated list of patterns (`*' and `?' serve as wildcards). The | ||
247 | list may also contain patterns negated by prefixing them with | ||
248 | `!'; if the canonical host name matches a negated pattern, the | ||
249 | key is not accepted. The purpose of this option is to optionally | ||
250 | increase security: public key authentication by itself does not | ||
251 | trust the network or name servers or anything (but the key); how- | ||
252 | ever, if somebody somehow steals the key, the key permits an in- | ||
253 | truder to log in from anywhere in the world. This additional op- | ||
254 | tion makes using a stolen key more difficult (name servers and/or | ||
255 | routers would have to be compromised in addition to just the | ||
256 | key). | ||
257 | |||
258 | command="command" | ||
259 | Specifies that the command is executed whenever this key is used | ||
260 | for authentication. The command supplied by the user (if any) is | ||
261 | ignored. The command is run on a pty if the client requests a | ||
262 | pty; otherwise it is run without a tty. If an 8-bit clean chan- | ||
263 | nel is required, one must not request a pty or should specify no- | ||
264 | pty. A quote may be included in the command by quoting it with a | ||
265 | backslash. This option might be useful to restrict certain pub- | ||
266 | lic keys to perform just a specific operation. An example might | ||
267 | be a key that permits remote backups but nothing else. Note that | ||
268 | the client may specify TCP and/or X11 forwarding unless they are | ||
269 | explicitly prohibited. Note that this option applies to shell, | ||
270 | command or subsystem execution. | ||
271 | |||
272 | environment="NAME=value" | ||
273 | Specifies that the string is to be added to the environment when | ||
274 | logging in using this key. Environment variables set this way | ||
275 | override other default environment values. Multiple options of | ||
276 | this type are permitted. Environment processing is disabled by | ||
277 | default and is controlled via the PermitUserEnvironment option. | ||
278 | This option is automatically disabled if UseLogin is enabled. | ||
279 | |||
280 | no-port-forwarding | ||
281 | Forbids TCP forwarding when this key is used for authentication. | ||
282 | Any port forward requests by the client will return an error. | ||
283 | This might be used, e.g., in connection with the command option. | ||
284 | |||
285 | no-X11-forwarding | ||
286 | Forbids X11 forwarding when this key is used for authentication. | ||
287 | Any X11 forward requests by the client will return an error. | ||
288 | |||
289 | no-agent-forwarding | ||
290 | Forbids authentication agent forwarding when this key is used for | ||
291 | authentication. | ||
292 | |||
293 | no-pty Prevents tty allocation (a request to allocate a pty will fail). | ||
294 | |||
295 | permitopen="host:port" | ||
296 | Limit local ``ssh -L'' port forwarding such that it may only con- | ||
297 | nect to the specified host and port. IPv6 addresses can be spec- | ||
298 | ified with an alternative syntax: host/port. Multiple permitopen | ||
299 | options may be applied separated by commas. No pattern matching | ||
300 | is performed on the specified hostnames, they must be literal do- | ||
301 | mains or addresses. | ||
302 | |||
303 | tunnel="n" | ||
304 | Force a tun(4) device on the server. Without this option, the | ||
305 | next available device will be used if the client requests a tun- | ||
306 | nel. | ||
307 | |||
308 | Examples | ||
309 | 1024 33 12121...312314325 ylo@foo.bar | ||
310 | |||
311 | from="*.niksula.hut.fi,!pc.niksula.hut.fi" 1024 35 23...2334 ylo@niksula | ||
312 | |||
313 | command="dump /home",no-pty,no-port-forwarding 1024 33 23...2323 back- | ||
314 | up.hut.fi | ||
315 | |||
316 | permitopen="10.2.1.55:80",permitopen="10.2.1.56:25" 1024 33 23...2323 | ||
317 | |||
318 | tunnel="0",command="sh /etc/netstart tun0" ssh-rsa AAAA...== reyk@openb- | ||
319 | sd.org | ||
320 | |||
321 | SSH_KNOWN_HOSTS FILE FORMAT | ||
322 | The /etc/ssh/ssh_known_hosts and ~/.ssh/known_hosts files contain host | ||
323 | public keys for all known hosts. The global file should be prepared by | ||
324 | the administrator (optional), and the per-user file is maintained auto- | ||
325 | matically: whenever the user connects from an unknown host its key is | ||
326 | added to the per-user file. | ||
327 | |||
328 | Each line in these files contains the following fields: hostnames, bits, | ||
329 | exponent, modulus, comment. The fields are separated by spaces. | ||
330 | |||
331 | Hostnames is a comma-separated list of patterns (`*' and `?' act as wild- | ||
332 | cards); each pattern in turn is matched against the canonical host name | ||
333 | (when authenticating a client) or against the user-supplied name (when | ||
334 | authenticating a server). A pattern may also be preceded by `!' to indi- | ||
335 | cate negation: if the host name matches a negated pattern, it is not ac- | ||
336 | cepted (by that line) even if it matched another pattern on the line. | ||
337 | |||
338 | Alternately, hostnames may be stored in a hashed form which hides host | ||
339 | names and addresses should the file's contents be disclosed. Hashed | ||
340 | hostnames start with a `|' character. Only one hashed hostname may ap- | ||
341 | pear on a single line and none of the above negation or wildcard opera- | ||
342 | tors may be applied. | ||
343 | |||
344 | Bits, exponent, and modulus are taken directly from the RSA host key; | ||
345 | they can be obtained, e.g., from /etc/ssh/ssh_host_key.pub. The optional | ||
346 | comment field continues to the end of the line, and is not used. | ||
347 | |||
348 | Lines starting with `#' and empty lines are ignored as comments. | ||
349 | |||
350 | When performing host authentication, authentication is accepted if any | ||
351 | matching line has the proper key. It is thus permissible (but not recom- | ||
352 | mended) to have several lines or different host keys for the same names. | ||
353 | This will inevitably happen when short forms of host names from different | ||
354 | domains are put in the file. It is possible that the files contain con- | ||
355 | flicting information; authentication is accepted if valid information can | ||
356 | be found from either file. | ||
357 | |||
358 | Note that the lines in these files are typically hundreds of characters | ||
359 | long, and you definitely don't want to type in the host keys by hand. | ||
360 | Rather, generate them by a script or by taking /etc/ssh/ssh_host_key.pub | ||
361 | and adding the host names at the front. | ||
362 | |||
363 | Examples | ||
364 | |||
365 | closenet,...,130.233.208.41 1024 37 159...93 closenet.hut.fi | ||
366 | cvs.openbsd.org,199.185.137.3 ssh-rsa AAAA1234.....= | ||
367 | |||
368 | # A hashed hostname | ||
369 | |1|JfKTdBh7rNbXkVAQCRp4OQoPfmI=|USECr3SWf1JUPsms5AqfD5QfxkM= ssh-rsa | ||
370 | AAAA1234.....= | ||
371 | |||
372 | FILES | ||
373 | /etc/ssh/sshd_config | ||
374 | Contains configuration data for sshd. The file format and con- | ||
375 | figuration options are described in sshd_config(5). | ||
376 | |||
377 | /etc/ssh/ssh_host_key, /etc/ssh/ssh_host_dsa_key, | ||
378 | /etc/ssh/ssh_host_rsa_key | ||
379 | These three files contain the private parts of the host keys. | ||
380 | These files should only be owned by root, readable only by root, | ||
381 | and not accessible to others. Note that sshd does not start if | ||
382 | this file is group/world-accessible. | ||
383 | |||
384 | /etc/ssh/ssh_host_key.pub, /etc/ssh/ssh_host_dsa_key.pub, | ||
385 | /etc/ssh/ssh_host_rsa_key.pub | ||
386 | These three files contain the public parts of the host keys. | ||
387 | These files should be world-readable but writable only by root. | ||
388 | Their contents should match the respective private parts. These | ||
389 | files are not really used for anything; they are provided for the | ||
390 | convenience of the user so their contents can be copied to known | ||
391 | hosts files. These files are created using ssh-keygen(1). | ||
392 | |||
393 | /etc/moduli | ||
394 | Contains Diffie-Hellman groups used for the "Diffie-Hellman Group | ||
395 | Exchange". The file format is described in moduli(5). | ||
396 | |||
397 | /var/empty | ||
398 | chroot(2) directory used by sshd during privilege separation in | ||
399 | the pre-authentication phase. The directory should not contain | ||
400 | any files and must be owned by root and not group or world- | ||
401 | writable. | ||
402 | |||
403 | /var/run/sshd.pid | ||
404 | Contains the process ID of the sshd listening for connections (if | ||
405 | there are several daemons running concurrently for different | ||
406 | ports, this contains the process ID of the one started last). | ||
407 | The content of this file is not sensitive; it can be world-read- | ||
408 | able. | ||
409 | |||
410 | ~/.ssh/authorized_keys | ||
411 | Lists the public keys (RSA or DSA) that can be used to log into | ||
412 | the user's account. This file must be readable by root (which | ||
413 | may on some machines imply it being world-readable if the user's | ||
414 | home directory resides on an NFS volume). It is recommended that | ||
415 | it not be accessible by others. The format of this file is de- | ||
416 | scribed above. Users will place the contents of their | ||
417 | identity.pub, id_dsa.pub and/or id_rsa.pub files into this file, | ||
418 | as described in ssh-keygen(1). | ||
419 | |||
420 | /etc/ssh/ssh_known_hosts, ~/.ssh/known_hosts | ||
421 | These files are consulted when using rhosts with RSA host authen- | ||
422 | tication or protocol version 2 hostbased authentication to check | ||
423 | the public key of the host. The key must be listed in one of | ||
424 | these files to be accepted. The client uses the same files to | ||
425 | verify that it is connecting to the correct remote host. These | ||
426 | files should be writable only by root/the owner. | ||
427 | /etc/ssh/ssh_known_hosts should be world-readable, and | ||
428 | ~/.ssh/known_hosts can, but need not be, world-readable. | ||
429 | |||
430 | /etc/motd | ||
431 | See motd(5). | ||
432 | |||
433 | ~/.hushlogin | ||
434 | This file is used to suppress printing the last login time and | ||
435 | /etc/motd, if PrintLastLog and PrintMotd, respectively, are en- | ||
436 | abled. It does not suppress printing of the banner specified by | ||
437 | Banner. | ||
438 | |||
439 | /etc/nologin | ||
440 | If this file exists, sshd refuses to let anyone except root log | ||
441 | in. The contents of the file are displayed to anyone trying to | ||
442 | log in, and non-root connections are refused. The file should be | ||
443 | world-readable. | ||
444 | |||
445 | /etc/hosts.allow, /etc/hosts.deny | ||
446 | Access controls that should be enforced by tcp-wrappers are de- | ||
447 | fined here. Further details are described in hosts_access(5). | ||
448 | |||
449 | ~/.rhosts | ||
450 | This file is used during RhostsRSAAuthentication and | ||
451 | HostbasedAuthentication and contains host-username pairs, sepa- | ||
452 | rated by a space, one per line. The given user on the corre- | ||
453 | sponding host is permitted to log in without a password. The | ||
454 | same file is used by rlogind and rshd. The file must be writable | ||
455 | only by the user; it is recommended that it not be accessible by | ||
456 | others. | ||
457 | |||
458 | It is also possible to use netgroups in the file. Either host or | ||
459 | user name may be of the form +@groupname to specify all hosts or | ||
460 | all users in the group. | ||
461 | |||
462 | ~/.shosts | ||
463 | For ssh, this file is exactly the same as for .rhosts. However, | ||
464 | this file is not used by rlogin and rshd, so using this permits | ||
465 | access using SSH only. | ||
466 | |||
467 | /etc/hosts.equiv | ||
468 | This file is used during RhostsRSAAuthentication and | ||
469 | HostbasedAuthentication authentication. In the simplest form, | ||
470 | this file contains host names, one per line. Users on those | ||
471 | hosts are permitted to log in without a password, provided they | ||
472 | have the same user name on both machines. The host name may also | ||
473 | be followed by a user name; such users are permitted to log in as | ||
474 | any user on this machine (except root). Additionally, the syntax | ||
475 | ``+@group'' can be used to specify netgroups. Negated entries | ||
476 | start with `-'. | ||
477 | |||
478 | If the client host/user is successfully matched in this file, lo- | ||
479 | gin is automatically permitted provided the client and server us- | ||
480 | er names are the same. Additionally, successful client host key | ||
481 | authentication is required. This file must be writable only by | ||
482 | root; it is recommended that it be world-readable. | ||
483 | |||
484 | Warning: It is almost never a good idea to use user names in | ||
485 | hosts.equiv. Beware that it really means that the named user(s) | ||
486 | can log in as anybody, which includes bin, daemon, adm, and other | ||
487 | accounts that own critical binaries and directories. Using a us- | ||
488 | er name practically grants the user root access. The only valid | ||
489 | use for user names that I can think of is in negative entries. | ||
490 | |||
491 | Note that this warning also applies to rsh/rlogin. | ||
492 | |||
493 | /etc/shosts.equiv | ||
494 | This is processed exactly as /etc/hosts.equiv. However, this | ||
495 | file may be useful in environments that want to run both | ||
496 | rsh/rlogin and ssh. | ||
497 | |||
498 | ~/.ssh/environment | ||
499 | This file is read into the environment at login (if it exists). | ||
500 | It can only contain empty lines, comment lines (that start with | ||
501 | `#'), and assignment lines of the form name=value. The file | ||
502 | should be writable only by the user; it need not be readable by | ||
503 | anyone else. Environment processing is disabled by default and | ||
504 | is controlled via the PermitUserEnvironment option. | ||
505 | |||
506 | ~/.ssh/rc | ||
507 | If this file exists, it is run with /bin/sh after reading the en- | ||
508 | vironment files but before starting the user's shell or command. | ||
509 | It must not produce any output on stdout; stderr must be used in- | ||
510 | stead. If X11 forwarding is in use, it will receive the "proto | ||
511 | cookie" pair in its standard input (and DISPLAY in its environ- | ||
512 | ment). The script must call xauth(1) because sshd will not run | ||
513 | xauth automatically to add X11 cookies. | ||
514 | |||
515 | The primary purpose of this file is to run any initialization | ||
516 | routines which may be needed before the user's home directory be- | ||
517 | comes accessible; AFS is a particular example of such an environ- | ||
518 | ment. | ||
519 | |||
520 | This file will probably contain some initialization code followed | ||
521 | by something similar to: | ||
522 | |||
523 | if read proto cookie && [ -n "$DISPLAY" ]; then | ||
524 | if [ `echo $DISPLAY | cut -c1-10` = 'localhost:' ]; then | ||
525 | # X11UseLocalhost=yes | ||
526 | echo add unix:`echo $DISPLAY | | ||
527 | cut -c11-` $proto $cookie | ||
528 | else | ||
529 | # X11UseLocalhost=no | ||
530 | echo add $DISPLAY $proto $cookie | ||
531 | fi | xauth -q - | ||
532 | fi | ||
533 | |||
534 | If this file does not exist, /etc/ssh/sshrc is run, and if that | ||
535 | does not exist either, xauth is used to add the cookie. | ||
536 | |||
537 | This file should be writable only by the user, and need not be | ||
538 | readable by anyone else. | ||
539 | |||
540 | /etc/ssh/sshrc | ||
541 | Like ~/.ssh/rc. This can be used to specify machine-specific lo- | ||
542 | gin-time initializations globally. This file should be writable | ||
543 | only by root, and should be world-readable. | ||
544 | |||
545 | SEE ALSO | ||
546 | scp(1), sftp(1), ssh(1), ssh-add(1), ssh-agent(1), ssh-keygen(1), | ||
547 | chroot(2), hosts_access(5), login.conf(5), moduli(5), sshd_config(5), | ||
548 | inetd(8), sftp-server(8) | ||
549 | |||
550 | T. Ylonen, T. Kivinen, M. Saarinen, T. Rinne, and S. Lehtinen, SSH | ||
551 | Protocol Architecture, draft-ietf-secsh-architecture-12.txt, January | ||
552 | 2002, work in progress material. | ||
553 | |||
554 | M. Friedl, N. Provos, and W. A. Simpson, Diffie-Hellman Group Exchange | ||
555 | for the SSH Transport Layer Protocol, draft-ietf-secsh-dh-group- | ||
556 | exchange-02.txt, January 2002, work in progress material. | ||
557 | |||
558 | AUTHORS | ||
559 | OpenSSH is a derivative of the original and free ssh 1.2.12 release by | ||
560 | Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo | ||
561 | de Raadt and Dug Song removed many bugs, re-added newer features and | ||
562 | created OpenSSH. Markus Friedl contributed the support for SSH protocol | ||
563 | versions 1.5 and 2.0. Niels Provos and Markus Friedl contributed support | ||
564 | for privilege separation. | ||
565 | |||
566 | OpenBSD 3.9 September 25, 1999 9 | ||