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