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