Merge branch 'vendor/ZLIB'
[dragonfly.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.284 2019/03/22 20:58:34 jmc Exp $
37 .Dd $Mdocdate: March 22 2019 $
38 .Dt SSHD_CONFIG 5
39 .Os
40 .Sh NAME
41 .Nm sshd_config
42 .Nd OpenSSH SSH daemon configuration file
43 .Sh DESCRIPTION
44 .Xr sshd 8
45 reads configuration data from
46 .Pa /etc/ssh/sshd_config
47 (or the file specified with
48 .Fl f
49 on the command line).
50 The file contains keyword-argument pairs, one per line.
51 For each keyword, the first obtained value will be used.
52 Lines starting with
53 .Ql #
54 and empty lines are interpreted as comments.
55 Arguments may optionally be enclosed in double quotes
56 .Pq \&"
57 in order to represent arguments containing spaces.
58 .Pp
59 The possible
60 keywords and their meanings are as follows (note that
61 keywords are case-insensitive and arguments are case-sensitive):
62 .Bl -tag -width Ds
63 .It Cm AcceptEnv
64 Specifies what environment variables sent by the client will be copied into
65 the session's
66 .Xr environ 7 .
67 See
68 .Cm SendEnv
69 and
70 .Cm SetEnv
71 in
72 .Xr ssh_config 5
73 for how to configure the client.
74 The
75 .Ev TERM
76 environment variable is always accepted whenever the client
77 requests a pseudo-terminal as it is required by the protocol.
78 Variables are specified by name, which may contain the wildcard characters
79 .Ql *
80 and
81 .Ql \&? .
82 Multiple environment variables may be separated by whitespace or spread
83 across multiple
84 .Cm AcceptEnv
85 directives.
86 Be warned that some environment variables could be used to bypass restricted
87 user environments.
88 For this reason, care should be taken in the use of this directive.
89 The default is not to accept any environment variables.
90 .It Cm AddressFamily
91 Specifies which address family should be used by
92 .Xr sshd 8 .
93 Valid arguments are
94 .Cm any
95 (the default),
96 .Cm inet
97 (use IPv4 only), or
98 .Cm inet6
99 (use IPv6 only).
100 .It Cm AllowAgentForwarding
101 Specifies whether
102 .Xr ssh-agent 1
103 forwarding is permitted.
104 The default is
105 .Cm yes .
106 Note that disabling agent forwarding does not improve security
107 unless users are also denied shell access, as they can always install
108 their own forwarders.
109 .It Cm AllowGroups
110 This keyword can be followed by a list of group name patterns, separated
111 by spaces.
112 If specified, login is allowed only for users whose primary
113 group or supplementary group list matches one of the patterns.
114 Only group names are valid; a numerical group ID is not recognized.
115 By default, login is allowed for all groups.
116 The allow/deny directives are processed in the following order:
117 .Cm DenyUsers ,
118 .Cm AllowUsers ,
119 .Cm DenyGroups ,
120 and finally
121 .Cm AllowGroups .
122 .Pp
123 See PATTERNS in
124 .Xr ssh_config 5
125 for more information on patterns.
126 .It Cm AllowStreamLocalForwarding
127 Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted.
128 The available options are
129 .Cm yes
130 (the default)
131 or
132 .Cm all
133 to allow StreamLocal forwarding,
134 .Cm no
135 to prevent all StreamLocal forwarding,
136 .Cm local
137 to allow local (from the perspective of
138 .Xr ssh 1 )
139 forwarding only or
140 .Cm remote
141 to allow remote forwarding only.
142 Note that disabling StreamLocal forwarding does not improve security unless
143 users are also denied shell access, as they can always install their
144 own forwarders.
145 .It Cm AllowTcpForwarding
146 Specifies whether TCP forwarding is permitted.
147 The available options are
148 .Cm yes
149 (the default)
150 or
151 .Cm all
152 to allow TCP forwarding,
153 .Cm no
154 to prevent all TCP forwarding,
155 .Cm local
156 to allow local (from the perspective of
157 .Xr ssh 1 )
158 forwarding only or
159 .Cm remote
160 to allow remote forwarding only.
161 Note that disabling TCP forwarding does not improve security unless
162 users are also denied shell access, as they can always install their
163 own forwarders.
164 .It Cm AllowUsers
165 This keyword can be followed by a list of user name patterns, separated
166 by spaces.
167 If specified, login is allowed only for user names that
168 match one of the patterns.
169 Only user names are valid; a numerical user ID is not recognized.
170 By default, login is allowed for all users.
171 If the pattern takes the form USER@HOST then USER and HOST
172 are separately checked, restricting logins to particular
173 users from particular hosts.
174 HOST criteria may additionally contain addresses to match in CIDR
175 address/masklen format.
176 The allow/deny directives are processed in the following order:
177 .Cm DenyUsers ,
178 .Cm AllowUsers ,
179 .Cm DenyGroups ,
180 and finally
181 .Cm AllowGroups .
182 .Pp
183 See PATTERNS in
184 .Xr ssh_config 5
185 for more information on patterns.
186 .It Cm AuthenticationMethods
187 Specifies the authentication methods that must be successfully completed
188 for a user to be granted access.
189 This option must be followed by one or more lists of comma-separated
190 authentication method names, or by the single string
191 .Cm any
192 to indicate the default behaviour of accepting any single authentication
193 method.
194 If the default is overridden, then successful authentication requires
195 completion of every method in at least one of these lists.
196 .Pp
197 For example,
198 .Qq publickey,password publickey,keyboard-interactive
199 would require the user to complete public key authentication, followed by
200 either password or keyboard interactive authentication.
201 Only methods that are next in one or more lists are offered at each stage,
202 so for this example it would not be possible to attempt password or
203 keyboard-interactive authentication before public key.
204 .Pp
205 For keyboard interactive authentication it is also possible to
206 restrict authentication to a specific device by appending a
207 colon followed by the device identifier
208 .Cm bsdauth
209 or
210 .Cm pam .
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 PermitEmptyPasswords
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 CASignatureAlgorithms
386 Specifies which algorithms are allowed for signing of certificates
387 by certificate authorities (CAs).
388 The default is:
389 .Bd -literal -offset indent
390 ecdsa-sha2-nistp256.ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
391 ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
392 .Ed
393 .Pp
394 Certificates signed using other algorithms will not be accepted for
395 public key or host-based authentication.
396 .It Cm ChallengeResponseAuthentication
397 Specifies whether challenge-response authentication is allowed (e.g. via
398 PAM or through authentication styles supported in
399 .Xr login.conf 5 )
400 The default is
401 .Cm yes .
402 .It Cm ChrootDirectory
403 Specifies the pathname of a directory to
404 .Xr chroot 2
405 to after authentication.
406 At session startup
407 .Xr sshd 8
408 checks that all components of the pathname are root-owned directories
409 which are not writable by any other user or group.
410 After the chroot,
411 .Xr sshd 8
412 changes the working directory to the user's home directory.
413 Arguments to
414 .Cm ChrootDirectory
415 accept the tokens described in the
416 .Sx TOKENS
417 section.
418 .Pp
419 The
420 .Cm ChrootDirectory
421 must contain the necessary files and directories to support the
422 user's session.
423 For an interactive session this requires at least a shell, typically
424 .Xr sh 1 ,
425 and basic
426 .Pa /dev
427 nodes such as
428 .Xr null 4 ,
429 .Xr zero 4 ,
430 .Xr stdin 4 ,
431 .Xr stdout 4 ,
432 .Xr stderr 4 ,
433 and
434 .Xr tty 4
435 devices.
436 For file transfer sessions using SFTP
437 no additional configuration of the environment is necessary if the in-process
438 sftp-server is used,
439 though sessions which use logging may require
440 .Pa /dev/log
441 inside the chroot directory on some operating systems (see
442 .Xr sftp-server 8
443 for details).
444 .Pp
445 For safety, it is very important that the directory hierarchy be
446 prevented from modification by other processes on the system (especially
447 those outside the jail).
448 Misconfiguration can lead to unsafe environments which
449 .Xr sshd 8
450 cannot detect.
451 .Pp
452 The default is
453 .Cm none ,
454 indicating not to
455 .Xr chroot 2 .
456 .It Cm Ciphers
457 Specifies the ciphers allowed.
458 Multiple ciphers must be comma-separated.
459 If the specified value begins with a
460 .Sq +
461 character, then the specified ciphers will be appended to the default set
462 instead of replacing them.
463 If the specified value begins with a
464 .Sq -
465 character, then the specified ciphers (including wildcards) will be removed
466 from the default set instead of replacing them.
467 .Pp
468 The supported ciphers are:
469 .Pp
470 .Bl -item -compact -offset indent
471 .It
472 3des-cbc
473 .It
474 aes128-cbc
475 .It
476 aes192-cbc
477 .It
478 aes256-cbc
479 .It
480 aes128-ctr
481 .It
482 aes192-ctr
483 .It
484 aes256-ctr
485 .It
486 aes128-gcm@openssh.com
487 .It
488 aes256-gcm@openssh.com
489 .It
490 chacha20-poly1305@openssh.com
491 .El
492 .Pp
493 The default is:
494 .Bd -literal -offset indent
495 chacha20-poly1305@openssh.com,
496 aes128-ctr,aes192-ctr,aes256-ctr,
497 aes128-gcm@openssh.com,aes256-gcm@openssh.com
498 .Ed
499 .Pp
500 The list of available ciphers may also be obtained using
501 .Qq ssh -Q cipher .
502 .It Cm ClientAliveCountMax
503 Sets the number of client alive messages which may be sent without
504 .Xr sshd 8
505 receiving any messages back from the client.
506 If this threshold is reached while client alive messages are being sent,
507 sshd will disconnect the client, terminating the session.
508 It is important to note that the use of client alive messages is very
509 different from
510 .Cm TCPKeepAlive .
511 The client alive messages are sent through the encrypted channel
512 and therefore will not be spoofable.
513 The TCP keepalive option enabled by
514 .Cm TCPKeepAlive
515 is spoofable.
516 The client alive mechanism is valuable when the client or
517 server depend on knowing when a connection has become inactive.
518 .Pp
519 The default value is 3.
520 If
521 .Cm ClientAliveInterval
522 is set to 15, and
523 .Cm ClientAliveCountMax
524 is left at the default, unresponsive SSH clients
525 will be disconnected after approximately 45 seconds.
526 .It Cm ClientAliveInterval
527 Sets a timeout interval in seconds after which if no data has been received
528 from the client,
529 .Xr sshd 8
530 will send a message through the encrypted
531 channel to request a response from the client.
532 The default
533 is 0, indicating that these messages will not be sent to the client.
534 .It Cm Compression
535 Specifies whether compression is enabled after
536 the user has authenticated successfully.
537 The argument must be
538 .Cm yes ,
539 .Cm delayed
540 (a legacy synonym for
541 .Cm yes )
542 or
543 .Cm no .
544 The default is
545 .Cm yes .
546 .It Cm DenyGroups
547 This keyword can be followed by a list of group name patterns, separated
548 by spaces.
549 Login is disallowed for users whose primary group or supplementary
550 group list matches one of the patterns.
551 Only group names are valid; a numerical group ID is not recognized.
552 By default, login is allowed for all groups.
553 The allow/deny directives are processed in the following order:
554 .Cm DenyUsers ,
555 .Cm AllowUsers ,
556 .Cm DenyGroups ,
557 and finally
558 .Cm AllowGroups .
559 .Pp
560 See PATTERNS in
561 .Xr ssh_config 5
562 for more information on patterns.
563 .It Cm DenyUsers
564 This keyword can be followed by a list of user name patterns, separated
565 by spaces.
566 Login is disallowed for user names that match one of the patterns.
567 Only user names are valid; a numerical user ID is not recognized.
568 By default, login is allowed for all users.
569 If the pattern takes the form USER@HOST then USER and HOST
570 are separately checked, restricting logins to particular
571 users from particular hosts.
572 HOST criteria may additionally contain addresses to match in CIDR
573 address/masklen format.
574 The allow/deny directives are processed in the following order:
575 .Cm DenyUsers ,
576 .Cm AllowUsers ,
577 .Cm DenyGroups ,
578 and finally
579 .Cm AllowGroups .
580 .Pp
581 See PATTERNS in
582 .Xr ssh_config 5
583 for more information on patterns.
584 .It Cm DisableForwarding
585 Disables all forwarding features, including X11,
586 .Xr ssh-agent 1 ,
587 TCP and StreamLocal.
588 This option overrides all other forwarding-related options and may
589 simplify restricted configurations.
590 .It Cm ExposeAuthInfo
591 Writes a temporary file containing a list of authentication methods and
592 public credentials (e.g. keys) used to authenticate the user.
593 The location of the file is exposed to the user session through the
594 .Ev SSH_USER_AUTH
595 environment variable.
596 The default is
597 .Cm no .
598 .It Cm FingerprintHash
599 Specifies the hash algorithm used when logging key fingerprints.
600 Valid options are:
601 .Cm md5
602 and
603 .Cm sha256 .
604 The default is
605 .Cm sha256 .
606 .It Cm ForceCommand
607 Forces the execution of the command specified by
608 .Cm ForceCommand ,
609 ignoring any command supplied by the client and
610 .Pa ~/.ssh/rc
611 if present.
612 The command is invoked by using the user's login shell with the -c option.
613 This applies to shell, command, or subsystem execution.
614 It is most useful inside a
615 .Cm Match
616 block.
617 The command originally supplied by the client is available in the
618 .Ev SSH_ORIGINAL_COMMAND
619 environment variable.
620 Specifying a command of
621 .Cm internal-sftp
622 will force the use of an in-process SFTP server that requires no support
623 files when used with
624 .Cm ChrootDirectory .
625 The default is
626 .Cm none .
627 .It Cm GatewayPorts
628 Specifies whether remote hosts are allowed to connect to ports
629 forwarded for the client.
630 By default,
631 .Xr sshd 8
632 binds remote port forwardings to the loopback address.
633 This prevents other remote hosts from connecting to forwarded ports.
634 .Cm GatewayPorts
635 can be used to specify that sshd
636 should allow remote port forwardings to bind to non-loopback addresses, thus
637 allowing other hosts to connect.
638 The argument may be
639 .Cm no
640 to force remote port forwardings to be available to the local host only,
641 .Cm yes
642 to force remote port forwardings to bind to the wildcard address, or
643 .Cm clientspecified
644 to allow the client to select the address to which the forwarding is bound.
645 The default is
646 .Cm no .
647 .It Cm GSSAPIAuthentication
648 Specifies whether user authentication based on GSSAPI is allowed.
649 The default is
650 .Cm no .
651 .It Cm GSSAPICleanupCredentials
652 Specifies whether to automatically destroy the user's credentials cache
653 on logout.
654 The default is
655 .Cm yes .
656 .It Cm GSSAPIStrictAcceptorCheck
657 Determines whether to be strict about the identity of the GSSAPI acceptor
658 a client authenticates against.
659 If set to
660 .Cm yes
661 then the client must authenticate against the host
662 service on the current hostname.
663 If set to
664 .Cm no
665 then the client may authenticate against any service key stored in the
666 machine's default store.
667 This facility is provided to assist with operation on multi homed machines.
668 The default is
669 .Cm yes .
670 .It Cm HostbasedAcceptedKeyTypes
671 Specifies the key types that will be accepted for hostbased authentication
672 as a list of comma-separated patterns.
673 Alternately if the specified value begins with a
674 .Sq +
675 character, then the specified key types will be appended to the default set
676 instead of replacing them.
677 If the specified value begins with a
678 .Sq -
679 character, then the specified key types (including wildcards) will be removed
680 from the default set instead of replacing them.
681 The default for this option is:
682 .Bd -literal -offset 3n
683 ecdsa-sha2-nistp256-cert-v01@openssh.com,
684 ecdsa-sha2-nistp384-cert-v01@openssh.com,
685 ecdsa-sha2-nistp521-cert-v01@openssh.com,
686 ssh-ed25519-cert-v01@openssh.com,
687 rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,
688 ssh-rsa-cert-v01@openssh.com,
689 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
690 ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
691 .Ed
692 .Pp
693 The list of available key types may also be obtained using
694 .Qq ssh -Q key .
695 .It Cm HostbasedAuthentication
696 Specifies whether rhosts or /etc/hosts.equiv authentication together
697 with successful public key client host authentication is allowed
698 (host-based authentication).
699 The default is
700 .Cm no .
701 .It Cm HostbasedUsesNameFromPacketOnly
702 Specifies whether or not the server will attempt to perform a reverse
703 name lookup when matching the name in the
704 .Pa ~/.shosts ,
705 .Pa ~/.rhosts ,
706 and
707 .Pa /etc/hosts.equiv
708 files during
709 .Cm HostbasedAuthentication .
710 A setting of
711 .Cm yes
712 means that
713 .Xr sshd 8
714 uses the name supplied by the client rather than
715 attempting to resolve the name from the TCP connection itself.
716 The default is
717 .Cm no .
718 .It Cm HostCertificate
719 Specifies a file containing a public host certificate.
720 The certificate's public key must match a private host key already specified
721 by
722 .Cm HostKey .
723 The default behaviour of
724 .Xr sshd 8
725 is not to load any certificates.
726 .It Cm HostKey
727 Specifies a file containing a private host key
728 used by SSH.
729 The defaults are
730 .Pa /etc/ssh/ssh_host_ecdsa_key ,
731 .Pa /etc/ssh/ssh_host_ed25519_key
732 and
733 .Pa /etc/ssh/ssh_host_rsa_key .
734 .Pp
735 Note that
736 .Xr sshd 8
737 will refuse to use a file if it is group/world-accessible
738 and that the
739 .Cm HostKeyAlgorithms
740 option restricts which of the keys are actually used by
741 .Xr sshd 8 .
742 .Pp
743 It is possible to have multiple host key files.
744 It is also possible to specify public host key files instead.
745 In this case operations on the private key will be delegated
746 to an
747 .Xr ssh-agent 1 .
748 .It Cm HostKeyAgent
749 Identifies the UNIX-domain socket used to communicate
750 with an agent that has access to the private host keys.
751 If the string
752 .Qq SSH_AUTH_SOCK
753 is specified, the location of the socket will be read from the
754 .Ev SSH_AUTH_SOCK
755 environment variable.
756 .It Cm HostKeyAlgorithms
757 Specifies the host key algorithms
758 that the server offers.
759 The default for this option is:
760 .Bd -literal -offset 3n
761 ecdsa-sha2-nistp256-cert-v01@openssh.com,
762 ecdsa-sha2-nistp384-cert-v01@openssh.com,
763 ecdsa-sha2-nistp521-cert-v01@openssh.com,
764 ssh-ed25519-cert-v01@openssh.com,
765 rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,
766 ssh-rsa-cert-v01@openssh.com,
767 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
768 ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
769 .Ed
770 .Pp
771 The list of available key types may also be obtained using
772 .Qq ssh -Q key .
773 .It Cm IgnoreRhosts
774 Specifies that
775 .Pa .rhosts
776 and
777 .Pa .shosts
778 files will not be used in
779 .Cm HostbasedAuthentication .
780 .Pp
781 .Pa /etc/hosts.equiv
782 and
783 .Pa /etc/shosts.equiv
784 are still used.
785 The default is
786 .Cm yes .
787 .It Cm IgnoreUserKnownHosts
788 Specifies whether
789 .Xr sshd 8
790 should ignore the user's
791 .Pa ~/.ssh/known_hosts
792 during
793 .Cm HostbasedAuthentication
794 and use only the system-wide known hosts file
795 .Pa /etc/ssh/known_hosts .
796 The default is
797 .Cm no .
798 .It Cm IPQoS
799 Specifies the IPv4 type-of-service or DSCP class for the connection.
800 Accepted values are
801 .Cm af11 ,
802 .Cm af12 ,
803 .Cm af13 ,
804 .Cm af21 ,
805 .Cm af22 ,
806 .Cm af23 ,
807 .Cm af31 ,
808 .Cm af32 ,
809 .Cm af33 ,
810 .Cm af41 ,
811 .Cm af42 ,
812 .Cm af43 ,
813 .Cm cs0 ,
814 .Cm cs1 ,
815 .Cm cs2 ,
816 .Cm cs3 ,
817 .Cm cs4 ,
818 .Cm cs5 ,
819 .Cm cs6 ,
820 .Cm cs7 ,
821 .Cm ef ,
822 .Cm lowdelay ,
823 .Cm throughput ,
824 .Cm reliability ,
825 a numeric value, or
826 .Cm none
827 to use the operating system default.
828 This option may take one or two arguments, separated by whitespace.
829 If one argument is specified, it is used as the packet class unconditionally.
830 If two values are specified, the first is automatically selected for
831 interactive sessions and the second for non-interactive sessions.
832 The default is
833 .Cm af21
834 (Low-Latency Data)
835 for interactive sessions and
836 .Cm cs1
837 (Lower Effort)
838 for non-interactive sessions.
839 .It Cm KbdInteractiveAuthentication
840 Specifies whether to allow keyboard-interactive authentication.
841 The argument to this keyword must be
842 .Cm yes
843 or
844 .Cm no .
845 The default is to use whatever value
846 .Cm ChallengeResponseAuthentication
847 is set to
848 (by default
849 .Cm yes ) .
850 .It Cm KerberosAuthentication
851 Specifies whether the password provided by the user for
852 .Cm PasswordAuthentication
853 will be validated through the Kerberos KDC.
854 To use this option, the server needs a
855 Kerberos servtab which allows the verification of the KDC's identity.
856 The default is
857 .Cm no .
858 .It Cm KerberosGetAFSToken
859 If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
860 an AFS token before accessing the user's home directory.
861 The default is
862 .Cm no .
863 .It Cm KerberosOrLocalPasswd
864 If password authentication through Kerberos fails then
865 the password will be validated via any additional local mechanism
866 such as
867 .Pa /etc/passwd .
868 The default is
869 .Cm yes .
870 .It Cm KerberosTicketCleanup
871 Specifies whether to automatically destroy the user's ticket cache
872 file on logout.
873 The default is
874 .Cm yes .
875 .It Cm KexAlgorithms
876 Specifies the available KEX (Key Exchange) algorithms.
877 Multiple algorithms must be comma-separated.
878 Alternately if the specified value begins with a
879 .Sq +
880 character, then the specified methods will be appended to the default set
881 instead of replacing them.
882 If the specified value begins with a
883 .Sq -
884 character, then the specified methods (including wildcards) will be removed
885 from the default set instead of replacing them.
886 The supported algorithms are:
887 .Pp
888 .Bl -item -compact -offset indent
889 .It
890 curve25519-sha256
891 .It
892 curve25519-sha256@libssh.org
893 .It
894 diffie-hellman-group1-sha1
895 .It
896 diffie-hellman-group14-sha1
897 .It
898 diffie-hellman-group14-sha256
899 .It
900 diffie-hellman-group16-sha512
901 .It
902 diffie-hellman-group18-sha512
903 .It
904 diffie-hellman-group-exchange-sha1
905 .It
906 diffie-hellman-group-exchange-sha256
907 .It
908 ecdh-sha2-nistp256
909 .It
910 ecdh-sha2-nistp384
911 .It
912 ecdh-sha2-nistp521
913 .El
914 .Pp
915 The default is:
916 .Bd -literal -offset indent
917 curve25519-sha256,curve25519-sha256@libssh.org,
918 ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
919 diffie-hellman-group-exchange-sha256,
920 diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,
921 diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
922 .Ed
923 .Pp
924 The list of available key exchange algorithms may also be obtained using
925 .Qq ssh -Q kex .
926 .It Cm ListenAddress
927 Specifies the local addresses
928 .Xr sshd 8
929 should listen on.
930 The following forms may be used:
931 .Pp
932 .Bl -item -offset indent -compact
933 .It
934 .Cm ListenAddress
935 .Sm off
936 .Ar hostname | address
937 .Sm on
938 .Op Cm rdomain Ar domain
939 .It
940 .Cm ListenAddress
941 .Sm off
942 .Ar hostname : port
943 .Sm on
944 .Op Cm rdomain Ar domain
945 .It
946 .Cm ListenAddress
947 .Sm off
948 .Ar IPv4_address : port
949 .Sm on
950 .Op Cm rdomain Ar domain
951 .It
952 .Cm ListenAddress
953 .Sm off
954 .Oo Ar hostname | address Oc : Ar port
955 .Sm on
956 .Op Cm rdomain Ar domain
957 .El
958 .Pp
959 The optional
960 .Cm rdomain
961 qualifier requests
962 .Xr sshd 8
963 listen in an explicit routing domain.
964 If
965 .Ar port
966 is not specified,
967 sshd will listen on the address and all
968 .Cm Port
969 options specified.
970 The default is to listen on all local addresses on the current default
971 routing domain.
972 Multiple
973 .Cm ListenAddress
974 options are permitted.
975 For more information on routing domains, see
976 .Xr rdomain 4 .
977 .It Cm LoginGraceTime
978 The server disconnects after this time if the user has not
979 successfully logged in.
980 If the value is 0, there is no time limit.
981 The default is 120 seconds.
982 .It Cm LogLevel
983 Gives the verbosity level that is used when logging messages from
984 .Xr sshd 8 .
985 The possible values are:
986 QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
987 The default is INFO.
988 DEBUG and DEBUG1 are equivalent.
989 DEBUG2 and DEBUG3 each specify higher levels of debugging output.
990 Logging with a DEBUG level violates the privacy of users and is not recommended.
991 .It Cm MACs
992 Specifies the available MAC (message authentication code) algorithms.
993 The MAC algorithm is used for data integrity protection.
994 Multiple algorithms must be comma-separated.
995 If the specified value begins with a
996 .Sq +
997 character, then the specified algorithms will be appended to the default set
998 instead of replacing them.
999 If the specified value begins with a
1000 .Sq -
1001 character, then the specified algorithms (including wildcards) will be removed
1002 from the default set instead of replacing them.
1003 .Pp
1004 The algorithms that contain
1005 .Qq -etm
1006 calculate the MAC after encryption (encrypt-then-mac).
1007 These are considered safer and their use recommended.
1008 The supported MACs are:
1009 .Pp
1010 .Bl -item -compact -offset indent
1011 .It
1012 hmac-md5
1013 .It
1014 hmac-md5-96
1015 .It
1016 hmac-sha1
1017 .It
1018 hmac-sha1-96
1019 .It
1020 hmac-sha2-256
1021 .It
1022 hmac-sha2-512
1023 .It
1024 umac-64@openssh.com
1025 .It
1026 umac-128@openssh.com
1027 .It
1028 hmac-md5-etm@openssh.com
1029 .It
1030 hmac-md5-96-etm@openssh.com
1031 .It
1032 hmac-sha1-etm@openssh.com
1033 .It
1034 hmac-sha1-96-etm@openssh.com
1035 .It
1036 hmac-sha2-256-etm@openssh.com
1037 .It
1038 hmac-sha2-512-etm@openssh.com
1039 .It
1040 umac-64-etm@openssh.com
1041 .It
1042 umac-128-etm@openssh.com
1043 .El
1044 .Pp
1045 The default is:
1046 .Bd -literal -offset indent
1047 umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1048 hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
1049 hmac-sha1-etm@openssh.com,
1050 umac-64@openssh.com,umac-128@openssh.com,
1051 hmac-sha2-256,hmac-sha2-512,hmac-sha1
1052 .Ed
1053 .Pp
1054 The list of available MAC algorithms may also be obtained using
1055 .Qq ssh -Q mac .
1056 .It Cm Match
1057 Introduces a conditional block.
1058 If all of the criteria on the
1059 .Cm Match
1060 line are satisfied, the keywords on the following lines override those
1061 set in the global section of the config file, until either another
1062 .Cm Match
1063 line or the end of the file.
1064 If a keyword appears in multiple
1065 .Cm Match
1066 blocks that are satisfied, only the first instance of the keyword is
1067 applied.
1068 .Pp
1069 The arguments to
1070 .Cm Match
1071 are one or more criteria-pattern pairs or the single token
1072 .Cm All
1073 which matches all criteria.
1074 The available criteria are
1075 .Cm User ,
1076 .Cm Group ,
1077 .Cm Host ,
1078 .Cm LocalAddress ,
1079 .Cm LocalPort ,
1080 .Cm RDomain ,
1081 and
1082 .Cm Address
1083 (with
1084 .Cm RDomain
1085 representing the
1086 .Xr rdomain 4
1087 on which the connection was received).
1088 .Pp
1089 The match patterns may consist of single entries or comma-separated
1090 lists and may use the wildcard and negation operators described in the
1091 .Sx PATTERNS
1092 section of
1093 .Xr ssh_config 5 .
1094 .Pp
1095 The patterns in an
1096 .Cm Address
1097 criteria may additionally contain addresses to match in CIDR
1098 address/masklen format,
1099 such as 192.0.2.0/24 or 2001:db8::/32.
1100 Note that the mask length provided must be consistent with the address -
1101 it is an error to specify a mask length that is too long for the address
1102 or one with bits set in this host portion of the address.
1103 For example, 192.0.2.0/33 and 192.0.2.0/8, respectively.
1104 .Pp
1105 Only a subset of keywords may be used on the lines following a
1106 .Cm Match
1107 keyword.
1108 Available keywords are
1109 .Cm AcceptEnv ,
1110 .Cm AllowAgentForwarding ,
1111 .Cm AllowGroups ,
1112 .Cm AllowStreamLocalForwarding ,
1113 .Cm AllowTcpForwarding ,
1114 .Cm AllowUsers ,
1115 .Cm AuthenticationMethods ,
1116 .Cm AuthorizedKeysCommand ,
1117 .Cm AuthorizedKeysCommandUser ,
1118 .Cm AuthorizedKeysFile ,
1119 .Cm AuthorizedPrincipalsCommand ,
1120 .Cm AuthorizedPrincipalsCommandUser ,
1121 .Cm AuthorizedPrincipalsFile ,
1122 .Cm Banner ,
1123 .Cm ChrootDirectory ,
1124 .Cm ClientAliveCountMax ,
1125 .Cm ClientAliveInterval ,
1126 .Cm DenyGroups ,
1127 .Cm DenyUsers ,
1128 .Cm ForceCommand ,
1129 .Cm GatewayPorts ,
1130 .Cm GSSAPIAuthentication ,
1131 .Cm HostbasedAcceptedKeyTypes ,
1132 .Cm HostbasedAuthentication ,
1133 .Cm HostbasedUsesNameFromPacketOnly ,
1134 .Cm IPQoS ,
1135 .Cm KbdInteractiveAuthentication ,
1136 .Cm KerberosAuthentication ,
1137 .Cm LogLevel ,
1138 .Cm MaxAuthTries ,
1139 .Cm MaxSessions ,
1140 .Cm PasswordAuthentication ,
1141 .Cm PermitEmptyPasswords ,
1142 .Cm PermitListen ,
1143 .Cm PermitOpen ,
1144 .Cm PermitRootLogin ,
1145 .Cm PermitTTY ,
1146 .Cm PermitTunnel ,
1147 .Cm PermitUserRC ,
1148 .Cm PubkeyAcceptedKeyTypes ,
1149 .Cm PubkeyAuthentication ,
1150 .Cm RekeyLimit ,
1151 .Cm RevokedKeys ,
1152 .Cm RDomain ,
1153 .Cm SetEnv ,
1154 .Cm StreamLocalBindMask ,
1155 .Cm StreamLocalBindUnlink ,
1156 .Cm TrustedUserCAKeys ,
1157 .Cm X11DisplayOffset ,
1158 .Cm X11Forwarding
1159 and
1160 .Cm X11UseLocalHost .
1161 .It Cm MaxAuthTries
1162 Specifies the maximum number of authentication attempts permitted per
1163 connection.
1164 Once the number of failures reaches half this value,
1165 additional failures are logged.
1166 The default is 6.
1167 .It Cm MaxSessions
1168 Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1169 sessions permitted per network connection.
1170 Multiple sessions may be established by clients that support connection
1171 multiplexing.
1172 Setting
1173 .Cm MaxSessions
1174 to 1 will effectively disable session multiplexing, whereas setting it to 0
1175 will prevent all shell, login and subsystem sessions while still permitting
1176 forwarding.
1177 The default is 10.
1178 .It Cm MaxStartups
1179 Specifies the maximum number of concurrent unauthenticated connections to the
1180 SSH daemon.
1181 Additional connections will be dropped until authentication succeeds or the
1182 .Cm LoginGraceTime
1183 expires for a connection.
1184 The default is 10:30:100.
1185 .Pp
1186 Alternatively, random early drop can be enabled by specifying
1187 the three colon separated values
1188 start:rate:full (e.g. "10:30:60").
1189 .Xr sshd 8
1190 will refuse connection attempts with a probability of rate/100 (30%)
1191 if there are currently start (10) unauthenticated connections.
1192 The probability increases linearly and all connection attempts
1193 are refused if the number of unauthenticated connections reaches full (60).
1194 .It Cm PasswordAuthentication
1195 Specifies whether password authentication is allowed.
1196 The default is
1197 .Cm yes .
1198 .It Cm PermitEmptyPasswords
1199 When password authentication is allowed, it specifies whether the
1200 server allows login to accounts with empty password strings.
1201 The default is
1202 .Cm no .
1203 .It Cm PermitListen
1204 Specifies the addresses/ports on which a remote TCP port forwarding may listen.
1205 The listen specification must be one of the following forms:
1206 .Pp
1207 .Bl -item -offset indent -compact
1208 .It
1209 .Cm PermitListen
1210 .Sm off
1211 .Ar port
1212 .Sm on
1213 .It
1214 .Cm PermitListen
1215 .Sm off
1216 .Ar host : port
1217 .Sm on
1218 .El
1219 .Pp
1220 Multiple permissions may be specified by separating them with whitespace.
1221 An argument of
1222 .Cm any
1223 can be used to remove all restrictions and permit any listen requests.
1224 An argument of
1225 .Cm none
1226 can be used to prohibit all listen requests.
1227 The host name may contain wildcards as described in the PATTERNS section in
1228 .Xr ssh_config 5 .
1229 The wildcard
1230 .Sq *
1231 can also be used in place of a port number to allow all ports.
1232 By default all port forwarding listen requests are permitted.
1233 Note that the
1234 .Cm GatewayPorts
1235 option may further restrict which addresses may be listened on.
1236 Note also that
1237 .Xr ssh 1
1238 will request a listen host of
1239 .Dq localhost
1240 if no listen host was specifically requested, and this name is
1241 treated differently to explicit localhost addresses of
1242 .Dq 127.0.0.1
1243 and
1244 .Dq ::1 .
1245 .It Cm PermitOpen
1246 Specifies the destinations to which TCP port forwarding is permitted.
1247 The forwarding specification must be one of the following forms:
1248 .Pp
1249 .Bl -item -offset indent -compact
1250 .It
1251 .Cm PermitOpen
1252 .Sm off
1253 .Ar host : port
1254 .Sm on
1255 .It
1256 .Cm PermitOpen
1257 .Sm off
1258 .Ar IPv4_addr : port
1259 .Sm on
1260 .It
1261 .Cm PermitOpen
1262 .Sm off
1263 .Ar \&[ IPv6_addr \&] : port
1264 .Sm on
1265 .El
1266 .Pp
1267 Multiple forwards may be specified by separating them with whitespace.
1268 An argument of
1269 .Cm any
1270 can be used to remove all restrictions and permit any forwarding requests.
1271 An argument of
1272 .Cm none
1273 can be used to prohibit all forwarding requests.
1274 The wildcard
1275 .Sq *
1276 can be used for host or port to allow all hosts or ports, respectively.
1277 By default all port forwarding requests are permitted.
1278 .It Cm PermitRootLogin
1279 Specifies whether root can log in using
1280 .Xr ssh 1 .
1281 The argument must be
1282 .Cm yes ,
1283 .Cm prohibit-password ,
1284 .Cm forced-commands-only ,
1285 or
1286 .Cm no .
1287 The default is
1288 .Cm prohibit-password .
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 UseDNS
1587 Specifies whether
1588 .Xr sshd 8
1589 should look up the remote host name, and to check that
1590 the resolved host name for the remote IP address maps back to the
1591 very same IP address.
1592 .Pp
1593 If this option is set to
1594 .Cm no
1595 (the default) then only addresses and not host names may be used in
1596 .Pa ~/.ssh/authorized_keys
1597 .Cm from
1598 and
1599 .Nm
1600 .Cm Match
1601 .Cm Host
1602 directives.
1603 .It Cm UsePAM
1604 Enables the Pluggable Authentication Module interface.
1605 If set to
1606 .Cm yes
1607 this will enable PAM authentication using
1608 .Cm ChallengeResponseAuthentication
1609 and
1610 .Cm PasswordAuthentication
1611 in addition to PAM account and session module processing for all
1612 authentication types.
1613 .Pp
1614 Because PAM challenge-response authentication usually serves an equivalent
1615 role to password authentication, you should disable either
1616 .Cm PasswordAuthentication
1617 or
1618 .Cm ChallengeResponseAuthentication.
1619 .Pp
1620 If
1621 .Cm UsePAM
1622 is enabled, you will not be able to run
1623 .Xr sshd 8
1624 as a non-root user.
1625 The default is
1626 .Cm no .
1627 .It Cm VersionAddendum
1628 Optionally specifies additional text to append to the SSH protocol banner
1629 sent by the server upon connection.
1630 The default is
1631 .Cm none .
1632 .It Cm X11DisplayOffset
1633 Specifies the first display number available for
1634 .Xr sshd 8 Ns 's
1635 X11 forwarding.
1636 This prevents sshd from interfering with real X11 servers.
1637 The default is 10.
1638 .It Cm X11Forwarding
1639 Specifies whether X11 forwarding is permitted.
1640 The argument must be
1641 .Cm yes
1642 or
1643 .Cm no .
1644 The default is
1645 .Cm no .
1646 .Pp
1647 When X11 forwarding is enabled, there may be additional exposure to
1648 the server and to client displays if the
1649 .Xr sshd 8
1650 proxy display is configured to listen on the wildcard address (see
1651 .Cm X11UseLocalhost ) ,
1652 though this is not the default.
1653 Additionally, the authentication spoofing and authentication data
1654 verification and substitution occur on the client side.
1655 The security risk of using X11 forwarding is that the client's X11
1656 display server may be exposed to attack when the SSH client requests
1657 forwarding (see the warnings for
1658 .Cm ForwardX11
1659 in
1660 .Xr ssh_config 5 ) .
1661 A system administrator may have a stance in which they want to
1662 protect clients that may expose themselves to attack by unwittingly
1663 requesting X11 forwarding, which can warrant a
1664 .Cm no
1665 setting.
1666 .Pp
1667 Note that disabling X11 forwarding does not prevent users from
1668 forwarding X11 traffic, as users can always install their own forwarders.
1669 .It Cm X11UseLocalhost
1670 Specifies whether
1671 .Xr sshd 8
1672 should bind the X11 forwarding server to the loopback address or to
1673 the wildcard address.
1674 By default,
1675 sshd binds the forwarding server to the loopback address and sets the
1676 hostname part of the
1677 .Ev DISPLAY
1678 environment variable to
1679 .Cm localhost .
1680 This prevents remote hosts from connecting to the proxy display.
1681 However, some older X11 clients may not function with this
1682 configuration.
1683 .Cm X11UseLocalhost
1684 may be set to
1685 .Cm no
1686 to specify that the forwarding server should be bound to the wildcard
1687 address.
1688 The argument must be
1689 .Cm yes
1690 or
1691 .Cm no .
1692 The default is
1693 .Cm yes .
1694 .It Cm XAuthLocation
1695 Specifies the full pathname of the
1696 .Xr xauth 1
1697 program, or
1698 .Cm none
1699 to not use one.
1700 The default is
1701 .Pa /usr/X11R6/bin/xauth .
1702 .El
1703 .Sh TIME FORMATS
1704 .Xr sshd 8
1705 command-line arguments and configuration file options that specify time
1706 may be expressed using a sequence of the form:
1707 .Sm off
1708 .Ar time Op Ar qualifier ,
1709 .Sm on
1710 where
1711 .Ar time
1712 is a positive integer value and
1713 .Ar qualifier
1714 is one of the following:
1715 .Pp
1716 .Bl -tag -width Ds -compact -offset indent
1717 .It Aq Cm none
1718 seconds
1719 .It Cm s | Cm S
1720 seconds
1721 .It Cm m | Cm M
1722 minutes
1723 .It Cm h | Cm H
1724 hours
1725 .It Cm d | Cm D
1726 days
1727 .It Cm w | Cm W
1728 weeks
1729 .El
1730 .Pp
1731 Each member of the sequence is added together to calculate
1732 the total time value.
1733 .Pp
1734 Time format examples:
1735 .Pp
1736 .Bl -tag -width Ds -compact -offset indent
1737 .It 600
1738 600 seconds (10 minutes)
1739 .It 10m
1740 10 minutes
1741 .It 1h30m
1742 1 hour 30 minutes (90 minutes)
1743 .El
1744 .Sh TOKENS
1745 Arguments to some keywords can make use of tokens,
1746 which are expanded at runtime:
1747 .Pp
1748 .Bl -tag -width XXXX -offset indent -compact
1749 .It %%
1750 A literal
1751 .Sq % .
1752 .It \&%D
1753 The routing domain in which the incoming connection was received.
1754 .It %F
1755 The fingerprint of the CA key.
1756 .It %f
1757 The fingerprint of the key or certificate.
1758 .It %h
1759 The home directory of the user.
1760 .It %i
1761 The key ID in the certificate.
1762 .It %K
1763 The base64-encoded CA key.
1764 .It %k
1765 The base64-encoded key or certificate for authentication.
1766 .It %s
1767 The serial number of the certificate.
1768 .It \&%T
1769 The type of the CA key.
1770 .It %t
1771 The key or certificate type.
1772 .It \&%U
1773 The numeric user ID of the target user.
1774 .It %u
1775 The username.
1776 .El
1777 .Pp
1778 .Cm AuthorizedKeysCommand
1779 accepts the tokens %%, %f, %h, %k, %t, %U, and %u.
1780 .Pp
1781 .Cm AuthorizedKeysFile
1782 accepts the tokens %%, %h, %U, and %u.
1783 .Pp
1784 .Cm AuthorizedPrincipalsCommand
1785 accepts the tokens %%, %F, %f, %h, %i, %K, %k, %s, %T, %t, %U, and %u.
1786 .Pp
1787 .Cm AuthorizedPrincipalsFile
1788 accepts the tokens %%, %h, %U, and %u.
1789 .Pp
1790 .Cm ChrootDirectory
1791 accepts the tokens %%, %h, %U, and %u.
1792 .Pp
1793 .Cm RoutingDomain
1794 accepts the token %D.
1795 .Sh FILES
1796 .Bl -tag -width Ds
1797 .It Pa /etc/ssh/sshd_config
1798 Contains configuration data for
1799 .Xr sshd 8 .
1800 This file should be writable by root only, but it is recommended
1801 (though not necessary) that it be world-readable.
1802 .El
1803 .Sh SEE ALSO
1804 .Xr sftp-server 8 ,
1805 .Xr sshd 8
1806 .Sh AUTHORS
1807 .An -nosplit
1808 OpenSSH is a derivative of the original and free
1809 ssh 1.2.12 release by
1810 .An Tatu Ylonen .
1811 .An Aaron Campbell , Bob Beck , Markus Friedl , Niels Provos ,
1812 .An Theo de Raadt
1813 and
1814 .An Dug Song
1815 removed many bugs, re-added newer features and
1816 created OpenSSH.
1817 .An Markus Friedl
1818 contributed the support for SSH protocol versions 1.5 and 2.0.
1819 .An Niels Provos
1820 and
1821 .An Markus Friedl
1822 contributed support for privilege separation.