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