Annotation of src/usr.bin/ssh/sshd_config.5, Revision 1.252
1.1 stevesk 1: .\"
2: .\" Author: Tatu Ylonen <ylo@cs.hut.fi>
3: .\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4: .\" All rights reserved
5: .\"
6: .\" As far as I am concerned, the code I have written for this software
7: .\" can be used freely for any purpose. Any derived versions of this
8: .\" software must be clearly marked as such, and if the derived work is
9: .\" incompatible with the protocol description in the RFC file, it must be
10: .\" called by a name other than "ssh" or "Secure Shell".
11: .\"
12: .\" Copyright (c) 1999,2000 Markus Friedl. All rights reserved.
13: .\" Copyright (c) 1999 Aaron Campbell. All rights reserved.
14: .\" Copyright (c) 1999 Theo de Raadt. All rights reserved.
15: .\"
16: .\" Redistribution and use in source and binary forms, with or without
17: .\" modification, are permitted provided that the following conditions
18: .\" are met:
19: .\" 1. Redistributions of source code must retain the above copyright
20: .\" notice, this list of conditions and the following disclaimer.
21: .\" 2. Redistributions in binary form must reproduce the above copyright
22: .\" notice, this list of conditions and the following disclaimer in the
23: .\" documentation and/or other materials provided with the distribution.
24: .\"
25: .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
26: .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27: .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28: .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
29: .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30: .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31: .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32: .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33: .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34: .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35: .\"
1.252 ! jmc 36: .\" $OpenBSD: sshd_config.5,v 1.251 2017/09/01 05:50:48 djm Exp $
! 37: .Dd $Mdocdate: September 1 2017 $
1.1 stevesk 38: .Dt SSHD_CONFIG 5
39: .Os
40: .Sh NAME
41: .Nm sshd_config
42: .Nd OpenSSH SSH daemon configuration file
43: .Sh DESCRIPTION
1.53 jmc 44: .Xr sshd 8
1.1 stevesk 45: reads configuration data from
46: .Pa /etc/ssh/sshd_config
47: (or the file specified with
48: .Fl f
49: on the command line).
50: The file contains keyword-argument pairs, one per line.
51: Lines starting with
52: .Ql #
53: and empty lines are interpreted as comments.
1.56 dtucker 54: Arguments may optionally be enclosed in double quotes
55: .Pq \&"
56: in order to represent arguments containing spaces.
1.1 stevesk 57: .Pp
58: The possible
59: keywords and their meanings are as follows (note that
60: keywords are case-insensitive and arguments are case-sensitive):
61: .Bl -tag -width Ds
1.30 djm 62: .It Cm AcceptEnv
63: Specifies what environment variables sent by the client will be copied into
64: the session's
65: .Xr environ 7 .
66: See
67: .Cm SendEnv
68: in
69: .Xr ssh_config 5
70: for how to configure the client.
1.219 jmc 71: The
1.197 dtucker 72: .Ev TERM
1.199 jmc 73: environment variable is always sent whenever the client
1.204 djm 74: requests a pseudo-terminal as it is required by the protocol.
1.30 djm 75: Variables are specified by name, which may contain the wildcard characters
1.51 jmc 76: .Ql *
1.30 djm 77: and
78: .Ql \&? .
1.31 djm 79: Multiple environment variables may be separated by whitespace or spread
1.30 djm 80: across multiple
81: .Cm AcceptEnv
82: directives.
1.31 djm 83: Be warned that some environment variables could be used to bypass restricted
1.30 djm 84: user environments.
85: For this reason, care should be taken in the use of this directive.
86: The default is not to accept any environment variables.
1.37 djm 87: .It Cm AddressFamily
88: Specifies which address family should be used by
1.53 jmc 89: .Xr sshd 8 .
1.37 djm 90: Valid arguments are
1.237 jmc 91: .Cm any
92: (the default),
93: .Cm inet
1.52 jmc 94: (use IPv4 only), or
1.237 jmc 95: .Cm inet6
1.37 djm 96: (use IPv6 only).
1.89 jmc 97: .It Cm AllowAgentForwarding
98: Specifies whether
99: .Xr ssh-agent 1
100: forwarding is permitted.
101: The default is
1.237 jmc 102: .Cm yes .
1.89 jmc 103: Note that disabling agent forwarding does not improve security
104: unless users are also denied shell access, as they can always install
105: their own forwarders.
1.1 stevesk 106: .It Cm AllowGroups
107: This keyword can be followed by a list of group name patterns, separated
108: by spaces.
109: If specified, login is allowed only for users whose primary
110: group or supplementary group list matches one of the patterns.
111: Only group names are valid; a numerical group ID is not recognized.
112: By default, login is allowed for all groups.
1.54 jmc 113: The allow/deny directives are processed in the following order:
114: .Cm DenyUsers ,
115: .Cm AllowUsers ,
116: .Cm DenyGroups ,
117: and finally
118: .Cm AllowGroups .
1.49 jmc 119: .Pp
1.161 jmc 120: See PATTERNS in
1.49 jmc 121: .Xr ssh_config 5
122: for more information on patterns.
1.231 jmc 123: .It Cm AllowStreamLocalForwarding
124: Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted.
1.150 djm 125: The available options are
1.237 jmc 126: .Cm yes
127: (the default)
1.150 djm 128: or
1.237 jmc 129: .Cm all
1.231 jmc 130: to allow StreamLocal forwarding,
1.237 jmc 131: .Cm no
1.231 jmc 132: to prevent all StreamLocal forwarding,
1.237 jmc 133: .Cm local
1.150 djm 134: to allow local (from the perspective of
1.151 jmc 135: .Xr ssh 1 )
136: forwarding only or
1.237 jmc 137: .Cm remote
1.150 djm 138: to allow remote forwarding only.
1.231 jmc 139: Note that disabling StreamLocal forwarding does not improve security unless
1.1 stevesk 140: users are also denied shell access, as they can always install their
141: own forwarders.
1.231 jmc 142: .It Cm AllowTcpForwarding
143: Specifies whether TCP forwarding is permitted.
1.175 millert 144: The available options are
1.237 jmc 145: .Cm yes
146: (the default)
1.175 millert 147: or
1.237 jmc 148: .Cm all
1.231 jmc 149: to allow TCP forwarding,
1.237 jmc 150: .Cm no
1.231 jmc 151: to prevent all TCP forwarding,
1.237 jmc 152: .Cm local
1.175 millert 153: to allow local (from the perspective of
154: .Xr ssh 1 )
155: forwarding only or
1.237 jmc 156: .Cm remote
1.175 millert 157: to allow remote forwarding only.
1.231 jmc 158: Note that disabling TCP forwarding does not improve security unless
1.175 millert 159: users are also denied shell access, as they can always install their
160: own forwarders.
1.1 stevesk 161: .It Cm AllowUsers
162: This keyword can be followed by a list of user name patterns, separated
163: by spaces.
1.14 jmc 164: If specified, login is allowed only for user names that
1.1 stevesk 165: match one of the patterns.
166: Only user names are valid; a numerical user ID is not recognized.
167: By default, login is allowed for all users.
168: If the pattern takes the form USER@HOST then USER and HOST
169: are separately checked, restricting logins to particular
170: users from particular hosts.
1.222 jmc 171: HOST criteria may additionally contain addresses to match in CIDR
172: address/masklen format.
1.54 jmc 173: The allow/deny directives are processed in the following order:
174: .Cm DenyUsers ,
175: .Cm AllowUsers ,
176: .Cm DenyGroups ,
177: and finally
178: .Cm AllowGroups .
1.49 jmc 179: .Pp
1.161 jmc 180: See PATTERNS in
1.49 jmc 181: .Xr ssh_config 5
182: for more information on patterns.
1.149 djm 183: .It Cm AuthenticationMethods
184: Specifies the authentication methods that must be successfully completed
185: for a user to be granted access.
186: This option must be followed by one or more comma-separated lists of
1.224 djm 187: authentication method names, or by the single string
1.237 jmc 188: .Cm any
1.224 djm 189: to indicate the default behaviour of accepting any single authentication
1.225 jmc 190: method.
1.237 jmc 191: If the default is overridden, then successful authentication requires
1.224 djm 192: completion of every method in at least one of these lists.
1.149 djm 193: .Pp
1.237 jmc 194: For example,
195: .Qq publickey,password publickey,keyboard-interactive
1.149 djm 196: would require the user to complete public key authentication, followed by
197: either password or keyboard interactive authentication.
198: Only methods that are next in one or more lists are offered at each stage,
1.237 jmc 199: so for this example it would not be possible to attempt password or
1.149 djm 200: keyboard-interactive authentication before public key.
1.157 markus 201: .Pp
202: For keyboard interactive authentication it is also possible to
203: restrict authentication to a specific device by appending a
204: colon followed by the device identifier
1.237 jmc 205: .Cm bsdauth ,
206: .Cm pam ,
1.157 markus 207: or
1.237 jmc 208: .Cm skey ,
1.157 markus 209: depending on the server configuration.
210: For example,
1.237 jmc 211: .Qq keyboard-interactive:bsdauth
1.157 markus 212: would restrict keyboard interactive authentication to the
1.237 jmc 213: .Cm bsdauth
1.157 markus 214: device.
1.185 djm 215: .Pp
1.237 jmc 216: If the publickey method is listed more than once,
1.185 djm 217: .Xr sshd 8
218: verifies that keys that have been used successfully are not reused for
219: subsequent authentications.
1.237 jmc 220: For example,
221: .Qq publickey,publickey
222: requires successful authentication using two different public keys.
1.181 djm 223: .Pp
1.149 djm 224: Note that each authentication method listed should also be explicitly enabled
225: in the configuration.
1.251 djm 226: .Pp
227: The available authentication methods are:
228: .Qq gssapi-with-mic ,
229: .Qq hostbased ,
230: .Qq keyboard-interactive ,
231: .Qq none
232: (used for access to password-less accounts when
233: .Cm PermitEmptyPassword
234: is enabled),
235: .Qq password
236: and
237: .Qq publickey .
1.146 djm 238: .It Cm AuthorizedKeysCommand
1.147 jmc 239: Specifies a program to be used to look up the user's public keys.
1.201 djm 240: The program must be owned by root, not writable by group or others and
241: specified by an absolute path.
242: Arguments to
243: .Cm AuthorizedKeysCommand
1.235 jmc 244: accept the tokens described in the
245: .Sx TOKENS
246: section.
247: If no arguments are specified then the username of the target user is used.
1.201 djm 248: .Pp
249: The program should produce on standard output zero or
1.235 jmc 250: more lines of authorized_keys output (see
251: .Sx AUTHORIZED_KEYS
252: in
1.147 jmc 253: .Xr sshd 8 ) .
1.235 jmc 254: If a key supplied by
255: .Cm AuthorizedKeysCommand
256: does not successfully authenticate
1.146 djm 257: and authorize the user then public key authentication continues using the usual
258: .Cm AuthorizedKeysFile
259: files.
1.237 jmc 260: By default, no
261: .Cm AuthorizedKeysCommand
262: is run.
1.146 djm 263: .It Cm AuthorizedKeysCommandUser
1.237 jmc 264: Specifies the user under whose account the
265: .Cm AuthorizedKeysCommand
266: is run.
1.146 djm 267: It is recommended to use a dedicated user that has no other role on the host
268: than running authorized keys commands.
1.186 djm 269: If
1.181 djm 270: .Cm AuthorizedKeysCommand
1.186 djm 271: is specified but
272: .Cm AuthorizedKeysCommandUser
273: is not, then
274: .Xr sshd 8
275: will refuse to start.
1.1 stevesk 276: .It Cm AuthorizedKeysFile
1.235 jmc 277: Specifies the file that contains the public keys used for user authentication.
1.124 djm 278: The format is described in the
1.235 jmc 279: .Sx AUTHORIZED_KEYS FILE FORMAT
1.124 djm 280: section of
281: .Xr sshd 8 .
1.235 jmc 282: Arguments to
1.1 stevesk 283: .Cm AuthorizedKeysFile
1.235 jmc 284: accept the tokens described in the
285: .Sx TOKENS
286: section.
1.1 stevesk 287: After expansion,
288: .Cm AuthorizedKeysFile
289: is taken to be an absolute path or one relative to the user's home
290: directory.
1.133 jmc 291: Multiple files may be listed, separated by whitespace.
1.212 djm 292: Alternately this option may be set to
1.237 jmc 293: .Cm none
1.212 djm 294: to skip checking for user keys in files.
1.133 jmc 295: The default is
1.237 jmc 296: .Qq .ssh/authorized_keys .ssh/authorized_keys2 .
1.202 djm 297: .It Cm AuthorizedPrincipalsCommand
298: Specifies a program to be used to generate the list of allowed
299: certificate principals as per
300: .Cm AuthorizedPrincipalsFile .
301: The program must be owned by root, not writable by group or others and
302: specified by an absolute path.
303: Arguments to
304: .Cm AuthorizedPrincipalsCommand
1.235 jmc 305: accept the tokens described in the
306: .Sx TOKENS
307: section.
308: If no arguments are specified then the username of the target user is used.
1.202 djm 309: .Pp
310: The program should produce on standard output zero or
311: more lines of
312: .Cm AuthorizedPrincipalsFile
313: output.
314: If either
315: .Cm AuthorizedPrincipalsCommand
316: or
317: .Cm AuthorizedPrincipalsFile
318: is specified, then certificates offered by the client for authentication
319: must contain a principal that is listed.
1.235 jmc 320: By default, no
321: .Cm AuthorizedPrincipalsCommand
322: is run.
1.202 djm 323: .It Cm AuthorizedPrincipalsCommandUser
1.235 jmc 324: Specifies the user under whose account the
325: .Cm AuthorizedPrincipalsCommand
326: is run.
1.202 djm 327: It is recommended to use a dedicated user that has no other role on the host
328: than running authorized principals commands.
329: If
330: .Cm AuthorizedPrincipalsCommand
331: is specified but
332: .Cm AuthorizedPrincipalsCommandUser
333: is not, then
334: .Xr sshd 8
335: will refuse to start.
1.121 djm 336: .It Cm AuthorizedPrincipalsFile
337: Specifies a file that lists principal names that are accepted for
338: certificate authentication.
339: When using certificates signed by a key listed in
340: .Cm TrustedUserCAKeys ,
341: this file lists names, one of which must appear in the certificate for it
342: to be accepted for authentication.
1.235 jmc 343: Names are listed one per line preceded by key options (as described in
344: .Sx AUTHORIZED_KEYS FILE FORMAT
345: in
1.125 jmc 346: .Xr sshd 8 ) .
1.124 djm 347: Empty lines and comments starting with
1.121 djm 348: .Ql #
349: are ignored.
350: .Pp
1.235 jmc 351: Arguments to
1.121 djm 352: .Cm AuthorizedPrincipalsFile
1.235 jmc 353: accept the tokens described in the
354: .Sx TOKENS
355: section.
1.121 djm 356: After expansion,
357: .Cm AuthorizedPrincipalsFile
1.235 jmc 358: is taken to be an absolute path or one relative to the user's home directory.
1.138 djm 359: The default is
1.237 jmc 360: .Cm none ,
1.138 djm 361: i.e. not to use a principals file \(en in this case, the username
1.121 djm 362: of the user must appear in a certificate's principals list for it to be
363: accepted.
1.235 jmc 364: .Pp
1.121 djm 365: Note that
366: .Cm AuthorizedPrincipalsFile
367: is only used when authentication proceeds using a CA listed in
368: .Cm TrustedUserCAKeys
369: and is not consulted for certification authorities trusted via
370: .Pa ~/.ssh/authorized_keys ,
371: though the
372: .Cm principals=
373: key option offers a similar facility (see
374: .Xr sshd 8
375: for details).
1.1 stevesk 376: .It Cm Banner
377: The contents of the specified file are sent to the remote user before
378: authentication is allowed.
1.78 djm 379: If the argument is
1.237 jmc 380: .Cm none
1.78 djm 381: then no banner is displayed.
1.1 stevesk 382: By default, no banner is displayed.
383: .It Cm ChallengeResponseAuthentication
1.50 jmc 384: Specifies whether challenge-response authentication is allowed.
1.1 stevesk 385: All authentication styles from
386: .Xr login.conf 5
387: are supported.
388: The default is
1.237 jmc 389: .Cm yes .
1.80 djm 390: .It Cm ChrootDirectory
1.113 stevesk 391: Specifies the pathname of a directory to
1.80 djm 392: .Xr chroot 2
393: to after authentication.
1.190 deraadt 394: At session startup
395: .Xr sshd 8
396: checks that all components of the pathname are root-owned directories
397: which are not writable by any other user or group.
1.106 stevesk 398: After the chroot,
399: .Xr sshd 8
400: changes the working directory to the user's home directory.
1.235 jmc 401: Arguments to
402: .Cm ChrootDirectory
403: accept the tokens described in the
404: .Sx TOKENS
405: section.
1.80 djm 406: .Pp
407: The
408: .Cm ChrootDirectory
409: must contain the necessary files and directories to support the
1.103 stevesk 410: user's session.
1.80 djm 411: For an interactive session this requires at least a shell, typically
412: .Xr sh 1 ,
413: and basic
414: .Pa /dev
415: nodes such as
416: .Xr null 4 ,
417: .Xr zero 4 ,
418: .Xr stdin 4 ,
419: .Xr stdout 4 ,
420: .Xr stderr 4 ,
1.180 jmc 421: and
1.80 djm 422: .Xr tty 4
423: devices.
1.237 jmc 424: For file transfer sessions using SFTP
425: no additional configuration of the environment is necessary if the in-process
426: sftp-server is used,
1.176 schwarze 427: though sessions which use logging may require
1.104 stevesk 428: .Pa /dev/log
1.176 schwarze 429: inside the chroot directory on some operating systems (see
1.104 stevesk 430: .Xr sftp-server 8
1.81 jmc 431: for details).
1.190 deraadt 432: .Pp
1.191 jmc 433: For safety, it is very important that the directory hierarchy be
1.190 deraadt 434: prevented from modification by other processes on the system (especially
435: those outside the jail).
436: Misconfiguration can lead to unsafe environments which
437: .Xr sshd 8
438: cannot detect.
1.80 djm 439: .Pp
1.215 djm 440: The default is
1.237 jmc 441: .Cm none ,
1.215 djm 442: indicating not to
1.80 djm 443: .Xr chroot 2 .
1.1 stevesk 444: .It Cm Ciphers
1.219 jmc 445: Specifies the ciphers allowed.
1.1 stevesk 446: Multiple ciphers must be comma-separated.
1.208 djm 447: If the specified value begins with a
448: .Sq +
449: character, then the specified ciphers will be appended to the default set
450: instead of replacing them.
1.242 djm 451: If the specified value begins with a
452: .Sq -
453: character, then the specified ciphers (including wildcards) will be removed
454: from the default set instead of replacing them.
1.208 djm 455: .Pp
1.167 djm 456: The supported ciphers are:
457: .Pp
1.173 naddy 458: .Bl -item -compact -offset indent
459: .It
460: 3des-cbc
461: .It
462: aes128-cbc
463: .It
464: aes192-cbc
465: .It
466: aes256-cbc
467: .It
468: aes128-ctr
469: .It
470: aes192-ctr
471: .It
472: aes256-ctr
473: .It
474: aes128-gcm@openssh.com
475: .It
476: aes256-gcm@openssh.com
477: .It
478: chacha20-poly1305@openssh.com
479: .El
1.167 djm 480: .Pp
1.52 jmc 481: The default is:
1.173 naddy 482: .Bd -literal -offset indent
1.211 jmc 483: chacha20-poly1305@openssh.com,
1.173 naddy 484: aes128-ctr,aes192-ctr,aes256-ctr,
1.211 jmc 485: aes128-gcm@openssh.com,aes256-gcm@openssh.com
1.1 stevesk 486: .Ed
1.167 djm 487: .Pp
1.237 jmc 488: The list of available ciphers may also be obtained using
489: .Qq ssh -Q cipher .
1.1 stevesk 490: .It Cm ClientAliveCountMax
1.237 jmc 491: Sets the number of client alive messages which may be sent without
1.52 jmc 492: .Xr sshd 8
1.17 jmc 493: receiving any messages back from the client.
494: If this threshold is reached while client alive messages are being sent,
1.52 jmc 495: sshd will disconnect the client, terminating the session.
1.17 jmc 496: It is important to note that the use of client alive messages is very
497: different from
1.237 jmc 498: .Cm TCPKeepAlive .
1.17 jmc 499: The client alive messages are sent through the encrypted channel
500: and therefore will not be spoofable.
501: The TCP keepalive option enabled by
1.27 markus 502: .Cm TCPKeepAlive
1.17 jmc 503: is spoofable.
504: The client alive mechanism is valuable when the client or
1.1 stevesk 505: server depend on knowing when a connection has become inactive.
506: .Pp
1.17 jmc 507: The default value is 3.
508: If
1.1 stevesk 509: .Cm ClientAliveInterval
1.237 jmc 510: is set to 15, and
1.1 stevesk 511: .Cm ClientAliveCountMax
1.52 jmc 512: is left at the default, unresponsive SSH clients
1.1 stevesk 513: will be disconnected after approximately 45 seconds.
1.42 djm 514: .It Cm ClientAliveInterval
515: Sets a timeout interval in seconds after which if no data has been received
516: from the client,
1.52 jmc 517: .Xr sshd 8
1.42 djm 518: will send a message through the encrypted
519: channel to request a response from the client.
520: The default
521: is 0, indicating that these messages will not be sent to the client.
1.3 markus 522: .It Cm Compression
1.236 djm 523: Specifies whether compression is enabled after
1.44 markus 524: the user has authenticated successfully.
1.3 markus 525: The argument must be
1.237 jmc 526: .Cm yes ,
527: .Cm delayed
1.236 djm 528: (a legacy synonym for
1.237 jmc 529: .Cm yes )
1.3 markus 530: or
1.237 jmc 531: .Cm no .
1.3 markus 532: The default is
1.237 jmc 533: .Cm yes .
1.1 stevesk 534: .It Cm DenyGroups
535: This keyword can be followed by a list of group name patterns, separated
536: by spaces.
537: Login is disallowed for users whose primary group or supplementary
538: group list matches one of the patterns.
539: Only group names are valid; a numerical group ID is not recognized.
540: By default, login is allowed for all groups.
1.54 jmc 541: The allow/deny directives are processed in the following order:
542: .Cm DenyUsers ,
543: .Cm AllowUsers ,
544: .Cm DenyGroups ,
545: and finally
546: .Cm AllowGroups .
1.49 jmc 547: .Pp
1.161 jmc 548: See PATTERNS in
1.49 jmc 549: .Xr ssh_config 5
550: for more information on patterns.
1.1 stevesk 551: .It Cm DenyUsers
552: This keyword can be followed by a list of user name patterns, separated
553: by spaces.
554: Login is disallowed for user names that match one of the patterns.
555: Only user names are valid; a numerical user ID is not recognized.
556: By default, login is allowed for all users.
557: If the pattern takes the form USER@HOST then USER and HOST
558: are separately checked, restricting logins to particular
559: users from particular hosts.
1.222 jmc 560: HOST criteria may additionally contain addresses to match in CIDR
561: address/masklen format.
1.54 jmc 562: The allow/deny directives are processed in the following order:
563: .Cm DenyUsers ,
564: .Cm AllowUsers ,
565: .Cm DenyGroups ,
566: and finally
567: .Cm AllowGroups .
1.49 jmc 568: .Pp
1.161 jmc 569: See PATTERNS in
1.49 jmc 570: .Xr ssh_config 5
571: for more information on patterns.
1.239 djm 572: .It Cm DisableForwarding
573: Disables all forwarding features, including X11,
574: .Xr ssh-agent 1 ,
575: TCP and StreamLocal.
576: This option overrides all other forwarding-related options and may
577: simplify restricted configurations.
1.246 djm 578: .It Cm ExposeAuthInfo
579: Enables writing a file containing a list of authentication methods and
580: public credentials (e.g. keys) used to authenticate the user.
1.247 jmc 581: The location of the file is exposed to the user session through the
1.248 djm 582: .Ev SSH_USER_AUTH
1.247 jmc 583: environment variable.
1.183 djm 584: .It Cm FingerprintHash
585: Specifies the hash algorithm used when logging key fingerprints.
586: Valid options are:
1.237 jmc 587: .Cm md5
1.183 djm 588: and
1.237 jmc 589: .Cm sha256 .
1.183 djm 590: The default is
1.237 jmc 591: .Cm sha256 .
1.67 dtucker 592: .It Cm ForceCommand
593: Forces the execution of the command specified by
594: .Cm ForceCommand ,
1.84 djm 595: ignoring any command supplied by the client and
596: .Pa ~/.ssh/rc
597: if present.
1.67 dtucker 598: The command is invoked by using the user's login shell with the -c option.
599: This applies to shell, command, or subsystem execution.
600: It is most useful inside a
601: .Cm Match
602: block.
603: The command originally supplied by the client is available in the
604: .Ev SSH_ORIGINAL_COMMAND
605: environment variable.
1.82 djm 606: Specifying a command of
1.237 jmc 607: .Cm internal-sftp
608: will force the use of an in-process SFTP server that requires no support
1.82 djm 609: files when used with
610: .Cm ChrootDirectory .
1.215 djm 611: The default is
1.237 jmc 612: .Cm none .
1.1 stevesk 613: .It Cm GatewayPorts
614: Specifies whether remote hosts are allowed to connect to ports
615: forwarded for the client.
616: By default,
1.52 jmc 617: .Xr sshd 8
1.15 jmc 618: binds remote port forwardings to the loopback address.
619: This prevents other remote hosts from connecting to forwarded ports.
1.1 stevesk 620: .Cm GatewayPorts
1.52 jmc 621: can be used to specify that sshd
1.39 djm 622: should allow remote port forwardings to bind to non-loopback addresses, thus
623: allowing other hosts to connect.
624: The argument may be
1.237 jmc 625: .Cm no
1.39 djm 626: to force remote port forwardings to be available to the local host only,
1.237 jmc 627: .Cm yes
1.39 djm 628: to force remote port forwardings to bind to the wildcard address, or
1.237 jmc 629: .Cm clientspecified
1.39 djm 630: to allow the client to select the address to which the forwarding is bound.
1.1 stevesk 631: The default is
1.237 jmc 632: .Cm no .
1.23 markus 633: .It Cm GSSAPIAuthentication
1.25 markus 634: Specifies whether user authentication based on GSSAPI is allowed.
1.26 djm 635: The default is
1.237 jmc 636: .Cm no .
1.23 markus 637: .It Cm GSSAPICleanupCredentials
638: Specifies whether to automatically destroy the user's credentials cache
639: on logout.
640: The default is
1.237 jmc 641: .Cm yes .
1.203 djm 642: .It Cm GSSAPIStrictAcceptorCheck
643: Determines whether to be strict about the identity of the GSSAPI acceptor
644: a client authenticates against.
645: If set to
1.237 jmc 646: .Cm yes
647: then the client must authenticate against the host
1.203 djm 648: service on the current hostname.
649: If set to
1.237 jmc 650: .Cm no
1.203 djm 651: then the client may authenticate against any service key stored in the
652: machine's default store.
653: This facility is provided to assist with operation on multi homed machines.
654: The default is
1.237 jmc 655: .Cm yes .
1.189 djm 656: .It Cm HostbasedAcceptedKeyTypes
657: Specifies the key types that will be accepted for hostbased authentication
658: as a comma-separated pattern list.
1.208 djm 659: Alternately if the specified value begins with a
660: .Sq +
661: character, then the specified key types will be appended to the default set
662: instead of replacing them.
1.242 djm 663: If the specified value begins with a
664: .Sq -
665: character, then the specified key types (including wildcards) will be removed
666: from the default set instead of replacing them.
1.206 markus 667: The default for this option is:
668: .Bd -literal -offset 3n
669: ecdsa-sha2-nistp256-cert-v01@openssh.com,
670: ecdsa-sha2-nistp384-cert-v01@openssh.com,
671: ecdsa-sha2-nistp521-cert-v01@openssh.com,
672: ssh-ed25519-cert-v01@openssh.com,
673: ssh-rsa-cert-v01@openssh.com,
674: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1.220 djm 675: ssh-ed25519,ssh-rsa
1.206 markus 676: .Ed
677: .Pp
1.237 jmc 678: The list of available key types may also be obtained using
679: .Qq ssh -Q key .
1.1 stevesk 680: .It Cm HostbasedAuthentication
681: Specifies whether rhosts or /etc/hosts.equiv authentication together
682: with successful public key client host authentication is allowed
1.50 jmc 683: (host-based authentication).
1.70 dtucker 684: The default is
1.237 jmc 685: .Cm no .
1.70 dtucker 686: .It Cm HostbasedUsesNameFromPacketOnly
687: Specifies whether or not the server will attempt to perform a reverse
688: name lookup when matching the name in the
689: .Pa ~/.shosts ,
690: .Pa ~/.rhosts ,
691: and
692: .Pa /etc/hosts.equiv
693: files during
694: .Cm HostbasedAuthentication .
695: A setting of
1.237 jmc 696: .Cm yes
1.70 dtucker 697: means that
698: .Xr sshd 8
699: uses the name supplied by the client rather than
700: attempting to resolve the name from the TCP connection itself.
1.1 stevesk 701: The default is
1.237 jmc 702: .Cm no .
1.117 djm 703: .It Cm HostCertificate
704: Specifies a file containing a public host certificate.
705: The certificate's public key must match a private host key already specified
706: by
707: .Cm HostKey .
708: The default behaviour of
709: .Xr sshd 8
710: is not to load any certificates.
1.1 stevesk 711: .It Cm HostKey
712: Specifies a file containing a private host key
713: used by SSH.
1.229 naddy 714: The defaults are
1.126 djm 715: .Pa /etc/ssh/ssh_host_dsa_key ,
1.169 naddy 716: .Pa /etc/ssh/ssh_host_ecdsa_key ,
717: .Pa /etc/ssh/ssh_host_ed25519_key
1.126 djm 718: and
1.229 naddy 719: .Pa /etc/ssh/ssh_host_rsa_key .
1.206 markus 720: .Pp
1.1 stevesk 721: Note that
1.52 jmc 722: .Xr sshd 8
1.206 markus 723: will refuse to use a file if it is group/world-accessible
724: and that the
725: .Cm HostKeyAlgorithms
726: option restricts which of the keys are actually used by
727: .Xr sshd 8 .
728: .Pp
1.1 stevesk 729: It is possible to have multiple host key files.
1.162 markus 730: It is also possible to specify public host key files instead.
731: In this case operations on the private key will be delegated
732: to an
733: .Xr ssh-agent 1 .
734: .It Cm HostKeyAgent
735: Identifies the UNIX-domain socket used to communicate
736: with an agent that has access to the private host keys.
1.223 markus 737: If the string
1.237 jmc 738: .Qq SSH_AUTH_SOCK
1.162 markus 739: is specified, the location of the socket will be read from the
740: .Ev SSH_AUTH_SOCK
741: environment variable.
1.206 markus 742: .It Cm HostKeyAlgorithms
1.219 jmc 743: Specifies the host key algorithms
1.206 markus 744: that the server offers.
745: The default for this option is:
746: .Bd -literal -offset 3n
747: ecdsa-sha2-nistp256-cert-v01@openssh.com,
748: ecdsa-sha2-nistp384-cert-v01@openssh.com,
749: ecdsa-sha2-nistp521-cert-v01@openssh.com,
750: ssh-ed25519-cert-v01@openssh.com,
751: ssh-rsa-cert-v01@openssh.com,
752: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1.220 djm 753: ssh-ed25519,ssh-rsa
1.206 markus 754: .Ed
755: .Pp
1.237 jmc 756: The list of available key types may also be obtained using
757: .Qq ssh -Q key .
1.1 stevesk 758: .It Cm IgnoreRhosts
759: Specifies that
760: .Pa .rhosts
761: and
762: .Pa .shosts
763: files will not be used in
764: .Cm HostbasedAuthentication .
765: .Pp
766: .Pa /etc/hosts.equiv
767: and
768: .Pa /etc/shosts.equiv
769: are still used.
770: The default is
1.237 jmc 771: .Cm yes .
1.1 stevesk 772: .It Cm IgnoreUserKnownHosts
773: Specifies whether
1.52 jmc 774: .Xr sshd 8
1.1 stevesk 775: should ignore the user's
1.41 djm 776: .Pa ~/.ssh/known_hosts
1.1 stevesk 777: during
778: .Cm HostbasedAuthentication .
779: The default is
1.237 jmc 780: .Cm no .
1.129 djm 781: .It Cm IPQoS
782: Specifies the IPv4 type-of-service or DSCP class for the connection.
783: Accepted values are
1.237 jmc 784: .Cm af11 ,
785: .Cm af12 ,
786: .Cm af13 ,
787: .Cm af21 ,
788: .Cm af22 ,
789: .Cm af23 ,
790: .Cm af31 ,
791: .Cm af32 ,
792: .Cm af33 ,
793: .Cm af41 ,
794: .Cm af42 ,
795: .Cm af43 ,
796: .Cm cs0 ,
797: .Cm cs1 ,
798: .Cm cs2 ,
799: .Cm cs3 ,
800: .Cm cs4 ,
801: .Cm cs5 ,
802: .Cm cs6 ,
803: .Cm cs7 ,
804: .Cm ef ,
805: .Cm lowdelay ,
806: .Cm throughput ,
807: .Cm reliability ,
1.250 djm 808: a numeric value, or
809: .Cm none
810: to use the operating system default.
1.131 djm 811: This option may take one or two arguments, separated by whitespace.
1.129 djm 812: If one argument is specified, it is used as the packet class unconditionally.
813: If two values are specified, the first is automatically selected for
814: interactive sessions and the second for non-interactive sessions.
815: The default is
1.237 jmc 816: .Cm lowdelay
1.129 djm 817: for interactive sessions and
1.237 jmc 818: .Cm throughput
1.129 djm 819: for non-interactive sessions.
1.171 jmc 820: .It Cm KbdInteractiveAuthentication
821: Specifies whether to allow keyboard-interactive authentication.
822: The argument to this keyword must be
1.237 jmc 823: .Cm yes
1.171 jmc 824: or
1.237 jmc 825: .Cm no .
1.171 jmc 826: The default is to use whatever value
827: .Cm ChallengeResponseAuthentication
828: is set to
829: (by default
1.237 jmc 830: .Cm yes ) .
1.1 stevesk 831: .It Cm KerberosAuthentication
1.24 markus 832: Specifies whether the password provided by the user for
1.1 stevesk 833: .Cm PasswordAuthentication
1.24 markus 834: will be validated through the Kerberos KDC.
1.1 stevesk 835: To use this option, the server needs a
836: Kerberos servtab which allows the verification of the KDC's identity.
1.52 jmc 837: The default is
1.237 jmc 838: .Cm no .
1.29 dtucker 839: .It Cm KerberosGetAFSToken
1.45 djm 840: If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
1.29 dtucker 841: an AFS token before accessing the user's home directory.
1.52 jmc 842: The default is
1.237 jmc 843: .Cm no .
1.1 stevesk 844: .It Cm KerberosOrLocalPasswd
1.52 jmc 845: If password authentication through Kerberos fails then
1.1 stevesk 846: the password will be validated via any additional local mechanism
847: such as
848: .Pa /etc/passwd .
1.52 jmc 849: The default is
1.237 jmc 850: .Cm yes .
1.1 stevesk 851: .It Cm KerberosTicketCleanup
852: Specifies whether to automatically destroy the user's ticket cache
853: file on logout.
1.52 jmc 854: The default is
1.237 jmc 855: .Cm yes .
1.127 djm 856: .It Cm KexAlgorithms
857: Specifies the available KEX (Key Exchange) algorithms.
858: Multiple algorithms must be comma-separated.
1.208 djm 859: Alternately if the specified value begins with a
860: .Sq +
861: character, then the specified methods will be appended to the default set
862: instead of replacing them.
1.242 djm 863: If the specified value begins with a
864: .Sq -
865: character, then the specified methods (including wildcards) will be removed
866: from the default set instead of replacing them.
1.173 naddy 867: The supported algorithms are:
868: .Pp
869: .Bl -item -compact -offset indent
870: .It
1.234 djm 871: curve25519-sha256
872: .It
1.173 naddy 873: curve25519-sha256@libssh.org
874: .It
875: diffie-hellman-group1-sha1
876: .It
877: diffie-hellman-group14-sha1
878: .It
879: diffie-hellman-group-exchange-sha1
880: .It
881: diffie-hellman-group-exchange-sha256
882: .It
883: ecdh-sha2-nistp256
884: .It
885: ecdh-sha2-nistp384
886: .It
887: ecdh-sha2-nistp521
888: .El
889: .Pp
890: The default is:
1.170 dtucker 891: .Bd -literal -offset indent
1.234 djm 892: curve25519-sha256,curve25519-sha256@libssh.org,
1.170 dtucker 893: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
894: diffie-hellman-group-exchange-sha256,
1.173 naddy 895: diffie-hellman-group14-sha1
1.170 dtucker 896: .Ed
1.188 djm 897: .Pp
1.237 jmc 898: The list of available key exchange algorithms may also be obtained using
899: .Qq ssh -Q kex .
1.1 stevesk 900: .It Cm ListenAddress
901: Specifies the local addresses
1.52 jmc 902: .Xr sshd 8
1.1 stevesk 903: should listen on.
904: The following forms may be used:
905: .Pp
906: .Bl -item -offset indent -compact
907: .It
908: .Cm ListenAddress
909: .Sm off
1.180 jmc 910: .Ar host | Ar IPv4_addr | Ar IPv6_addr
1.1 stevesk 911: .Sm on
912: .It
913: .Cm ListenAddress
914: .Sm off
1.180 jmc 915: .Ar host | Ar IPv4_addr : Ar port
1.1 stevesk 916: .Sm on
917: .It
918: .Cm ListenAddress
919: .Sm off
920: .Oo
1.180 jmc 921: .Ar host | Ar IPv6_addr Oc : Ar port
1.1 stevesk 922: .Sm on
923: .El
924: .Pp
925: If
926: .Ar port
927: is not specified,
1.200 dtucker 928: sshd will listen on the address and all
1.1 stevesk 929: .Cm Port
1.17 jmc 930: options specified.
931: The default is to listen on all local addresses.
1.15 jmc 932: Multiple
1.1 stevesk 933: .Cm ListenAddress
1.17 jmc 934: options are permitted.
1.1 stevesk 935: .It Cm LoginGraceTime
936: The server disconnects after this time if the user has not
937: successfully logged in.
938: If the value is 0, there is no time limit.
1.12 stevesk 939: The default is 120 seconds.
1.1 stevesk 940: .It Cm LogLevel
941: Gives the verbosity level that is used when logging messages from
1.53 jmc 942: .Xr sshd 8 .
1.1 stevesk 943: The possible values are:
1.52 jmc 944: QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
1.15 jmc 945: The default is INFO.
946: DEBUG and DEBUG1 are equivalent.
947: DEBUG2 and DEBUG3 each specify higher levels of debugging output.
948: Logging with a DEBUG level violates the privacy of users and is not recommended.
1.1 stevesk 949: .It Cm MACs
950: Specifies the available MAC (message authentication code) algorithms.
1.219 jmc 951: The MAC algorithm is used for data integrity protection.
1.1 stevesk 952: Multiple algorithms must be comma-separated.
1.208 djm 953: If the specified value begins with a
954: .Sq +
955: character, then the specified algorithms will be appended to the default set
956: instead of replacing them.
1.242 djm 957: If the specified value begins with a
958: .Sq -
959: character, then the specified algorithms (including wildcards) will be removed
960: from the default set instead of replacing them.
1.208 djm 961: .Pp
1.152 markus 962: The algorithms that contain
1.237 jmc 963: .Qq -etm
1.152 markus 964: calculate the MAC after encryption (encrypt-then-mac).
965: These are considered safer and their use recommended.
1.173 naddy 966: The supported MACs are:
967: .Pp
968: .Bl -item -compact -offset indent
969: .It
970: hmac-md5
971: .It
972: hmac-md5-96
973: .It
974: hmac-sha1
975: .It
976: hmac-sha1-96
977: .It
978: hmac-sha2-256
979: .It
980: hmac-sha2-512
981: .It
982: umac-64@openssh.com
983: .It
984: umac-128@openssh.com
985: .It
986: hmac-md5-etm@openssh.com
987: .It
988: hmac-md5-96-etm@openssh.com
989: .It
990: hmac-sha1-etm@openssh.com
991: .It
992: hmac-sha1-96-etm@openssh.com
993: .It
994: hmac-sha2-256-etm@openssh.com
995: .It
996: hmac-sha2-512-etm@openssh.com
997: .It
998: umac-64-etm@openssh.com
999: .It
1000: umac-128-etm@openssh.com
1001: .El
1002: .Pp
1.52 jmc 1003: The default is:
1.77 jmc 1004: .Bd -literal -offset indent
1.152 markus 1005: umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1006: hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
1.217 djm 1007: hmac-sha1-etm@openssh.com,
1.173 naddy 1008: umac-64@openssh.com,umac-128@openssh.com,
1.217 djm 1009: hmac-sha2-256,hmac-sha2-512,hmac-sha1
1.77 jmc 1010: .Ed
1.188 djm 1011: .Pp
1.237 jmc 1012: The list of available MAC algorithms may also be obtained using
1013: .Qq ssh -Q mac .
1.60 dtucker 1014: .It Cm Match
1.61 jmc 1015: Introduces a conditional block.
1.65 dtucker 1016: If all of the criteria on the
1.60 dtucker 1017: .Cm Match
1.65 dtucker 1018: line are satisfied, the keywords on the following lines override those
1019: set in the global section of the config file, until either another
1.60 dtucker 1020: .Cm Match
1.65 dtucker 1021: line or the end of the file.
1.172 djm 1022: If a keyword appears in multiple
1023: .Cm Match
1.177 sobrado 1024: blocks that are satisfied, only the first instance of the keyword is
1.172 djm 1025: applied.
1.91 djm 1026: .Pp
1.61 jmc 1027: The arguments to
1.60 dtucker 1028: .Cm Match
1.163 dtucker 1029: are one or more criteria-pattern pairs or the single token
1030: .Cm All
1031: which matches all criteria.
1.60 dtucker 1032: The available criteria are
1033: .Cm User ,
1.69 dtucker 1034: .Cm Group ,
1.60 dtucker 1035: .Cm Host ,
1.139 dtucker 1036: .Cm LocalAddress ,
1037: .Cm LocalPort ,
1.60 dtucker 1038: and
1039: .Cm Address .
1.91 djm 1040: The match patterns may consist of single entries or comma-separated
1041: lists and may use the wildcard and negation operators described in the
1.237 jmc 1042: .Sx PATTERNS
1043: section of
1.92 djm 1044: .Xr ssh_config 5 .
1.91 djm 1045: .Pp
1046: The patterns in an
1047: .Cm Address
1048: criteria may additionally contain addresses to match in CIDR
1.237 jmc 1049: address/masklen format,
1050: such as 192.0.2.0/24 or 2001:db8::/32.
1.91 djm 1051: Note that the mask length provided must be consistent with the address -
1052: it is an error to specify a mask length that is too long for the address
1.93 jmc 1053: or one with bits set in this host portion of the address.
1.237 jmc 1054: For example, 192.0.2.0/33 and 192.0.2.0/8, respectively.
1.91 djm 1055: .Pp
1.60 dtucker 1056: Only a subset of keywords may be used on the lines following a
1057: .Cm Match
1058: keyword.
1059: Available keywords are
1.142 jmc 1060: .Cm AcceptEnv ,
1.99 okan 1061: .Cm AllowAgentForwarding ,
1.142 jmc 1062: .Cm AllowGroups ,
1.193 djm 1063: .Cm AllowStreamLocalForwarding ,
1.62 dtucker 1064: .Cm AllowTcpForwarding ,
1.141 markus 1065: .Cm AllowUsers ,
1.149 djm 1066: .Cm AuthenticationMethods ,
1.146 djm 1067: .Cm AuthorizedKeysCommand ,
1068: .Cm AuthorizedKeysCommandUser ,
1.147 jmc 1069: .Cm AuthorizedKeysFile ,
1.214 djm 1070: .Cm AuthorizedPrincipalsCommand ,
1071: .Cm AuthorizedPrincipalsCommandUser ,
1.123 djm 1072: .Cm AuthorizedPrincipalsFile ,
1.72 dtucker 1073: .Cm Banner ,
1.85 djm 1074: .Cm ChrootDirectory ,
1.238 markus 1075: .Cm ClientAliveCountMax ,
1076: .Cm ClientAliveInterval ,
1.141 markus 1077: .Cm DenyGroups ,
1078: .Cm DenyUsers ,
1.67 dtucker 1079: .Cm ForceCommand ,
1.194 djm 1080: .Cm GatewayPorts ,
1.193 djm 1081: .Cm GSSAPIAuthentication ,
1.189 djm 1082: .Cm HostbasedAcceptedKeyTypes ,
1.87 djm 1083: .Cm HostbasedAuthentication ,
1.123 djm 1084: .Cm HostbasedUsesNameFromPacketOnly ,
1.193 djm 1085: .Cm IPQoS ,
1.74 jmc 1086: .Cm KbdInteractiveAuthentication ,
1.72 dtucker 1087: .Cm KerberosAuthentication ,
1.245 djm 1088: .Cm LogLevel ,
1.95 dtucker 1089: .Cm MaxAuthTries ,
1.94 dtucker 1090: .Cm MaxSessions ,
1.72 dtucker 1091: .Cm PasswordAuthentication ,
1.97 djm 1092: .Cm PermitEmptyPasswords ,
1.66 dtucker 1093: .Cm PermitOpen ,
1.79 dtucker 1094: .Cm PermitRootLogin ,
1.164 djm 1095: .Cm PermitTTY ,
1.123 djm 1096: .Cm PermitTunnel ,
1.174 djm 1097: .Cm PermitUserRC ,
1.189 djm 1098: .Cm PubkeyAcceptedKeyTypes ,
1.107 dtucker 1099: .Cm PubkeyAuthentication ,
1.159 dtucker 1100: .Cm RekeyLimit ,
1.193 djm 1101: .Cm RevokedKeys ,
1102: .Cm StreamLocalBindMask ,
1103: .Cm StreamLocalBindUnlink ,
1104: .Cm TrustedUserCAKeys ,
1.66 dtucker 1105: .Cm X11DisplayOffset ,
1.101 djm 1106: .Cm X11Forwarding
1.60 dtucker 1107: and
1.102 djm 1108: .Cm X11UseLocalHost .
1.33 dtucker 1109: .It Cm MaxAuthTries
1110: Specifies the maximum number of authentication attempts permitted per
1.35 jmc 1111: connection.
1112: Once the number of failures reaches half this value,
1113: additional failures are logged.
1114: The default is 6.
1.90 djm 1115: .It Cm MaxSessions
1.216 djm 1116: Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1117: sessions permitted per network connection.
1118: Multiple sessions may be established by clients that support connection
1119: multiplexing.
1120: Setting
1121: .Cm MaxSessions
1122: to 1 will effectively disable session multiplexing, whereas setting it to 0
1123: will prevent all shell, login and subsystem sessions while still permitting
1124: forwarding.
1.90 djm 1125: The default is 10.
1.1 stevesk 1126: .It Cm MaxStartups
1127: Specifies the maximum number of concurrent unauthenticated connections to the
1.52 jmc 1128: SSH daemon.
1.1 stevesk 1129: Additional connections will be dropped until authentication succeeds or the
1130: .Cm LoginGraceTime
1131: expires for a connection.
1.156 dtucker 1132: The default is 10:30:100.
1.1 stevesk 1133: .Pp
1134: Alternatively, random early drop can be enabled by specifying
1135: the three colon separated values
1.237 jmc 1136: start:rate:full (e.g. "10:30:60").
1.53 jmc 1137: .Xr sshd 8
1.237 jmc 1138: will refuse connection attempts with a probability of rate/100 (30%)
1139: if there are currently start (10) unauthenticated connections.
1.1 stevesk 1140: The probability increases linearly and all connection attempts
1.237 jmc 1141: are refused if the number of unauthenticated connections reaches full (60).
1.1 stevesk 1142: .It Cm PasswordAuthentication
1143: Specifies whether password authentication is allowed.
1144: The default is
1.237 jmc 1145: .Cm yes .
1.1 stevesk 1146: .It Cm PermitEmptyPasswords
1147: When password authentication is allowed, it specifies whether the
1148: server allows login to accounts with empty password strings.
1149: The default is
1.237 jmc 1150: .Cm no .
1.62 dtucker 1151: .It Cm PermitOpen
1152: Specifies the destinations to which TCP port forwarding is permitted.
1153: The forwarding specification must be one of the following forms:
1154: .Pp
1155: .Bl -item -offset indent -compact
1156: .It
1157: .Cm PermitOpen
1158: .Sm off
1159: .Ar host : port
1160: .Sm on
1161: .It
1162: .Cm PermitOpen
1163: .Sm off
1164: .Ar IPv4_addr : port
1165: .Sm on
1166: .It
1167: .Cm PermitOpen
1168: .Sm off
1169: .Ar \&[ IPv6_addr \&] : port
1170: .Sm on
1171: .El
1172: .Pp
1.68 dtucker 1173: Multiple forwards may be specified by separating them with whitespace.
1.62 dtucker 1174: An argument of
1.237 jmc 1175: .Cm any
1.62 dtucker 1176: can be used to remove all restrictions and permit any forwarding requests.
1.140 dtucker 1177: An argument of
1.237 jmc 1178: .Cm none
1.140 dtucker 1179: can be used to prohibit all forwarding requests.
1.227 jmc 1180: The wildcard
1.237 jmc 1181: .Sq *
1.227 jmc 1182: can be used for host or port to allow all hosts or ports, respectively.
1.63 jmc 1183: By default all port forwarding requests are permitted.
1.1 stevesk 1184: .It Cm PermitRootLogin
1.38 jmc 1185: Specifies whether root can log in using
1.1 stevesk 1186: .Xr ssh 1 .
1187: The argument must be
1.237 jmc 1188: .Cm yes ,
1189: .Cm prohibit-password ,
1190: .Cm without-password ,
1191: .Cm forced-commands-only ,
1.1 stevesk 1192: or
1.237 jmc 1193: .Cm no .
1.1 stevesk 1194: The default is
1.237 jmc 1195: .Cm prohibit-password .
1.1 stevesk 1196: .Pp
1197: If this option is set to
1.237 jmc 1198: .Cm prohibit-password
1.210 deraadt 1199: or
1.237 jmc 1200: .Cm without-password ,
1.210 deraadt 1201: password and keyboard-interactive authentication are disabled for root.
1.1 stevesk 1202: .Pp
1203: If this option is set to
1.237 jmc 1204: .Cm forced-commands-only ,
1.1 stevesk 1205: root login with public key authentication will be allowed,
1206: but only if the
1207: .Ar command
1208: option has been specified
1209: (which may be useful for taking remote backups even if root login is
1.17 jmc 1210: normally not allowed).
1211: All other authentication methods are disabled for root.
1.1 stevesk 1212: .Pp
1213: If this option is set to
1.237 jmc 1214: .Cm no ,
1.38 jmc 1215: root is not allowed to log in.
1.231 jmc 1216: .It Cm PermitTTY
1217: Specifies whether
1218: .Xr pty 4
1219: allocation is permitted.
1220: The default is
1.237 jmc 1221: .Cm yes .
1.46 reyk 1222: .It Cm PermitTunnel
1223: Specifies whether
1224: .Xr tun 4
1225: device forwarding is allowed.
1.47 reyk 1226: The argument must be
1.237 jmc 1227: .Cm yes ,
1228: .Cm point-to-point
1.58 stevesk 1229: (layer 3),
1.237 jmc 1230: .Cm ethernet
1.58 stevesk 1231: (layer 2), or
1.237 jmc 1232: .Cm no .
1.58 stevesk 1233: Specifying
1.237 jmc 1234: .Cm yes
1.58 stevesk 1235: permits both
1.237 jmc 1236: .Cm point-to-point
1.58 stevesk 1237: and
1.237 jmc 1238: .Cm ethernet .
1.46 reyk 1239: The default is
1.237 jmc 1240: .Cm no .
1.178 djm 1241: .Pp
1242: Independent of this setting, the permissions of the selected
1243: .Xr tun 4
1244: device must allow access to the user.
1.6 markus 1245: .It Cm PermitUserEnvironment
1246: Specifies whether
1247: .Pa ~/.ssh/environment
1.9 stevesk 1248: and
1.6 markus 1249: .Cm environment=
1250: options in
1251: .Pa ~/.ssh/authorized_keys
1.9 stevesk 1252: are processed by
1.52 jmc 1253: .Xr sshd 8 .
1.6 markus 1254: The default is
1.237 jmc 1255: .Cm no .
1.9 stevesk 1256: Enabling environment processing may enable users to bypass access
1257: restrictions in some configurations using mechanisms such as
1258: .Ev LD_PRELOAD .
1.174 djm 1259: .It Cm PermitUserRC
1260: Specifies whether any
1261: .Pa ~/.ssh/rc
1262: file is executed.
1263: The default is
1.237 jmc 1264: .Cm yes .
1.1 stevesk 1265: .It Cm PidFile
1.4 stevesk 1266: Specifies the file that contains the process ID of the
1.195 dtucker 1267: SSH daemon, or
1.237 jmc 1268: .Cm none
1.195 dtucker 1269: to not write one.
1.1 stevesk 1270: The default is
1271: .Pa /var/run/sshd.pid .
1272: .It Cm Port
1273: Specifies the port number that
1.52 jmc 1274: .Xr sshd 8
1.1 stevesk 1275: listens on.
1276: The default is 22.
1277: Multiple options of this type are permitted.
1278: See also
1279: .Cm ListenAddress .
1280: .It Cm PrintLastLog
1281: Specifies whether
1.52 jmc 1282: .Xr sshd 8
1.36 jaredy 1283: should print the date and time of the last user login when a user logs
1284: in interactively.
1.1 stevesk 1285: The default is
1.237 jmc 1286: .Cm yes .
1.1 stevesk 1287: .It Cm PrintMotd
1288: Specifies whether
1.52 jmc 1289: .Xr sshd 8
1.1 stevesk 1290: should print
1291: .Pa /etc/motd
1292: when a user logs in interactively.
1293: (On some systems it is also printed by the shell,
1294: .Pa /etc/profile ,
1295: or equivalent.)
1296: The default is
1.237 jmc 1297: .Cm yes .
1.189 djm 1298: .It Cm PubkeyAcceptedKeyTypes
1299: Specifies the key types that will be accepted for public key authentication
1300: as a comma-separated pattern list.
1.208 djm 1301: Alternately if the specified value begins with a
1302: .Sq +
1303: character, then the specified key types will be appended to the default set
1304: instead of replacing them.
1.242 djm 1305: If the specified value begins with a
1306: .Sq -
1307: character, then the specified key types (including wildcards) will be removed
1308: from the default set instead of replacing them.
1.206 markus 1309: The default for this option is:
1310: .Bd -literal -offset 3n
1311: ecdsa-sha2-nistp256-cert-v01@openssh.com,
1312: ecdsa-sha2-nistp384-cert-v01@openssh.com,
1313: ecdsa-sha2-nistp521-cert-v01@openssh.com,
1314: ssh-ed25519-cert-v01@openssh.com,
1315: ssh-rsa-cert-v01@openssh.com,
1316: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1.220 djm 1317: ssh-ed25519,ssh-rsa
1.206 markus 1318: .Ed
1319: .Pp
1.237 jmc 1320: The list of available key types may also be obtained using
1321: .Qq ssh -Q key .
1.1 stevesk 1322: .It Cm PubkeyAuthentication
1323: Specifies whether public key authentication is allowed.
1324: The default is
1.237 jmc 1325: .Cm yes .
1.159 dtucker 1326: .It Cm RekeyLimit
1327: Specifies the maximum amount of data that may be transmitted before the
1328: session key is renegotiated, optionally followed a maximum amount of
1329: time that may pass before the session key is renegotiated.
1330: The first argument is specified in bytes and may have a suffix of
1331: .Sq K ,
1332: .Sq M ,
1333: or
1334: .Sq G
1335: to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1336: The default is between
1337: .Sq 1G
1338: and
1339: .Sq 4G ,
1340: depending on the cipher.
1341: The optional second value is specified in seconds and may use any of the
1342: units documented in the
1343: .Sx TIME FORMATS
1.160 jmc 1344: section.
1.159 dtucker 1345: The default value for
1346: .Cm RekeyLimit
1347: is
1.237 jmc 1348: .Cm default none ,
1.159 dtucker 1349: which means that rekeying is performed after the cipher's default amount
1350: of data has been sent or received and no time based rekeying is done.
1.118 djm 1351: .It Cm RevokedKeys
1.195 dtucker 1352: Specifies revoked public keys file, or
1.237 jmc 1353: .Cm none
1.195 dtucker 1354: to not use one.
1.118 djm 1355: Keys listed in this file will be refused for public key authentication.
1356: Note that if this file is not readable, then public key authentication will
1357: be refused for all users.
1.154 djm 1358: Keys may be specified as a text file, listing one public key per line, or as
1359: an OpenSSH Key Revocation List (KRL) as generated by
1.155 jmc 1360: .Xr ssh-keygen 1 .
1.161 jmc 1361: For more information on KRLs, see the KEY REVOCATION LISTS section in
1.154 djm 1362: .Xr ssh-keygen 1 .
1.175 millert 1363: .It Cm StreamLocalBindMask
1364: Sets the octal file creation mode mask
1365: .Pq umask
1366: used when creating a Unix-domain socket file for local or remote
1367: port forwarding.
1368: This option is only used for port forwarding to a Unix-domain socket file.
1369: .Pp
1370: The default value is 0177, which creates a Unix-domain socket file that is
1371: readable and writable only by the owner.
1372: Note that not all operating systems honor the file mode on Unix-domain
1373: socket files.
1374: .It Cm StreamLocalBindUnlink
1375: Specifies whether to remove an existing Unix-domain socket file for local
1376: or remote port forwarding before creating a new one.
1377: If the socket file already exists and
1378: .Cm StreamLocalBindUnlink
1379: is not enabled,
1380: .Nm sshd
1381: will be unable to forward the port to the Unix-domain socket file.
1382: This option is only used for port forwarding to a Unix-domain socket file.
1383: .Pp
1384: The argument must be
1.237 jmc 1385: .Cm yes
1.175 millert 1386: or
1.237 jmc 1387: .Cm no .
1.175 millert 1388: The default is
1.237 jmc 1389: .Cm no .
1.1 stevesk 1390: .It Cm StrictModes
1391: Specifies whether
1.52 jmc 1392: .Xr sshd 8
1.1 stevesk 1393: should check file modes and ownership of the
1394: user's files and home directory before accepting login.
1395: This is normally desirable because novices sometimes accidentally leave their
1396: directory or files world-writable.
1397: The default is
1.237 jmc 1398: .Cm yes .
1.112 djm 1399: Note that this does not apply to
1400: .Cm ChrootDirectory ,
1401: whose permissions and ownership are checked unconditionally.
1.1 stevesk 1402: .It Cm Subsystem
1.51 jmc 1403: Configures an external subsystem (e.g. file transfer daemon).
1.59 djm 1404: Arguments should be a subsystem name and a command (with optional arguments)
1405: to execute upon subsystem request.
1.80 djm 1406: .Pp
1.1 stevesk 1407: The command
1.237 jmc 1408: .Cm sftp-server
1409: implements the SFTP file transfer subsystem.
1.80 djm 1410: .Pp
1411: Alternately the name
1.237 jmc 1412: .Cm internal-sftp
1413: implements an in-process SFTP server.
1.80 djm 1414: This may simplify configurations using
1415: .Cm ChrootDirectory
1416: to force a different filesystem root on clients.
1417: .Pp
1.1 stevesk 1418: By default no subsystems are defined.
1419: .It Cm SyslogFacility
1420: Gives the facility code that is used when logging messages from
1.53 jmc 1421: .Xr sshd 8 .
1.1 stevesk 1422: The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1423: LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1424: The default is AUTH.
1.27 markus 1425: .It Cm TCPKeepAlive
1426: Specifies whether the system should send TCP keepalive messages to the
1427: other side.
1428: If they are sent, death of the connection or crash of one
1429: of the machines will be properly noticed.
1430: However, this means that
1431: connections will die if the route is down temporarily, and some people
1432: find it annoying.
1433: On the other hand, if TCP keepalives are not sent,
1434: sessions may hang indefinitely on the server, leaving
1.237 jmc 1435: .Qq ghost
1.27 markus 1436: users and consuming server resources.
1437: .Pp
1438: The default is
1.237 jmc 1439: .Cm yes
1.27 markus 1440: (to send TCP keepalive messages), and the server will notice
1441: if the network goes down or the client host crashes.
1442: This avoids infinitely hanging sessions.
1443: .Pp
1444: To disable TCP keepalive messages, the value should be set to
1.237 jmc 1445: .Cm no .
1.118 djm 1446: .It Cm TrustedUserCAKeys
1447: Specifies a file containing public keys of certificate authorities that are
1.195 dtucker 1448: trusted to sign user certificates for authentication, or
1.237 jmc 1449: .Cm none
1.195 dtucker 1450: to not use one.
1.119 jmc 1451: Keys are listed one per line; empty lines and comments starting with
1.118 djm 1452: .Ql #
1453: are allowed.
1454: If a certificate is presented for authentication and has its signing CA key
1455: listed in this file, then it may be used for authentication for any user
1456: listed in the certificate's principals list.
1457: Note that certificates that lack a list of principals will not be permitted
1458: for authentication using
1459: .Cm TrustedUserCAKeys .
1.161 jmc 1460: For more details on certificates, see the CERTIFICATES section in
1.118 djm 1461: .Xr ssh-keygen 1 .
1.18 markus 1462: .It Cm UseDNS
1463: Specifies whether
1.52 jmc 1464: .Xr sshd 8
1.207 djm 1465: should look up the remote host name, and to check that
1.18 markus 1466: the resolved host name for the remote IP address maps back to the
1467: very same IP address.
1.207 djm 1468: .Pp
1469: If this option is set to
1.237 jmc 1470: .Cm no
1.207 djm 1471: (the default) then only addresses and not host names may be used in
1.221 djm 1472: .Pa ~/.ssh/authorized_keys
1.207 djm 1473: .Cm from
1474: and
1.211 jmc 1475: .Nm
1.207 djm 1476: .Cm Match
1477: .Cm Host
1478: directives.
1.137 djm 1479: .It Cm VersionAddendum
1480: Optionally specifies additional text to append to the SSH protocol banner
1481: sent by the server upon connection.
1482: The default is
1.237 jmc 1483: .Cm none .
1.1 stevesk 1484: .It Cm X11DisplayOffset
1485: Specifies the first display number available for
1.52 jmc 1486: .Xr sshd 8 Ns 's
1.1 stevesk 1487: X11 forwarding.
1.52 jmc 1488: This prevents sshd from interfering with real X11 servers.
1.1 stevesk 1489: The default is 10.
1490: .It Cm X11Forwarding
1491: Specifies whether X11 forwarding is permitted.
1.13 stevesk 1492: The argument must be
1.237 jmc 1493: .Cm yes
1.13 stevesk 1494: or
1.237 jmc 1495: .Cm no .
1.1 stevesk 1496: The default is
1.237 jmc 1497: .Cm no .
1.13 stevesk 1498: .Pp
1499: When X11 forwarding is enabled, there may be additional exposure to
1500: the server and to client displays if the
1.52 jmc 1501: .Xr sshd 8
1.13 stevesk 1502: proxy display is configured to listen on the wildcard address (see
1.237 jmc 1503: .Cm X11UseLocalhost ) ,
1504: though this is not the default.
1.13 stevesk 1505: Additionally, the authentication spoofing and authentication data
1506: verification and substitution occur on the client side.
1507: The security risk of using X11 forwarding is that the client's X11
1.52 jmc 1508: display server may be exposed to attack when the SSH client requests
1.13 stevesk 1509: forwarding (see the warnings for
1510: .Cm ForwardX11
1511: in
1.19 jmc 1512: .Xr ssh_config 5 ) .
1.13 stevesk 1513: A system administrator may have a stance in which they want to
1514: protect clients that may expose themselves to attack by unwittingly
1515: requesting X11 forwarding, which can warrant a
1.237 jmc 1516: .Cm no
1.13 stevesk 1517: setting.
1518: .Pp
1519: Note that disabling X11 forwarding does not prevent users from
1520: forwarding X11 traffic, as users can always install their own forwarders.
1.1 stevesk 1521: .It Cm X11UseLocalhost
1522: Specifies whether
1.52 jmc 1523: .Xr sshd 8
1.1 stevesk 1524: should bind the X11 forwarding server to the loopback address or to
1.15 jmc 1525: the wildcard address.
1526: By default,
1.52 jmc 1527: sshd binds the forwarding server to the loopback address and sets the
1.1 stevesk 1528: hostname part of the
1529: .Ev DISPLAY
1530: environment variable to
1.237 jmc 1531: .Cm localhost .
1.8 stevesk 1532: This prevents remote hosts from connecting to the proxy display.
1.1 stevesk 1533: However, some older X11 clients may not function with this
1534: configuration.
1535: .Cm X11UseLocalhost
1536: may be set to
1.237 jmc 1537: .Cm no
1.1 stevesk 1538: to specify that the forwarding server should be bound to the wildcard
1539: address.
1540: The argument must be
1.237 jmc 1541: .Cm yes
1.1 stevesk 1542: or
1.237 jmc 1543: .Cm no .
1.1 stevesk 1544: The default is
1.237 jmc 1545: .Cm yes .
1.1 stevesk 1546: .It Cm XAuthLocation
1.11 stevesk 1547: Specifies the full pathname of the
1.1 stevesk 1548: .Xr xauth 1
1.195 dtucker 1549: program, or
1.237 jmc 1550: .Cm none
1.195 dtucker 1551: to not use one.
1.1 stevesk 1552: The default is
1553: .Pa /usr/X11R6/bin/xauth .
1554: .El
1.55 jmc 1555: .Sh TIME FORMATS
1.53 jmc 1556: .Xr sshd 8
1.1 stevesk 1557: command-line arguments and configuration file options that specify time
1558: may be expressed using a sequence of the form:
1559: .Sm off
1.7 stevesk 1560: .Ar time Op Ar qualifier ,
1.1 stevesk 1561: .Sm on
1562: where
1563: .Ar time
1564: is a positive integer value and
1565: .Ar qualifier
1566: is one of the following:
1567: .Pp
1568: .Bl -tag -width Ds -compact -offset indent
1.64 jmc 1569: .It Aq Cm none
1.1 stevesk 1570: seconds
1571: .It Cm s | Cm S
1572: seconds
1573: .It Cm m | Cm M
1574: minutes
1575: .It Cm h | Cm H
1576: hours
1577: .It Cm d | Cm D
1578: days
1579: .It Cm w | Cm W
1580: weeks
1581: .El
1582: .Pp
1583: Each member of the sequence is added together to calculate
1584: the total time value.
1585: .Pp
1586: Time format examples:
1587: .Pp
1588: .Bl -tag -width Ds -compact -offset indent
1589: .It 600
1590: 600 seconds (10 minutes)
1591: .It 10m
1592: 10 minutes
1593: .It 1h30m
1594: 1 hour 30 minutes (90 minutes)
1595: .El
1.235 jmc 1596: .Sh TOKENS
1597: Arguments to some keywords can make use of tokens,
1598: which are expanded at runtime:
1599: .Pp
1600: .Bl -tag -width XXXX -offset indent -compact
1601: .It %%
1602: A literal
1603: .Sq % .
1604: .It %F
1605: The fingerprint of the CA key.
1606: .It %f
1607: The fingerprint of the key or certificate.
1608: .It %h
1609: The home directory of the user.
1610: .It %i
1611: The key ID in the certificate.
1612: .It %K
1613: The base64-encoded CA key.
1614: .It %k
1615: The base64-encoded key or certificate for authentication.
1616: .It %s
1617: The serial number of the certificate.
1618: .It \&%T
1619: The type of the CA key.
1620: .It %t
1621: The key or certificate type.
1622: .It %u
1623: The username.
1624: .El
1625: .Pp
1626: .Cm AuthorizedKeysCommand
1.241 jmc 1627: accepts the tokens %%, %f, %h, %k, %t, and %u.
1.235 jmc 1628: .Pp
1629: .Cm AuthorizedKeysFile
1630: accepts the tokens %%, %h, and %u.
1631: .Pp
1632: .Cm AuthorizedPrincipalsCommand
1.241 jmc 1633: accepts the tokens %%, %F, %f, %h, %i, %K, %k, %s, %T, %t, and %u.
1.235 jmc 1634: .Pp
1635: .Cm AuthorizedPrincipalsFile
1636: accepts the tokens %%, %h, and %u.
1637: .Pp
1638: .Cm ChrootDirectory
1639: accepts the tokens %%, %h, and %u.
1.1 stevesk 1640: .Sh FILES
1641: .Bl -tag -width Ds
1642: .It Pa /etc/ssh/sshd_config
1643: Contains configuration data for
1.53 jmc 1644: .Xr sshd 8 .
1.1 stevesk 1645: This file should be writable by root only, but it is recommended
1646: (though not necessary) that it be world-readable.
1647: .El
1.19 jmc 1648: .Sh SEE ALSO
1.237 jmc 1649: .Xr sftp-server 8 ,
1.19 jmc 1650: .Xr sshd 8
1.1 stevesk 1651: .Sh AUTHORS
1.237 jmc 1652: .An -nosplit
1.1 stevesk 1653: OpenSSH is a derivative of the original and free
1.237 jmc 1654: ssh 1.2.12 release by
1655: .An Tatu Ylonen .
1656: .An Aaron Campbell , Bob Beck , Markus Friedl , Niels Provos ,
1657: .An Theo de Raadt
1658: and
1659: .An Dug Song
1.1 stevesk 1660: removed many bugs, re-added newer features and
1661: created OpenSSH.
1.237 jmc 1662: .An Markus Friedl
1663: contributed the support for SSH protocol versions 1.5 and 2.0.
1664: .An Niels Provos
1665: and
1666: .An Markus Friedl
1667: contributed support for privilege separation.