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