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