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