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