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