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