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