diff options
Diffstat (limited to 'sshd.0')
-rw-r--r-- | sshd.0 | 391 |
1 files changed, 202 insertions, 189 deletions
@@ -10,19 +10,19 @@ SYNOPSIS | |||
10 | 10 | ||
11 | DESCRIPTION | 11 | DESCRIPTION |
12 | sshd (OpenSSH Daemon) is the daemon program for ssh(1). Together these | 12 | sshd (OpenSSH Daemon) is the daemon program for ssh(1). Together these |
13 | programs replace rlogin(1) and rsh(1), and provide secure encrypted com- | 13 | programs replace rlogin(1) and rsh(1), and provide secure encrypted |
14 | munications between two untrusted hosts over an insecure network. | 14 | communications between two untrusted hosts over an insecure network. |
15 | 15 | ||
16 | sshd listens for connections from clients. It is normally started at | 16 | sshd listens for connections from clients. It is normally started at |
17 | boot from /etc/rc. It forks a new daemon for each incoming connection. | 17 | boot from /etc/rc. It forks a new daemon for each incoming connection. |
18 | The forked daemons handle key exchange, encryption, authentication, com- | 18 | The forked daemons handle key exchange, encryption, authentication, |
19 | mand execution, and data exchange. | 19 | command execution, and data exchange. |
20 | 20 | ||
21 | sshd can be configured using command-line options or a configuration file | 21 | sshd can be configured using command-line options or a configuration file |
22 | (by default sshd_config(5)); command-line options override values speci- | 22 | (by default sshd_config(5)); command-line options override values |
23 | fied in the configuration file. sshd rereads its configuration file when | 23 | specified in the configuration file. sshd rereads its configuration file |
24 | it receives a hangup signal, SIGHUP, by executing itself with the name | 24 | when it receives a hangup signal, SIGHUP, by executing itself with the |
25 | and options it was started with, e.g. /usr/sbin/sshd. | 25 | name and options it was started with, e.g. /usr/sbin/sshd. |
26 | 26 | ||
27 | The options are as follows: | 27 | The options are as follows: |
28 | 28 | ||
@@ -38,87 +38,89 @@ DESCRIPTION | |||
38 | Specify the connection parameters to use for the -T extended test | 38 | Specify the connection parameters to use for the -T extended test |
39 | mode. If provided, any Match directives in the configuration | 39 | mode. If provided, any Match directives in the configuration |
40 | file that would apply to the specified user, host, and address | 40 | file that would apply to the specified user, host, and address |
41 | will be set before the configuration is written to standard out- | 41 | will be set before the configuration is written to standard |
42 | put. The connection parameters are supplied as keyword=value | 42 | output. The connection parameters are supplied as keyword=value |
43 | pairs. The keywords are ``user'', ``host'', and ``addr''. All | 43 | pairs. The keywords are ``user'', ``host'', and ``addr''. All |
44 | are required and may be supplied in any order, either with multi- | 44 | are required and may be supplied in any order, either with |
45 | ple -C options or as a comma-separated list. | 45 | multiple -C options or as a comma-separated list. |
46 | 46 | ||
47 | -c host_certificate_file | 47 | -c host_certificate_file |
48 | Specifies a path to a certificate file to identify sshd during | 48 | Specifies a path to a certificate file to identify sshd during |
49 | key exchange. The certificate file must match a host key file | 49 | key exchange. The certificate file must match a host key file |
50 | specified using the -h option or the HostKey configuration direc- | 50 | specified using the -h option or the HostKey configuration |
51 | tive. | 51 | directive. |
52 | 52 | ||
53 | -D When this option is specified, sshd will not detach and does not | 53 | -D When this option is specified, sshd will not detach and does not |
54 | become a daemon. This allows easy monitoring of sshd. | 54 | become a daemon. This allows easy monitoring of sshd. |
55 | 55 | ||
56 | -d Debug mode. The server sends verbose debug output to standard | 56 | -d Debug mode. The server sends verbose debug output to standard |
57 | error, and does not put itself in the background. The server al- | 57 | error, and does not put itself in the background. The server |
58 | so will not fork and will only process one connection. This op- | 58 | also will not fork and will only process one connection. This |
59 | tion is only intended for debugging for the server. Multiple -d | 59 | option is only intended for debugging for the server. Multiple |
60 | options increase the debugging level. Maximum is 3. | 60 | -d options increase the debugging level. Maximum is 3. |
61 | 61 | ||
62 | -e When this option is specified, sshd will send the output to the | 62 | -e When this option is specified, sshd will send the output to the |
63 | standard error instead of the system log. | 63 | standard error instead of the system log. |
64 | 64 | ||
65 | -f config_file | 65 | -f config_file |
66 | Specifies the name of the configuration file. The default is | 66 | Specifies the name of the configuration file. The default is |
67 | /etc/ssh/sshd_config. sshd refuses to start if there is no con- | 67 | /etc/ssh/sshd_config. sshd refuses to start if there is no |
68 | figuration file. | 68 | configuration file. |
69 | 69 | ||
70 | -g login_grace_time | 70 | -g login_grace_time |
71 | Gives the grace time for clients to authenticate themselves (de- | 71 | Gives the grace time for clients to authenticate themselves |
72 | fault 120 seconds). If the client fails to authenticate the user | 72 | (default 120 seconds). If the client fails to authenticate the |
73 | within this many seconds, the server disconnects and exits. A | 73 | user within this many seconds, the server disconnects and exits. |
74 | value of zero indicates no limit. | 74 | A value of zero indicates no limit. |
75 | 75 | ||
76 | -h host_key_file | 76 | -h host_key_file |
77 | Specifies a file from which a host key is read. This option must | 77 | Specifies a file from which a host key is read. This option must |
78 | be given if sshd is not run as root (as the normal host key files | 78 | be given if sshd is not run as root (as the normal host key files |
79 | are normally not readable by anyone but root). The default is | 79 | are normally not readable by anyone but root). The default is |
80 | /etc/ssh/ssh_host_key for protocol version 1, and | 80 | /etc/ssh/ssh_host_key for protocol version 1, and |
81 | /etc/ssh/ssh_host_rsa_key and /etc/ssh/ssh_host_dsa_key for pro- | 81 | /etc/ssh/ssh_host_rsa_key and /etc/ssh/ssh_host_dsa_key for |
82 | tocol version 2. It is possible to have multiple host key files | 82 | protocol version 2. It is possible to have multiple host key |
83 | for the different protocol versions and host key algorithms. | 83 | files for the different protocol versions and host key |
84 | algorithms. | ||
84 | 85 | ||
85 | -i Specifies that sshd is being run from inetd(8). sshd is normally | 86 | -i Specifies that sshd is being run from inetd(8). sshd is normally |
86 | not run from inetd because it needs to generate the server key | 87 | not run from inetd because it needs to generate the server key |
87 | before it can respond to the client, and this may take tens of | 88 | before it can respond to the client, and this may take tens of |
88 | seconds. Clients would have to wait too long if the key was re- | 89 | seconds. Clients would have to wait too long if the key was |
89 | generated every time. However, with small key sizes (e.g. 512) | 90 | regenerated every time. However, with small key sizes (e.g. 512) |
90 | using sshd from inetd may be feasible. | 91 | using sshd from inetd may be feasible. |
91 | 92 | ||
92 | -k key_gen_time | 93 | -k key_gen_time |
93 | Specifies how often the ephemeral protocol version 1 server key | 94 | Specifies how often the ephemeral protocol version 1 server key |
94 | is regenerated (default 3600 seconds, or one hour). The motiva- | 95 | is regenerated (default 3600 seconds, or one hour). The |
95 | tion for regenerating the key fairly often is that the key is not | 96 | motivation for regenerating the key fairly often is that the key |
96 | stored anywhere, and after about an hour it becomes impossible to | 97 | is not stored anywhere, and after about an hour it becomes |
97 | recover the key for decrypting intercepted communications even if | 98 | impossible to recover the key for decrypting intercepted |
98 | the machine is cracked into or physically seized. A value of ze- | 99 | communications even if the machine is cracked into or physically |
99 | ro indicates that the key will never be regenerated. | 100 | seized. A value of zero indicates that the key will never be |
101 | regenerated. | ||
100 | 102 | ||
101 | -o option | 103 | -o option |
102 | Can be used to give options in the format used in the configura- | 104 | Can be used to give options in the format used in the |
103 | tion file. This is useful for specifying options for which there | 105 | configuration file. This is useful for specifying options for |
104 | is no separate command-line flag. For full details of the op- | 106 | which there is no separate command-line flag. For full details |
105 | tions, and their values, see sshd_config(5). | 107 | of the options, and their values, see sshd_config(5). |
106 | 108 | ||
107 | -p port | 109 | -p port |
108 | Specifies the port on which the server listens for connections | 110 | Specifies the port on which the server listens for connections |
109 | (default 22). Multiple port options are permitted. Ports speci- | 111 | (default 22). Multiple port options are permitted. Ports |
110 | fied in the configuration file with the Port option are ignored | 112 | specified in the configuration file with the Port option are |
111 | when a command-line port is specified. Ports specified using the | 113 | ignored when a command-line port is specified. Ports specified |
112 | ListenAddress option override command-line ports. | 114 | using the ListenAddress option override command-line ports. |
113 | 115 | ||
114 | -q Quiet mode. Nothing is sent to the system log. Normally the be- | 116 | -q Quiet mode. Nothing is sent to the system log. Normally the |
115 | ginning, authentication, and termination of each connection is | 117 | beginning, authentication, and termination of each connection is |
116 | logged. | 118 | logged. |
117 | 119 | ||
118 | -T Extended test mode. Check the validity of the configuration | 120 | -T Extended test mode. Check the validity of the configuration |
119 | file, output the effective configuration to stdout and then exit. | 121 | file, output the effective configuration to stdout and then exit. |
120 | Optionally, Match rules may be applied by specifying the connec- | 122 | Optionally, Match rules may be applied by specifying the |
121 | tion parameters using one or more -C options. | 123 | connection parameters using one or more -C options. |
122 | 124 | ||
123 | -t Test mode. Only check the validity of the configuration file and | 125 | -t Test mode. Only check the validity of the configuration file and |
124 | sanity of the keys. This is useful for updating sshd reliably as | 126 | sanity of the keys. This is useful for updating sshd reliably as |
@@ -127,76 +129,76 @@ DESCRIPTION | |||
127 | -u len This option is used to specify the size of the field in the utmp | 129 | -u len This option is used to specify the size of the field in the utmp |
128 | structure that holds the remote host name. If the resolved host | 130 | structure that holds the remote host name. If the resolved host |
129 | name is longer than len, the dotted decimal value will be used | 131 | name is longer than len, the dotted decimal value will be used |
130 | instead. This allows hosts with very long host names that over- | 132 | instead. This allows hosts with very long host names that |
131 | flow this field to still be uniquely identified. Specifying -u0 | 133 | overflow this field to still be uniquely identified. Specifying |
132 | indicates that only dotted decimal addresses should be put into | 134 | -u0 indicates that only dotted decimal addresses should be put |
133 | the utmp file. -u0 may also be used to prevent sshd from making | 135 | into the utmp file. -u0 may also be used to prevent sshd from |
134 | DNS requests unless the authentication mechanism or configuration | 136 | making DNS requests unless the authentication mechanism or |
135 | requires it. Authentication mechanisms that may require DNS in- | 137 | configuration requires it. Authentication mechanisms that may |
136 | clude RhostsRSAAuthentication, HostbasedAuthentication, and using | 138 | require DNS include RhostsRSAAuthentication, |
137 | a from="pattern-list" option in a key file. Configuration op- | 139 | HostbasedAuthentication, and using a from="pattern-list" option |
138 | tions that require DNS include using a USER@HOST pattern in | 140 | in a key file. Configuration options that require DNS include |
139 | AllowUsers or DenyUsers. | 141 | using a USER@HOST pattern in AllowUsers or DenyUsers. |
140 | 142 | ||
141 | AUTHENTICATION | 143 | AUTHENTICATION |
142 | The OpenSSH SSH daemon supports SSH protocols 1 and 2. The default is to | 144 | The OpenSSH SSH daemon supports SSH protocols 1 and 2. The default is to |
143 | use protocol 2 only, though this can be changed via the Protocol option | 145 | use protocol 2 only, though this can be changed via the Protocol option |
144 | in sshd_config(5). Protocol 2 supports both RSA and DSA keys; protocol 1 | 146 | in sshd_config(5). Protocol 2 supports both RSA and DSA keys; protocol 1 |
145 | only supports RSA keys. For both protocols, each host has a host-specif- | 147 | only supports RSA keys. For both protocols, each host has a host- |
146 | ic key, normally 2048 bits, used to identify the host. | 148 | specific key, normally 2048 bits, used to identify the host. |
147 | 149 | ||
148 | Forward security for protocol 1 is provided through an additional server | 150 | Forward security for protocol 1 is provided through an additional server |
149 | key, normally 768 bits, generated when the server starts. This key is | 151 | key, normally 768 bits, generated when the server starts. This key is |
150 | normally regenerated every hour if it has been used, and is never stored | 152 | normally regenerated every hour if it has been used, and is never stored |
151 | on disk. Whenever a client connects, the daemon responds with its public | 153 | on disk. Whenever a client connects, the daemon responds with its public |
152 | host and server keys. The client compares the RSA host key against its | 154 | host and server keys. The client compares the RSA host key against its |
153 | own database to verify that it has not changed. The client then gener- | 155 | own database to verify that it has not changed. The client then |
154 | ates a 256-bit random number. It encrypts this random number using both | 156 | generates a 256-bit random number. It encrypts this random number using |
155 | the host key and the server key, and sends the encrypted number to the | 157 | both the host key and the server key, and sends the encrypted number to |
156 | server. Both sides then use this random number as a session key which is | 158 | the server. Both sides then use this random number as a session key |
157 | used to encrypt all further communications in the session. The rest of | 159 | which is used to encrypt all further communications in the session. The |
158 | the session is encrypted using a conventional cipher, currently Blowfish | 160 | rest of the session is encrypted using a conventional cipher, currently |
159 | or 3DES, with 3DES being used by default. The client selects the encryp- | 161 | Blowfish or 3DES, with 3DES being used by default. The client selects |
160 | tion algorithm to use from those offered by the server. | 162 | the encryption algorithm to use from those offered by the server. |
161 | 163 | ||
162 | For protocol 2, forward security is provided through a Diffie-Hellman key | 164 | For protocol 2, forward security is provided through a Diffie-Hellman key |
163 | agreement. This key agreement results in a shared session key. The rest | 165 | agreement. This key agreement results in a shared session key. The rest |
164 | of the session is encrypted using a symmetric cipher, currently 128-bit | 166 | of the session is encrypted using a symmetric cipher, currently 128-bit |
165 | AES, Blowfish, 3DES, CAST128, Arcfour, 192-bit AES, or 256-bit AES. The | 167 | AES, Blowfish, 3DES, CAST128, Arcfour, 192-bit AES, or 256-bit AES. The |
166 | client selects the encryption algorithm to use from those offered by the | 168 | client selects the encryption algorithm to use from those offered by the |
167 | server. Additionally, session integrity is provided through a crypto- | 169 | server. Additionally, session integrity is provided through a |
168 | graphic message authentication code (hmac-md5, hmac-sha1, umac-64 or | 170 | cryptographic message authentication code (hmac-md5, hmac-sha1, umac-64 |
169 | hmac-ripemd160). | 171 | or hmac-ripemd160). |
170 | 172 | ||
171 | Finally, the server and the client enter an authentication dialog. The | 173 | Finally, the server and the client enter an authentication dialog. The |
172 | client tries to authenticate itself using host-based authentication, pub- | 174 | client tries to authenticate itself using host-based authentication, |
173 | lic key authentication, challenge-response authentication, or password | 175 | public key authentication, challenge-response authentication, or password |
174 | authentication. | 176 | authentication. |
175 | 177 | ||
176 | Regardless of the authentication type, the account is checked to ensure | 178 | Regardless of the authentication type, the account is checked to ensure |
177 | that it is accessible. An account is not accessible if it is locked, | 179 | that it is accessible. An account is not accessible if it is locked, |
178 | listed in DenyUsers or its group is listed in DenyGroups . The defini- | 180 | listed in DenyUsers or its group is listed in DenyGroups . The |
179 | tion of a locked account is system dependant. Some platforms have their | 181 | definition of a locked account is system dependant. Some platforms have |
180 | own account database (eg AIX) and some modify the passwd field ( `*LK*' | 182 | their own account database (eg AIX) and some modify the passwd field ( |
181 | on Solaris and UnixWare, `*' on HP-UX, containing `Nologin' on Tru64, a | 183 | `*LK*' on Solaris and UnixWare, `*' on HP-UX, containing `Nologin' on |
182 | leading `*LOCKED*' on FreeBSD and a leading `!' on most Linuxes). If | 184 | Tru64, a leading `*LOCKED*' on FreeBSD and a leading `!' on most |
183 | there is a requirement to disable password authentication for the account | 185 | Linuxes). If there is a requirement to disable password authentication |
184 | while allowing still public-key, then the passwd field should be set to | 186 | for the account while allowing still public-key, then the passwd field |
185 | something other than these values (eg `NP' or `*NP*' ). | 187 | should be set to something other than these values (eg `NP' or `*NP*' ). |
186 | 188 | ||
187 | If the client successfully authenticates itself, a dialog for preparing | 189 | If the client successfully authenticates itself, a dialog for preparing |
188 | the session is entered. At this time the client may request things like | 190 | the session is entered. At this time the client may request things like |
189 | allocating a pseudo-tty, forwarding X11 connections, forwarding TCP con- | 191 | allocating a pseudo-tty, forwarding X11 connections, forwarding TCP |
190 | nections, or forwarding the authentication agent connection over the se- | 192 | connections, or forwarding the authentication agent connection over the |
191 | cure channel. | 193 | secure channel. |
192 | 194 | ||
193 | After this, the client either requests a shell or execution of a command. | 195 | After this, the client either requests a shell or execution of a command. |
194 | The sides then enter session mode. In this mode, either side may send | 196 | The sides then enter session mode. In this mode, either side may send |
195 | data at any time, and such data is forwarded to/from the shell or command | 197 | data at any time, and such data is forwarded to/from the shell or command |
196 | on the server side, and the user terminal in the client side. | 198 | on the server side, and the user terminal in the client side. |
197 | 199 | ||
198 | When the user program terminates and all forwarded X11 and other connec- | 200 | When the user program terminates and all forwarded X11 and other |
199 | tions have been closed, the server sends command exit status to the | 201 | connections have been closed, the server sends command exit status to the |
200 | client, and both sides exit. | 202 | client, and both sides exit. |
201 | 203 | ||
202 | LOGIN PROCESS | 204 | LOGIN PROCESS |
@@ -230,11 +232,12 @@ LOGIN PROCESS | |||
230 | 232 | ||
231 | SSHRC | 233 | SSHRC |
232 | If the file ~/.ssh/rc exists, sh(1) runs it after reading the environment | 234 | If the file ~/.ssh/rc exists, sh(1) runs it after reading the environment |
233 | files but before starting the user's shell or command. It must not pro- | 235 | files but before starting the user's shell or command. It must not |
234 | duce any output on stdout; stderr must be used instead. If X11 forward- | 236 | produce any output on stdout; stderr must be used instead. If X11 |
235 | ing is in use, it will receive the "proto cookie" pair in its standard | 237 | forwarding is in use, it will receive the "proto cookie" pair in its |
236 | input (and DISPLAY in its environment). The script must call xauth(1) | 238 | standard input (and DISPLAY in its environment). The script must call |
237 | because sshd will not run xauth automatically to add X11 cookies. | 239 | xauth(1) because sshd will not run xauth automatically to add X11 |
240 | cookies. | ||
238 | 241 | ||
239 | The primary purpose of this file is to run any initialization routines | 242 | The primary purpose of this file is to run any initialization routines |
240 | which may be needed before the user's home directory becomes accessible; | 243 | which may be needed before the user's home directory becomes accessible; |
@@ -263,33 +266,33 @@ AUTHORIZED_KEYS FILE FORMAT | |||
263 | ~/.ssh/authorized_keys. Each line of the file contains one key (empty | 266 | ~/.ssh/authorized_keys. Each line of the file contains one key (empty |
264 | lines and lines starting with a `#' are ignored as comments). Protocol 1 | 267 | lines and lines starting with a `#' are ignored as comments). Protocol 1 |
265 | public keys consist of the following space-separated fields: options, | 268 | public keys consist of the following space-separated fields: options, |
266 | bits, exponent, modulus, comment. Protocol 2 public key consist of: op- | 269 | bits, exponent, modulus, comment. Protocol 2 public key consist of: |
267 | tions, keytype, base64-encoded key, comment. The options field is op- | 270 | options, keytype, base64-encoded key, comment. The options field is |
268 | tional; its presence is determined by whether the line starts with a num- | 271 | optional; its presence is determined by whether the line starts with a |
269 | ber or not (the options field never starts with a number). The bits, ex- | 272 | number or not (the options field never starts with a number). The bits, |
270 | ponent, modulus, and comment fields give the RSA key for protocol version | 273 | exponent, modulus, and comment fields give the RSA key for protocol |
271 | 1; the comment field is not used for anything (but may be convenient for | 274 | version 1; the comment field is not used for anything (but may be |
272 | the user to identify the key). For protocol version 2 the keytype is | 275 | convenient for the user to identify the key). For protocol version 2 the |
273 | ``ssh-dss'' or ``ssh-rsa''. | 276 | keytype is ``ssh-dss'' or ``ssh-rsa''. |
274 | 277 | ||
275 | Note that lines in this file are usually several hundred bytes long (be- | 278 | Note that lines in this file are usually several hundred bytes long |
276 | cause of the size of the public key encoding) up to a limit of 8 kilo- | 279 | (because of the size of the public key encoding) up to a limit of 8 |
277 | bytes, which permits DSA keys up to 8 kilobits and RSA keys up to 16 | 280 | kilobytes, which permits DSA keys up to 8 kilobits and RSA keys up to 16 |
278 | kilobits. You don't want to type them in; instead, copy the | 281 | kilobits. You don't want to type them in; instead, copy the |
279 | identity.pub, id_dsa.pub, or the id_rsa.pub file and edit it. | 282 | identity.pub, id_dsa.pub, or the id_rsa.pub file and edit it. |
280 | 283 | ||
281 | sshd enforces a minimum RSA key modulus size for protocol 1 and protocol | 284 | sshd enforces a minimum RSA key modulus size for protocol 1 and protocol |
282 | 2 keys of 768 bits. | 285 | 2 keys of 768 bits. |
283 | 286 | ||
284 | The options (if present) consist of comma-separated option specifica- | 287 | The options (if present) consist of comma-separated option |
285 | tions. No spaces are permitted, except within double quotes. The fol- | 288 | specifications. No spaces are permitted, except within double quotes. |
286 | lowing option specifications are supported (note that option keywords are | 289 | The following option specifications are supported (note that option |
287 | case-insensitive): | 290 | keywords are case-insensitive): |
288 | 291 | ||
289 | cert-authority | 292 | cert-authority |
290 | Specifies that the listed key is a certification authority (CA) | 293 | Specifies that the listed key is a certification authority (CA) |
291 | that is trusted to validate signed certificates for user authen- | 294 | that is trusted to validate signed certificates for user |
292 | tication. | 295 | authentication. |
293 | 296 | ||
294 | Certificates may encode access restrictions similar to these key | 297 | Certificates may encode access restrictions similar to these key |
295 | options. If both certificate restrictions and key options are | 298 | options. If both certificate restrictions and key options are |
@@ -299,19 +302,19 @@ AUTHORIZED_KEYS FILE FORMAT | |||
299 | Specifies that the command is executed whenever this key is used | 302 | Specifies that the command is executed whenever this key is used |
300 | for authentication. The command supplied by the user (if any) is | 303 | for authentication. The command supplied by the user (if any) is |
301 | ignored. The command is run on a pty if the client requests a | 304 | ignored. The command is run on a pty if the client requests a |
302 | pty; otherwise it is run without a tty. If an 8-bit clean chan- | 305 | pty; otherwise it is run without a tty. If an 8-bit clean |
303 | nel is required, one must not request a pty or should specify no- | 306 | channel is required, one must not request a pty or should specify |
304 | pty. A quote may be included in the command by quoting it with a | 307 | no-pty. A quote may be included in the command by quoting it |
305 | backslash. This option might be useful to restrict certain pub- | 308 | with a backslash. This option might be useful to restrict |
306 | lic keys to perform just a specific operation. An example might | 309 | certain public keys to perform just a specific operation. An |
307 | be a key that permits remote backups but nothing else. Note that | 310 | example might be a key that permits remote backups but nothing |
308 | the client may specify TCP and/or X11 forwarding unless they are | 311 | else. Note that the client may specify TCP and/or X11 forwarding |
309 | explicitly prohibited. The command originally supplied by the | 312 | unless they are explicitly prohibited. The command originally |
310 | client is available in the SSH_ORIGINAL_COMMAND environment vari- | 313 | supplied by the client is available in the SSH_ORIGINAL_COMMAND |
311 | able. Note that this option applies to shell, command or subsys- | 314 | environment variable. Note that this option applies to shell, |
312 | tem execution. Also note that this command may be superseded by | 315 | command or subsystem execution. Also note that this command may |
313 | either a sshd_config(5) ForceCommand directive or a command em- | 316 | be superseded by either a sshd_config(5) ForceCommand directive |
314 | bedded in a certificate. | 317 | or a command embedded in a certificate. |
315 | 318 | ||
316 | environment="NAME=value" | 319 | environment="NAME=value" |
317 | Specifies that the string is to be added to the environment when | 320 | Specifies that the string is to be added to the environment when |
@@ -327,9 +330,9 @@ AUTHORIZED_KEYS FILE FORMAT | |||
327 | present in the comma-separated list of patterns. See PATTERNS in | 330 | present in the comma-separated list of patterns. See PATTERNS in |
328 | ssh_config(5) for more information on patterns. | 331 | ssh_config(5) for more information on patterns. |
329 | 332 | ||
330 | In addition to the wildcard matching that may be applied to host- | 333 | In addition to the wildcard matching that may be applied to |
331 | names or addresses, a from stanza may match IP addresses using | 334 | hostnames or addresses, a from stanza may match IP addresses |
332 | CIDR address/masklen notation. | 335 | using CIDR address/masklen notation. |
333 | 336 | ||
334 | The purpose of this option is to optionally increase security: | 337 | The purpose of this option is to optionally increase security: |
335 | public key authentication by itself does not trust the network or | 338 | public key authentication by itself does not trust the network or |
@@ -358,17 +361,25 @@ AUTHORIZED_KEYS FILE FORMAT | |||
358 | Any X11 forward requests by the client will return an error. | 361 | Any X11 forward requests by the client will return an error. |
359 | 362 | ||
360 | permitopen="host:port" | 363 | permitopen="host:port" |
361 | Limit local ``ssh -L'' port forwarding such that it may only con- | 364 | Limit local ``ssh -L'' port forwarding such that it may only |
362 | nect to the specified host and port. IPv6 addresses can be spec- | 365 | connect to the specified host and port. IPv6 addresses can be |
363 | ified with an alternative syntax: host/port. Multiple permitopen | 366 | specified by enclosing the address in square brackets. Multiple |
364 | options may be applied separated by commas. No pattern matching | 367 | permitopen options may be applied separated by commas. No |
365 | is performed on the specified hostnames, they must be literal do- | 368 | pattern matching is performed on the specified hostnames, they |
366 | mains or addresses. | 369 | must be literal domains or addresses. |
370 | |||
371 | principals="principals" | ||
372 | On a cert-authority line, specifies allowed principals for | ||
373 | certificate authentication as a comma-separated list. At least | ||
374 | one name from the list must appear in the certificate's list of | ||
375 | principals for the certificate to be accepted. This option is | ||
376 | ignored for keys that are not marked as trusted certificate | ||
377 | signers using the cert-authority option. | ||
367 | 378 | ||
368 | tunnel="n" | 379 | tunnel="n" |
369 | Force a tun(4) device on the server. Without this option, the | 380 | Force a tun(4) device on the server. Without this option, the |
370 | next available device will be used if the client requests a tun- | 381 | next available device will be used if the client requests a |
371 | nel. | 382 | tunnel. |
372 | 383 | ||
373 | An example authorized_keys file: | 384 | An example authorized_keys file: |
374 | 385 | ||
@@ -386,13 +397,13 @@ AUTHORIZED_KEYS FILE FORMAT | |||
386 | SSH_KNOWN_HOSTS FILE FORMAT | 397 | SSH_KNOWN_HOSTS FILE FORMAT |
387 | The /etc/ssh/ssh_known_hosts and ~/.ssh/known_hosts files contain host | 398 | The /etc/ssh/ssh_known_hosts and ~/.ssh/known_hosts files contain host |
388 | public keys for all known hosts. The global file should be prepared by | 399 | public keys for all known hosts. The global file should be prepared by |
389 | the administrator (optional), and the per-user file is maintained auto- | 400 | the administrator (optional), and the per-user file is maintained |
390 | matically: whenever the user connects from an unknown host, its key is | 401 | automatically: whenever the user connects from an unknown host, its key |
391 | added to the per-user file. | 402 | is added to the per-user file. |
392 | 403 | ||
393 | Each line in these files contains the following fields: markers (option- | 404 | Each line in these files contains the following fields: markers |
394 | al), hostnames, bits, exponent, modulus, comment. The fields are sepa- | 405 | (optional), hostnames, bits, exponent, modulus, comment. The fields are |
395 | rated by spaces. | 406 | separated by spaces. |
396 | 407 | ||
397 | The marker is optional, but if it is present then it must be one of | 408 | The marker is optional, but if it is present then it must be one of |
398 | ``@cert-authority'', to indicate that the line contains a certification | 409 | ``@cert-authority'', to indicate that the line contains a certification |
@@ -400,20 +411,20 @@ SSH_KNOWN_HOSTS FILE FORMAT | |||
400 | on the line is revoked and must not ever be accepted. Only one marker | 411 | on the line is revoked and must not ever be accepted. Only one marker |
401 | should be used on a key line. | 412 | should be used on a key line. |
402 | 413 | ||
403 | Hostnames is a comma-separated list of patterns (`*' and `?' act as wild- | 414 | Hostnames is a comma-separated list of patterns (`*' and `?' act as |
404 | cards); each pattern in turn is matched against the canonical host name | 415 | wildcards); each pattern in turn is matched against the canonical host |
405 | (when authenticating a client) or against the user-supplied name (when | 416 | name (when authenticating a client) or against the user-supplied name |
406 | authenticating a server). A pattern may also be preceded by `!' to indi- | 417 | (when authenticating a server). A pattern may also be preceded by `!' to |
407 | cate negation: if the host name matches a negated pattern, it is not ac- | 418 | indicate negation: if the host name matches a negated pattern, it is not |
408 | cepted (by that line) even if it matched another pattern on the line. A | 419 | accepted (by that line) even if it matched another pattern on the line. |
409 | hostname or address may optionally be enclosed within `[' and `]' brack- | 420 | A hostname or address may optionally be enclosed within `[' and `]' |
410 | ets then followed by `:' and a non-standard port number. | 421 | brackets then followed by `:' and a non-standard port number. |
411 | 422 | ||
412 | Alternately, hostnames may be stored in a hashed form which hides host | 423 | Alternately, hostnames may be stored in a hashed form which hides host |
413 | names and addresses should the file's contents be disclosed. Hashed | 424 | names and addresses should the file's contents be disclosed. Hashed |
414 | hostnames start with a `|' character. Only one hashed hostname may ap- | 425 | hostnames start with a `|' character. Only one hashed hostname may |
415 | pear on a single line and none of the above negation or wildcard opera- | 426 | appear on a single line and none of the above negation or wildcard |
416 | tors may be applied. | 427 | operators may be applied. |
417 | 428 | ||
418 | Bits, exponent, and modulus are taken directly from the RSA host key; | 429 | Bits, exponent, and modulus are taken directly from the RSA host key; |
419 | they can be obtained, for example, from /etc/ssh/ssh_host_key.pub. The | 430 | they can be obtained, for example, from /etc/ssh/ssh_host_key.pub. The |
@@ -431,23 +442,24 @@ SSH_KNOWN_HOSTS FILE FORMAT | |||
431 | The known hosts file also provides a facility to mark keys as revoked, | 442 | The known hosts file also provides a facility to mark keys as revoked, |
432 | for example when it is known that the associated private key has been | 443 | for example when it is known that the associated private key has been |
433 | stolen. Revoked keys are specified by including the ``@revoked'' marker | 444 | stolen. Revoked keys are specified by including the ``@revoked'' marker |
434 | at the beginning of the key line, and are never accepted for authentica- | 445 | at the beginning of the key line, and are never accepted for |
435 | tion or as certification authorities, but instead will produce a warning | 446 | authentication or as certification authorities, but instead will produce |
436 | from ssh(1) when they are encountered. | 447 | a warning from ssh(1) when they are encountered. |
437 | 448 | ||
438 | It is permissible (but not recommended) to have several lines or differ- | 449 | It is permissible (but not recommended) to have several lines or |
439 | ent host keys for the same names. This will inevitably happen when short | 450 | different host keys for the same names. This will inevitably happen when |
440 | forms of host names from different domains are put in the file. It is | 451 | short forms of host names from different domains are put in the file. It |
441 | possible that the files contain conflicting information; authentication | 452 | is possible that the files contain conflicting information; |
442 | is accepted if valid information can be found from either file. | 453 | authentication is accepted if valid information can be found from either |
454 | file. | ||
443 | 455 | ||
444 | Note that the lines in these files are typically hundreds of characters | 456 | Note that the lines in these files are typically hundreds of characters |
445 | long, and you definitely don't want to type in the host keys by hand. | 457 | long, and you definitely don't want to type in the host keys by hand. |
446 | Rather, generate them by a script, ssh-keyscan(1) or by taking | 458 | Rather, generate them by a script, ssh-keyscan(1) or by taking |
447 | /etc/ssh/ssh_host_key.pub and adding the host names at the front. | 459 | /etc/ssh/ssh_host_key.pub and adding the host names at the front. |
448 | ssh-keygen(1) also offers some basic automated editing for | 460 | ssh-keygen(1) also offers some basic automated editing for |
449 | ~/.ssh/known_hosts including removing hosts matching a host name and con- | 461 | ~/.ssh/known_hosts including removing hosts matching a host name and |
450 | verting all host names to their hashed representations. | 462 | converting all host names to their hashed representations. |
451 | 463 | ||
452 | An example ssh_known_hosts file: | 464 | An example ssh_known_hosts file: |
453 | 465 | ||
@@ -465,18 +477,19 @@ SSH_KNOWN_HOSTS FILE FORMAT | |||
465 | FILES | 477 | FILES |
466 | ~/.hushlogin | 478 | ~/.hushlogin |
467 | This file is used to suppress printing the last login time and | 479 | This file is used to suppress printing the last login time and |
468 | /etc/motd, if PrintLastLog and PrintMotd, respectively, are en- | 480 | /etc/motd, if PrintLastLog and PrintMotd, respectively, are |
469 | abled. It does not suppress printing of the banner specified by | 481 | enabled. It does not suppress printing of the banner specified |
470 | Banner. | 482 | by Banner. |
471 | 483 | ||
472 | ~/.rhosts | 484 | ~/.rhosts |
473 | This file is used for host-based authentication (see ssh(1) for | 485 | This file is used for host-based authentication (see ssh(1) for |
474 | more information). On some machines this file may need to be | 486 | more information). On some machines this file may need to be |
475 | world-readable if the user's home directory is on an NFS parti- | 487 | world-readable if the user's home directory is on an NFS |
476 | tion, because sshd reads it as root. Additionally, this file | 488 | partition, because sshd reads it as root. Additionally, this |
477 | must be owned by the user, and must not have write permissions | 489 | file must be owned by the user, and must not have write |
478 | for anyone else. The recommended permission for most machines is | 490 | permissions for anyone else. The recommended permission for most |
479 | read/write for the user, and not accessible by others. | 491 | machines is read/write for the user, and not accessible by |
492 | others. | ||
480 | 493 | ||
481 | ~/.shosts | 494 | ~/.shosts |
482 | This file is used in exactly the same way as .rhosts, but allows | 495 | This file is used in exactly the same way as .rhosts, but allows |
@@ -484,11 +497,11 @@ FILES | |||
484 | rlogin/rsh. | 497 | rlogin/rsh. |
485 | 498 | ||
486 | ~/.ssh/ | 499 | ~/.ssh/ |
487 | This directory is the default location for all user-specific con- | 500 | This directory is the default location for all user-specific |
488 | figuration and authentication information. There is no general | 501 | configuration and authentication information. There is no |
489 | requirement to keep the entire contents of this directory secret, | 502 | general requirement to keep the entire contents of this directory |
490 | but the recommended permissions are read/write/execute for the | 503 | secret, but the recommended permissions are read/write/execute |
491 | user, and not accessible by others. | 504 | for the user, and not accessible by others. |
492 | 505 | ||
493 | ~/.ssh/authorized_keys | 506 | ~/.ssh/authorized_keys |
494 | Lists the public keys (RSA/DSA) that can be used for logging in | 507 | Lists the public keys (RSA/DSA) that can be used for logging in |
@@ -499,8 +512,8 @@ FILES | |||
499 | 512 | ||
500 | If this file, the ~/.ssh directory, or the user's home directory | 513 | If this file, the ~/.ssh directory, or the user's home directory |
501 | are writable by other users, then the file could be modified or | 514 | are writable by other users, then the file could be modified or |
502 | replaced by unauthorized users. In this case, sshd will not al- | 515 | replaced by unauthorized users. In this case, sshd will not |
503 | low it to be used unless the StrictModes option has been set to | 516 | allow it to be used unless the StrictModes option has been set to |
504 | ``no''. | 517 | ``no''. |
505 | 518 | ||
506 | ~/.ssh/environment | 519 | ~/.ssh/environment |
@@ -525,8 +538,8 @@ FILES | |||
525 | 538 | ||
526 | /etc/hosts.allow | 539 | /etc/hosts.allow |
527 | /etc/hosts.deny | 540 | /etc/hosts.deny |
528 | Access controls that should be enforced by tcp-wrappers are de- | 541 | Access controls that should be enforced by tcp-wrappers are |
529 | fined here. Further details are described in hosts_access(5). | 542 | defined here. Further details are described in hosts_access(5). |
530 | 543 | ||
531 | /etc/hosts.equiv | 544 | /etc/hosts.equiv |
532 | This file is for host-based authentication (see ssh(1)). It | 545 | This file is for host-based authentication (see ssh(1)). It |
@@ -546,8 +559,8 @@ FILES | |||
546 | world-readable. | 559 | world-readable. |
547 | 560 | ||
548 | /etc/shosts.equiv | 561 | /etc/shosts.equiv |
549 | This file is used in exactly the same way as hosts.equiv, but al- | 562 | This file is used in exactly the same way as hosts.equiv, but |
550 | lows host-based authentication without permitting login with | 563 | allows host-based authentication without permitting login with |
551 | rlogin/rsh. | 564 | rlogin/rsh. |
552 | 565 | ||
553 | /etc/ssh/ssh_host_key | 566 | /etc/ssh/ssh_host_key |
@@ -571,13 +584,13 @@ FILES | |||
571 | /etc/ssh/ssh_known_hosts | 584 | /etc/ssh/ssh_known_hosts |
572 | Systemwide list of known host keys. This file should be prepared | 585 | Systemwide list of known host keys. This file should be prepared |
573 | by the system administrator to contain the public host keys of | 586 | by the system administrator to contain the public host keys of |
574 | all machines in the organization. The format of this file is de- | 587 | all machines in the organization. The format of this file is |
575 | scribed above. This file should be writable only by root/the | 588 | described above. This file should be writable only by root/the |
576 | owner and should be world-readable. | 589 | owner and should be world-readable. |
577 | 590 | ||
578 | /etc/ssh/sshd_config | 591 | /etc/ssh/sshd_config |
579 | Contains configuration data for sshd. The file format and con- | 592 | Contains configuration data for sshd. The file format and |
580 | figuration options are described in sshd_config(5). | 593 | configuration options are described in sshd_config(5). |
581 | 594 | ||
582 | /etc/ssh/sshrc | 595 | /etc/ssh/sshrc |
583 | Similar to ~/.ssh/rc, it can be used to specify machine-specific | 596 | Similar to ~/.ssh/rc, it can be used to specify machine-specific |
@@ -594,8 +607,8 @@ FILES | |||
594 | Contains the process ID of the sshd listening for connections (if | 607 | Contains the process ID of the sshd listening for connections (if |
595 | there are several daemons running concurrently for different | 608 | there are several daemons running concurrently for different |
596 | ports, this contains the process ID of the one started last). | 609 | ports, this contains the process ID of the one started last). |
597 | The content of this file is not sensitive; it can be world-read- | 610 | The content of this file is not sensitive; it can be world- |
598 | able. | 611 | readable. |
599 | 612 | ||
600 | SEE ALSO | 613 | SEE ALSO |
601 | scp(1), sftp(1), ssh(1), ssh-add(1), ssh-agent(1), ssh-keygen(1), | 614 | scp(1), sftp(1), ssh(1), ssh-add(1), ssh-agent(1), ssh-keygen(1), |
@@ -605,13 +618,13 @@ SEE ALSO | |||
605 | AUTHORS | 618 | AUTHORS |
606 | OpenSSH is a derivative of the original and free ssh 1.2.12 release by | 619 | OpenSSH is a derivative of the original and free ssh 1.2.12 release by |
607 | Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo | 620 | Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo |
608 | de Raadt and Dug Song removed many bugs, re-added newer features and cre- | 621 | de Raadt and Dug Song removed many bugs, re-added newer features and |
609 | ated OpenSSH. Markus Friedl contributed the support for SSH protocol | 622 | created OpenSSH. Markus Friedl contributed the support for SSH protocol |
610 | versions 1.5 and 2.0. Niels Provos and Markus Friedl contributed support | 623 | versions 1.5 and 2.0. Niels Provos and Markus Friedl contributed support |
611 | for privilege separation. | 624 | for privilege separation. |
612 | 625 | ||
613 | CAVEATS | 626 | CAVEATS |
614 | System security is not improved unless rshd, rlogind, and rexecd are dis- | 627 | System security is not improved unless rshd, rlogind, and rexecd are |
615 | abled (thus completely disabling rlogin and rsh into the machine). | 628 | disabled (thus completely disabling rlogin and rsh into the machine). |
616 | 629 | ||
617 | OpenBSD 4.7 March 5, 2010 10 | 630 | OpenBSD 4.8 August 4, 2010 OpenBSD 4.8 |