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