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