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