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