Import OpenSSH-5.6p1.
[dragonfly.git] / crypto / openssh / sshd_config.5
1 .\"  -*- nroff -*-
2 .\"
3 .\" Author: Tatu Ylonen <ylo@cs.hut.fi>
4 .\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
5 .\"                    All rights reserved
6 .\"
7 .\" As far as I am concerned, the code I have written for this software
8 .\" can be used freely for any purpose.  Any derived versions of this
9 .\" software must be clearly marked as such, and if the derived work is
10 .\" incompatible with the protocol description in the RFC file, it must be
11 .\" called by a name other than "ssh" or "Secure Shell".
12 .\"
13 .\" Copyright (c) 1999,2000 Markus Friedl.  All rights reserved.
14 .\" Copyright (c) 1999 Aaron Campbell.  All rights reserved.
15 .\" Copyright (c) 1999 Theo de Raadt.  All rights reserved.
16 .\"
17 .\" Redistribution and use in source and binary forms, with or without
18 .\" modification, are permitted provided that the following conditions
19 .\" are met:
20 .\" 1. Redistributions of source code must retain the above copyright
21 .\"    notice, this list of conditions and the following disclaimer.
22 .\" 2. Redistributions in binary form must reproduce the above copyright
23 .\"    notice, this list of conditions and the following disclaimer in the
24 .\"    documentation and/or other materials provided with the distribution.
25 .\"
26 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
27 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
28 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
29 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
30 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
31 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 .\"
37 .\" $OpenBSD: sshd_config.5,v 1.125 2010/06/30 07:28:34 jmc Exp $
38 .Dd $Mdocdate: June 30 2010 $
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.
75 Variables are specified by name, which may contain the wildcard characters
76 .Ql *
77 and
78 .Ql \&? .
79 Multiple environment variables may be separated by whitespace or spread
80 across multiple
81 .Cm AcceptEnv
82 directives.
83 Be warned that some environment variables could be used to bypass restricted
84 user environments.
85 For this reason, care should be taken in the use of this directive.
86 The default is not to accept any environment variables.
87 .It Cm AddressFamily
88 Specifies which address family should be used by
89 .Xr sshd 8 .
90 Valid arguments are
91 .Dq any ,
92 .Dq inet
93 (use IPv4 only), or
94 .Dq inet6
95 (use IPv6 only).
96 The default is
97 .Dq any .
98 .It Cm AllowAgentForwarding
99 Specifies whether
100 .Xr ssh-agent 1
101 forwarding is permitted.
102 The default is
103 .Dq yes .
104 Note that disabling agent forwarding does not improve security
105 unless users are also denied shell access, as they can always install
106 their own forwarders.
107 .It Cm AllowGroups
108 This keyword can be followed by a list of group name patterns, separated
109 by spaces.
110 If specified, login is allowed only for users whose primary
111 group or supplementary group list matches one of the patterns.
112 Only group names are valid; a numerical group ID is not recognized.
113 By default, login is allowed for all groups.
114 The allow/deny directives are processed in the following order:
115 .Cm DenyUsers ,
116 .Cm AllowUsers ,
117 .Cm DenyGroups ,
118 and finally
119 .Cm AllowGroups .
120 .Pp
121 See
122 .Sx PATTERNS
123 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 default is
129 .Dq yes .
130 Note that disabling TCP forwarding does not improve security unless
131 users are also denied shell access, as they can always install their
132 own forwarders.
133 .It Cm AllowUsers
134 This keyword can be followed by a list of user name patterns, separated
135 by spaces.
136 If specified, login is allowed only for user names that
137 match one of the patterns.
138 Only user names are valid; a numerical user ID is not recognized.
139 By default, login is allowed for all users.
140 If the pattern takes the form USER@HOST then USER and HOST
141 are separately checked, restricting logins to particular
142 users from particular hosts.
143 The allow/deny directives are processed in the following order:
144 .Cm DenyUsers ,
145 .Cm AllowUsers ,
146 .Cm DenyGroups ,
147 and finally
148 .Cm AllowGroups .
149 .Pp
150 See
151 .Sx PATTERNS
152 in
153 .Xr ssh_config 5
154 for more information on patterns.
155 .It Cm AuthorizedKeysFile
156 Specifies the file that contains the public keys that can be used
157 for user authentication.
158 The format is described in the
159 .Sx AUTHORIZED_KEYS FILE FORMAT
160 section of
161 .Xr sshd 8 .
162 .Cm AuthorizedKeysFile
163 may contain tokens of the form %T which are substituted during connection
164 setup.
165 The following tokens are defined: %% is replaced by a literal '%',
166 %h is replaced by the home directory of the user being authenticated, and
167 %u is replaced by the username of that user.
168 After expansion,
169 .Cm AuthorizedKeysFile
170 is taken to be an absolute path or one relative to the user's home
171 directory.
172 The default is
173 .Dq .ssh/authorized_keys .
174 .It Cm AuthorizedPrincipalsFile
175 Specifies a file that lists principal names that are accepted for
176 certificate authentication.
177 When using certificates signed by a key listed in
178 .Cm TrustedUserCAKeys ,
179 this file lists names, one of which must appear in the certificate for it
180 to be accepted for authentication.
181 Names are listed one per line preceded by key options (as described
182 in
183 .Sx AUTHORIZED_KEYS FILE FORMAT
184 in
185 .Xr sshd 8 ) .
186 Empty lines and comments starting with
187 .Ql #
188 are ignored.
189 .Pp
190 .Cm AuthorizedPrincipalsFile
191 may contain tokens of the form %T which are substituted during connection
192 setup.
193 The following tokens are defined: %% is replaced by a literal '%',
194 %h is replaced by the home directory of the user being authenticated, and
195 %u is replaced by the username of that user.
196 After expansion,
197 .Cm AuthorizedPrincipalsFile
198 is taken to be an absolute path or one relative to the user's home
199 directory.
200 .Pp
201 The default is not to use a principals file \(en in this case, the username
202 of the user must appear in a certificate's principals list for it to be
203 accepted.
204 Note that
205 .Cm AuthorizedPrincipalsFile
206 is only used when authentication proceeds using a CA listed in
207 .Cm TrustedUserCAKeys
208 and is not consulted for certification authorities trusted via
209 .Pa ~/.ssh/authorized_keys ,
210 though the
211 .Cm principals=
212 key option offers a similar facility (see
213 .Xr sshd 8
214 for details).
215 .It Cm Banner
216 The contents of the specified file are sent to the remote user before
217 authentication is allowed.
218 If the argument is
219 .Dq none
220 then no banner is displayed.
221 This option is only available for protocol version 2.
222 By default, no banner is displayed.
223 .It Cm ChallengeResponseAuthentication
224 Specifies whether challenge-response authentication is allowed (e.g. via
225 PAM or though authentication styles supported in
226 .Xr login.conf 5 )
227 The default is
228 .Dq yes .
229 .It Cm ChrootDirectory
230 Specifies the pathname of a directory to
231 .Xr chroot 2
232 to after authentication.
233 All components of the pathname must be root-owned directories that are
234 not writable by any other user or group.
235 After the chroot,
236 .Xr sshd 8
237 changes the working directory to the user's home directory.
238 .Pp
239 The pathname may contain the following tokens that are expanded at runtime once
240 the connecting user has been authenticated: %% is replaced by a literal '%',
241 %h is replaced by the home directory of the user being authenticated, and
242 %u is replaced by the username of that user.
243 .Pp
244 The
245 .Cm ChrootDirectory
246 must contain the necessary files and directories to support the
247 user's session.
248 For an interactive session this requires at least a shell, typically
249 .Xr sh 1 ,
250 and basic
251 .Pa /dev
252 nodes such as
253 .Xr null 4 ,
254 .Xr zero 4 ,
255 .Xr stdin 4 ,
256 .Xr stdout 4 ,
257 .Xr stderr 4 ,
258 .Xr arandom 4
259 and
260 .Xr tty 4
261 devices.
262 For file transfer sessions using
263 .Dq sftp ,
264 no additional configuration of the environment is necessary if the
265 in-process sftp server is used,
266 though sessions which use logging do require
267 .Pa /dev/log
268 inside the chroot directory (see
269 .Xr sftp-server 8
270 for details).
271 .Pp
272 The default is not to
273 .Xr chroot 2 .
274 .It Cm Ciphers
275 Specifies the ciphers allowed for protocol version 2.
276 Multiple ciphers must be comma-separated.
277 The supported ciphers are
278 .Dq 3des-cbc ,
279 .Dq aes128-cbc ,
280 .Dq aes192-cbc ,
281 .Dq aes256-cbc ,
282 .Dq aes128-ctr ,
283 .Dq aes192-ctr ,
284 .Dq aes256-ctr ,
285 .Dq arcfour128 ,
286 .Dq arcfour256 ,
287 .Dq arcfour ,
288 .Dq blowfish-cbc ,
289 and
290 .Dq cast128-cbc .
291 The default is:
292 .Bd -literal -offset 3n
293 aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,
294 aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,
295 aes256-cbc,arcfour
296 .Ed
297 .It Cm ClientAliveCountMax
298 Sets the number of client alive messages (see below) which may be
299 sent without
300 .Xr sshd 8
301 receiving any messages back from the client.
302 If this threshold is reached while client alive messages are being sent,
303 sshd will disconnect the client, terminating the session.
304 It is important to note that the use of client alive messages is very
305 different from
306 .Cm TCPKeepAlive
307 (below).
308 The client alive messages are sent through the encrypted channel
309 and therefore will not be spoofable.
310 The TCP keepalive option enabled by
311 .Cm TCPKeepAlive
312 is spoofable.
313 The client alive mechanism is valuable when the client or
314 server depend on knowing when a connection has become inactive.
315 .Pp
316 The default value is 3.
317 If
318 .Cm ClientAliveInterval
319 (see below) is set to 15, and
320 .Cm ClientAliveCountMax
321 is left at the default, unresponsive SSH clients
322 will be disconnected after approximately 45 seconds.
323 This option applies to protocol version 2 only.
324 .It Cm ClientAliveInterval
325 Sets a timeout interval in seconds after which if no data has been received
326 from the client,
327 .Xr sshd 8
328 will send a message through the encrypted
329 channel to request a response from the client.
330 The default
331 is 0, indicating that these messages will not be sent to the client.
332 This option applies to protocol version 2 only.
333 .It Cm Compression
334 Specifies whether compression is allowed, or delayed until
335 the user has authenticated successfully.
336 The argument must be
337 .Dq yes ,
338 .Dq delayed ,
339 or
340 .Dq no .
341 The default is
342 .Dq delayed .
343 .It Cm DenyGroups
344 This keyword can be followed by a list of group name patterns, separated
345 by spaces.
346 Login is disallowed for users whose primary group or supplementary
347 group list matches one of the patterns.
348 Only group names are valid; a numerical group ID is not recognized.
349 By default, login is allowed for all groups.
350 The allow/deny directives are processed in the following order:
351 .Cm DenyUsers ,
352 .Cm AllowUsers ,
353 .Cm DenyGroups ,
354 and finally
355 .Cm AllowGroups .
356 .Pp
357 See
358 .Sx PATTERNS
359 in
360 .Xr ssh_config 5
361 for more information on patterns.
362 .It Cm DenyUsers
363 This keyword can be followed by a list of user name patterns, separated
364 by spaces.
365 Login is disallowed for user names that match one of the patterns.
366 Only user names are valid; a numerical user ID is not recognized.
367 By default, login is allowed for all users.
368 If the pattern takes the form USER@HOST then USER and HOST
369 are separately checked, restricting logins to particular
370 users from particular hosts.
371 The allow/deny directives are processed in the following order:
372 .Cm DenyUsers ,
373 .Cm AllowUsers ,
374 .Cm DenyGroups ,
375 and finally
376 .Cm AllowGroups .
377 .Pp
378 See
379 .Sx PATTERNS
380 in
381 .Xr ssh_config 5
382 for more information on patterns.
383 .It Cm ForceCommand
384 Forces the execution of the command specified by
385 .Cm ForceCommand ,
386 ignoring any command supplied by the client and
387 .Pa ~/.ssh/rc
388 if present.
389 The command is invoked by using the user's login shell with the -c option.
390 This applies to shell, command, or subsystem execution.
391 It is most useful inside a
392 .Cm Match
393 block.
394 The command originally supplied by the client is available in the
395 .Ev SSH_ORIGINAL_COMMAND
396 environment variable.
397 Specifying a command of
398 .Dq internal-sftp
399 will force the use of an in-process sftp server that requires no support
400 files when used with
401 .Cm ChrootDirectory .
402 .It Cm GatewayPorts
403 Specifies whether remote hosts are allowed to connect to ports
404 forwarded for the client.
405 By default,
406 .Xr sshd 8
407 binds remote port forwardings to the loopback address.
408 This prevents other remote hosts from connecting to forwarded ports.
409 .Cm GatewayPorts
410 can be used to specify that sshd
411 should allow remote port forwardings to bind to non-loopback addresses, thus
412 allowing other hosts to connect.
413 The argument may be
414 .Dq no
415 to force remote port forwardings to be available to the local host only,
416 .Dq yes
417 to force remote port forwardings to bind to the wildcard address, or
418 .Dq clientspecified
419 to allow the client to select the address to which the forwarding is bound.
420 The default is
421 .Dq no .
422 .It Cm GSSAPIAuthentication
423 Specifies whether user authentication based on GSSAPI is allowed.
424 The default is
425 .Dq no .
426 Note that this option applies to protocol version 2 only.
427 .It Cm GSSAPICleanupCredentials
428 Specifies whether to automatically destroy the user's credentials cache
429 on logout.
430 The default is
431 .Dq yes .
432 Note that this option applies to protocol version 2 only.
433 .It Cm HostbasedAuthentication
434 Specifies whether rhosts or /etc/hosts.equiv authentication together
435 with successful public key client host authentication is allowed
436 (host-based authentication).
437 This option is similar to
438 .Cm RhostsRSAAuthentication
439 and applies to protocol version 2 only.
440 The default is
441 .Dq no .
442 .It Cm HostbasedUsesNameFromPacketOnly
443 Specifies whether or not the server will attempt to perform a reverse
444 name lookup when matching the name in the
445 .Pa ~/.shosts ,
446 .Pa ~/.rhosts ,
447 and
448 .Pa /etc/hosts.equiv
449 files during
450 .Cm HostbasedAuthentication .
451 A setting of
452 .Dq yes
453 means that
454 .Xr sshd 8
455 uses the name supplied by the client rather than
456 attempting to resolve the name from the TCP connection itself.
457 The default is
458 .Dq no .
459 .It Cm HostCertificate
460 Specifies a file containing a public host certificate.
461 The certificate's public key must match a private host key already specified
462 by
463 .Cm HostKey .
464 The default behaviour of
465 .Xr sshd 8
466 is not to load any certificates.
467 .It Cm HostKey
468 Specifies a file containing a private host key
469 used by SSH.
470 The default is
471 .Pa /etc/ssh/ssh_host_key
472 for protocol version 1, and
473 .Pa /etc/ssh/ssh_host_rsa_key
474 and
475 .Pa /etc/ssh/ssh_host_dsa_key
476 for protocol version 2.
477 Note that
478 .Xr sshd 8
479 will refuse to use a file if it is group/world-accessible.
480 It is possible to have multiple host key files.
481 .Dq rsa1
482 keys are used for version 1 and
483 .Dq dsa
484 or
485 .Dq rsa
486 are used for version 2 of the SSH protocol.
487 .It Cm IgnoreRhosts
488 Specifies that
489 .Pa .rhosts
490 and
491 .Pa .shosts
492 files will not be used in
493 .Cm RhostsRSAAuthentication
494 or
495 .Cm HostbasedAuthentication .
496 .Pp
497 .Pa /etc/hosts.equiv
498 and
499 .Pa /etc/shosts.equiv
500 are still used.
501 The default is
502 .Dq yes .
503 .It Cm IgnoreUserKnownHosts
504 Specifies whether
505 .Xr sshd 8
506 should ignore the user's
507 .Pa ~/.ssh/known_hosts
508 during
509 .Cm RhostsRSAAuthentication
510 or
511 .Cm HostbasedAuthentication .
512 The default is
513 .Dq no .
514 .It Cm KerberosAuthentication
515 Specifies whether the password provided by the user for
516 .Cm PasswordAuthentication
517 will be validated through the Kerberos KDC.
518 To use this option, the server needs a
519 Kerberos servtab which allows the verification of the KDC's identity.
520 The default is
521 .Dq no .
522 .It Cm KerberosGetAFSToken
523 If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
524 an AFS token before accessing the user's home directory.
525 The default is
526 .Dq no .
527 .It Cm KerberosOrLocalPasswd
528 If password authentication through Kerberos fails then
529 the password will be validated via any additional local mechanism
530 such as
531 .Pa /etc/passwd .
532 The default is
533 .Dq yes .
534 .It Cm KerberosTicketCleanup
535 Specifies whether to automatically destroy the user's ticket cache
536 file on logout.
537 The default is
538 .Dq yes .
539 .It Cm KeyRegenerationInterval
540 In protocol version 1, the ephemeral server key is automatically regenerated
541 after this many seconds (if it has been used).
542 The purpose of regeneration is to prevent
543 decrypting captured sessions by later breaking into the machine and
544 stealing the keys.
545 The key is never stored anywhere.
546 If the value is 0, the key is never regenerated.
547 The default is 3600 (seconds).
548 .It Cm ListenAddress
549 Specifies the local addresses
550 .Xr sshd 8
551 should listen on.
552 The following forms may be used:
553 .Pp
554 .Bl -item -offset indent -compact
555 .It
556 .Cm ListenAddress
557 .Sm off
558 .Ar host No | Ar IPv4_addr No | Ar IPv6_addr
559 .Sm on
560 .It
561 .Cm ListenAddress
562 .Sm off
563 .Ar host No | Ar IPv4_addr No : Ar port
564 .Sm on
565 .It
566 .Cm ListenAddress
567 .Sm off
568 .Oo
569 .Ar host No | Ar IPv6_addr Oc : Ar port
570 .Sm on
571 .El
572 .Pp
573 If
574 .Ar port
575 is not specified,
576 sshd will listen on the address and all prior
577 .Cm Port
578 options specified.
579 The default is to listen on all local addresses.
580 Multiple
581 .Cm ListenAddress
582 options are permitted.
583 Additionally, any
584 .Cm Port
585 options must precede this option for non-port qualified addresses.
586 .It Cm LoginGraceTime
587 The server disconnects after this time if the user has not
588 successfully logged in.
589 If the value is 0, there is no time limit.
590 The default is 120 seconds.
591 .It Cm LogLevel
592 Gives the verbosity level that is used when logging messages from
593 .Xr sshd 8 .
594 The possible values are:
595 QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
596 The default is INFO.
597 DEBUG and DEBUG1 are equivalent.
598 DEBUG2 and DEBUG3 each specify higher levels of debugging output.
599 Logging with a DEBUG level violates the privacy of users and is not recommended.
600 .It Cm MACs
601 Specifies the available MAC (message authentication code) algorithms.
602 The MAC algorithm is used in protocol version 2
603 for data integrity protection.
604 Multiple algorithms must be comma-separated.
605 The default is:
606 .Bd -literal -offset indent
607 hmac-md5,hmac-sha1,umac-64@openssh.com,
608 hmac-ripemd160,hmac-sha1-96,hmac-md5-96
609 .Ed
610 .It Cm Match
611 Introduces a conditional block.
612 If all of the criteria on the
613 .Cm Match
614 line are satisfied, the keywords on the following lines override those
615 set in the global section of the config file, until either another
616 .Cm Match
617 line or the end of the file.
618 .Pp
619 The arguments to
620 .Cm Match
621 are one or more criteria-pattern pairs.
622 The available criteria are
623 .Cm User ,
624 .Cm Group ,
625 .Cm Host ,
626 and
627 .Cm Address .
628 The match patterns may consist of single entries or comma-separated
629 lists and may use the wildcard and negation operators described in the
630 .Sx PATTERNS
631 section of
632 .Xr ssh_config 5 .
633 .Pp
634 The patterns in an
635 .Cm Address
636 criteria may additionally contain addresses to match in CIDR
637 address/masklen format, e.g.\&
638 .Dq 192.0.2.0/24
639 or
640 .Dq 3ffe:ffff::/32 .
641 Note that the mask length provided must be consistent with the address -
642 it is an error to specify a mask length that is too long for the address
643 or one with bits set in this host portion of the address.
644 For example,
645 .Dq 192.0.2.0/33
646 and
647 .Dq 192.0.2.0/8
648 respectively.
649 .Pp
650 Only a subset of keywords may be used on the lines following a
651 .Cm Match
652 keyword.
653 Available keywords are
654 .Cm AllowAgentForwarding ,
655 .Cm AllowTcpForwarding ,
656 .Cm AuthorizedKeysFile ,
657 .Cm AuthorizedPrincipalsFile ,
658 .Cm Banner ,
659 .Cm ChrootDirectory ,
660 .Cm ForceCommand ,
661 .Cm GatewayPorts ,
662 .Cm GSSAPIAuthentication ,
663 .Cm HostbasedAuthentication ,
664 .Cm HostbasedUsesNameFromPacketOnly ,
665 .Cm KbdInteractiveAuthentication ,
666 .Cm KerberosAuthentication ,
667 .Cm MaxAuthTries ,
668 .Cm MaxSessions ,
669 .Cm PasswordAuthentication ,
670 .Cm PermitEmptyPasswords ,
671 .Cm PermitOpen ,
672 .Cm PermitRootLogin ,
673 .Cm PermitTunnel ,
674 .Cm PubkeyAuthentication ,
675 .Cm RhostsRSAAuthentication ,
676 .Cm RSAAuthentication ,
677 .Cm X11DisplayOffset ,
678 .Cm X11Forwarding
679 and
680 .Cm X11UseLocalHost .
681 .It Cm MaxAuthTries
682 Specifies the maximum number of authentication attempts permitted per
683 connection.
684 Once the number of failures reaches half this value,
685 additional failures are logged.
686 The default is 6.
687 .It Cm MaxSessions
688 Specifies the maximum number of open sessions permitted per network connection.
689 The default is 10.
690 .It Cm MaxStartups
691 Specifies the maximum number of concurrent unauthenticated connections to the
692 SSH daemon.
693 Additional connections will be dropped until authentication succeeds or the
694 .Cm LoginGraceTime
695 expires for a connection.
696 The default is 10.
697 .Pp
698 Alternatively, random early drop can be enabled by specifying
699 the three colon separated values
700 .Dq start:rate:full
701 (e.g. "10:30:60").
702 .Xr sshd 8
703 will refuse connection attempts with a probability of
704 .Dq rate/100
705 (30%)
706 if there are currently
707 .Dq start
708 (10)
709 unauthenticated connections.
710 The probability increases linearly and all connection attempts
711 are refused if the number of unauthenticated connections reaches
712 .Dq full
713 (60).
714 .It Cm PasswordAuthentication
715 Specifies whether password authentication is allowed.
716 The default is
717 .Dq yes .
718 .It Cm PermitEmptyPasswords
719 When password authentication is allowed, it specifies whether the
720 server allows login to accounts with empty password strings.
721 The default is
722 .Dq no .
723 .It Cm PermitOpen
724 Specifies the destinations to which TCP port forwarding is permitted.
725 The forwarding specification must be one of the following forms:
726 .Pp
727 .Bl -item -offset indent -compact
728 .It
729 .Cm PermitOpen
730 .Sm off
731 .Ar host : port
732 .Sm on
733 .It
734 .Cm PermitOpen
735 .Sm off
736 .Ar IPv4_addr : port
737 .Sm on
738 .It
739 .Cm PermitOpen
740 .Sm off
741 .Ar \&[ IPv6_addr \&] : port
742 .Sm on
743 .El
744 .Pp
745 Multiple forwards may be specified by separating them with whitespace.
746 An argument of
747 .Dq any
748 can be used to remove all restrictions and permit any forwarding requests.
749 By default all port forwarding requests are permitted.
750 .It Cm PermitRootLogin
751 Specifies whether root can log in using
752 .Xr ssh 1 .
753 The argument must be
754 .Dq yes ,
755 .Dq without-password ,
756 .Dq forced-commands-only ,
757 or
758 .Dq no .
759 The default is
760 .Dq yes .
761 .Pp
762 If this option is set to
763 .Dq without-password ,
764 password authentication is disabled for root.
765 .Pp
766 If this option is set to
767 .Dq forced-commands-only ,
768 root login with public key authentication will be allowed,
769 but only if the
770 .Ar command
771 option has been specified
772 (which may be useful for taking remote backups even if root login is
773 normally not allowed).
774 All other authentication methods are disabled for root.
775 .Pp
776 If this option is set to
777 .Dq no ,
778 root is not allowed to log in.
779 .It Cm PermitTunnel
780 Specifies whether
781 .Xr tun 4
782 device forwarding is allowed.
783 The argument must be
784 .Dq yes ,
785 .Dq point-to-point
786 (layer 3),
787 .Dq ethernet
788 (layer 2), or
789 .Dq no .
790 Specifying
791 .Dq yes
792 permits both
793 .Dq point-to-point
794 and
795 .Dq ethernet .
796 The default is
797 .Dq no .
798 .It Cm PermitUserEnvironment
799 Specifies whether
800 .Pa ~/.ssh/environment
801 and
802 .Cm environment=
803 options in
804 .Pa ~/.ssh/authorized_keys
805 are processed by
806 .Xr sshd 8 .
807 The default is
808 .Dq no .
809 Enabling environment processing may enable users to bypass access
810 restrictions in some configurations using mechanisms such as
811 .Ev LD_PRELOAD .
812 .It Cm PidFile
813 Specifies the file that contains the process ID of the
814 SSH daemon.
815 The default is
816 .Pa /var/run/sshd.pid .
817 .It Cm Port
818 Specifies the port number that
819 .Xr sshd 8
820 listens on.
821 The default is 22.
822 Multiple options of this type are permitted.
823 See also
824 .Cm ListenAddress .
825 .It Cm PrintLastLog
826 Specifies whether
827 .Xr sshd 8
828 should print the date and time of the last user login when a user logs
829 in interactively.
830 The default is
831 .Dq yes .
832 .It Cm PrintMotd
833 Specifies whether
834 .Xr sshd 8
835 should print
836 .Pa /etc/motd
837 when a user logs in interactively.
838 (On some systems it is also printed by the shell,
839 .Pa /etc/profile ,
840 or equivalent.)
841 The default is
842 .Dq yes .
843 .It Cm Protocol
844 Specifies the protocol versions
845 .Xr sshd 8
846 supports.
847 The possible values are
848 .Sq 1
849 and
850 .Sq 2 .
851 Multiple versions must be comma-separated.
852 The default is
853 .Sq 2 .
854 Note that the order of the protocol list does not indicate preference,
855 because the client selects among multiple protocol versions offered
856 by the server.
857 Specifying
858 .Dq 2,1
859 is identical to
860 .Dq 1,2 .
861 .It Cm PubkeyAuthentication
862 Specifies whether public key authentication is allowed.
863 The default is
864 .Dq yes .
865 Note that this option applies to protocol version 2 only.
866 .It Cm RevokedKeys
867 Specifies a list of revoked public keys.
868 Keys listed in this file will be refused for public key authentication.
869 Note that if this file is not readable, then public key authentication will
870 be refused for all users.
871 .It Cm RhostsRSAAuthentication
872 Specifies whether rhosts or /etc/hosts.equiv authentication together
873 with successful RSA host authentication is allowed.
874 The default is
875 .Dq no .
876 This option applies to protocol version 1 only.
877 .It Cm RSAAuthentication
878 Specifies whether pure RSA authentication is allowed.
879 The default is
880 .Dq yes .
881 This option applies to protocol version 1 only.
882 .It Cm ServerKeyBits
883 Defines the number of bits in the ephemeral protocol version 1 server key.
884 The minimum value is 512, and the default is 1024.
885 .It Cm StrictModes
886 Specifies whether
887 .Xr sshd 8
888 should check file modes and ownership of the
889 user's files and home directory before accepting login.
890 This is normally desirable because novices sometimes accidentally leave their
891 directory or files world-writable.
892 The default is
893 .Dq yes .
894 Note that this does not apply to
895 .Cm ChrootDirectory ,
896 whose permissions and ownership are checked unconditionally.
897 .It Cm Subsystem
898 Configures an external subsystem (e.g. file transfer daemon).
899 Arguments should be a subsystem name and a command (with optional arguments)
900 to execute upon subsystem request.
901 .Pp
902 The command
903 .Xr sftp-server 8
904 implements the
905 .Dq sftp
906 file transfer subsystem.
907 .Pp
908 Alternately the name
909 .Dq internal-sftp
910 implements an in-process
911 .Dq sftp
912 server.
913 This may simplify configurations using
914 .Cm ChrootDirectory
915 to force a different filesystem root on clients.
916 .Pp
917 By default no subsystems are defined.
918 Note that this option applies to protocol version 2 only.
919 .It Cm SyslogFacility
920 Gives the facility code that is used when logging messages from
921 .Xr sshd 8 .
922 The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
923 LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
924 The default is AUTH.
925 .It Cm TCPKeepAlive
926 Specifies whether the system should send TCP keepalive messages to the
927 other side.
928 If they are sent, death of the connection or crash of one
929 of the machines will be properly noticed.
930 However, this means that
931 connections will die if the route is down temporarily, and some people
932 find it annoying.
933 On the other hand, if TCP keepalives are not sent,
934 sessions may hang indefinitely on the server, leaving
935 .Dq ghost
936 users and consuming server resources.
937 .Pp
938 The default is
939 .Dq yes
940 (to send TCP keepalive messages), and the server will notice
941 if the network goes down or the client host crashes.
942 This avoids infinitely hanging sessions.
943 .Pp
944 To disable TCP keepalive messages, the value should be set to
945 .Dq no .
946 .It Cm TrustedUserCAKeys
947 Specifies a file containing public keys of certificate authorities that are
948 trusted to sign user certificates for authentication.
949 Keys are listed one per line; empty lines and comments starting with
950 .Ql #
951 are allowed.
952 If a certificate is presented for authentication and has its signing CA key
953 listed in this file, then it may be used for authentication for any user
954 listed in the certificate's principals list.
955 Note that certificates that lack a list of principals will not be permitted
956 for authentication using
957 .Cm TrustedUserCAKeys .
958 For more details on certificates, see the
959 .Sx CERTIFICATES
960 section in
961 .Xr ssh-keygen 1 .
962 .It Cm UseDNS
963 Specifies whether
964 .Xr sshd 8
965 should look up the remote host name and check that
966 the resolved host name for the remote IP address maps back to the
967 very same IP address.
968 The default is
969 .Dq yes .
970 .It Cm UseLogin
971 Specifies whether
972 .Xr login 1
973 is used for interactive login sessions.
974 The default is
975 .Dq no .
976 Note that
977 .Xr login 1
978 is never used for remote command execution.
979 Note also, that if this is enabled,
980 .Cm X11Forwarding
981 will be disabled because
982 .Xr login 1
983 does not know how to handle
984 .Xr xauth 1
985 cookies.
986 If
987 .Cm UsePrivilegeSeparation
988 is specified, it will be disabled after authentication.
989 .It Cm UsePAM
990 Enables the Pluggable Authentication Module interface.
991 If set to
992 .Dq yes
993 this will enable PAM authentication using
994 .Cm ChallengeResponseAuthentication
995 and
996 .Cm PasswordAuthentication
997 in addition to PAM account and session module processing for all
998 authentication types.
999 .Pp
1000 Because PAM challenge-response authentication usually serves an equivalent
1001 role to password authentication, you should disable either
1002 .Cm PasswordAuthentication
1003 or
1004 .Cm ChallengeResponseAuthentication.
1005 .Pp
1006 If
1007 .Cm UsePAM
1008 is enabled, you will not be able to run
1009 .Xr sshd 8
1010 as a non-root user.
1011 The default is
1012 .Dq no .
1013 .It Cm UsePrivilegeSeparation
1014 Specifies whether
1015 .Xr sshd 8
1016 separates privileges by creating an unprivileged child process
1017 to deal with incoming network traffic.
1018 After successful authentication, another process will be created that has
1019 the privilege of the authenticated user.
1020 The goal of privilege separation is to prevent privilege
1021 escalation by containing any corruption within the unprivileged processes.
1022 The default is
1023 .Dq yes .
1024 .It Cm X11DisplayOffset
1025 Specifies the first display number available for
1026 .Xr sshd 8 Ns 's
1027 X11 forwarding.
1028 This prevents sshd from interfering with real X11 servers.
1029 The default is 10.
1030 .It Cm X11Forwarding
1031 Specifies whether X11 forwarding is permitted.
1032 The argument must be
1033 .Dq yes
1034 or
1035 .Dq no .
1036 The default is
1037 .Dq no .
1038 .Pp
1039 When X11 forwarding is enabled, there may be additional exposure to
1040 the server and to client displays if the
1041 .Xr sshd 8
1042 proxy display is configured to listen on the wildcard address (see
1043 .Cm X11UseLocalhost
1044 below), though this is not the default.
1045 Additionally, the authentication spoofing and authentication data
1046 verification and substitution occur on the client side.
1047 The security risk of using X11 forwarding is that the client's X11
1048 display server may be exposed to attack when the SSH client requests
1049 forwarding (see the warnings for
1050 .Cm ForwardX11
1051 in
1052 .Xr ssh_config 5 ) .
1053 A system administrator may have a stance in which they want to
1054 protect clients that may expose themselves to attack by unwittingly
1055 requesting X11 forwarding, which can warrant a
1056 .Dq no
1057 setting.
1058 .Pp
1059 Note that disabling X11 forwarding does not prevent users from
1060 forwarding X11 traffic, as users can always install their own forwarders.
1061 X11 forwarding is automatically disabled if
1062 .Cm UseLogin
1063 is enabled.
1064 .It Cm X11UseLocalhost
1065 Specifies whether
1066 .Xr sshd 8
1067 should bind the X11 forwarding server to the loopback address or to
1068 the wildcard address.
1069 By default,
1070 sshd binds the forwarding server to the loopback address and sets the
1071 hostname part of the
1072 .Ev DISPLAY
1073 environment variable to
1074 .Dq localhost .
1075 This prevents remote hosts from connecting to the proxy display.
1076 However, some older X11 clients may not function with this
1077 configuration.
1078 .Cm X11UseLocalhost
1079 may be set to
1080 .Dq no
1081 to specify that the forwarding server should be bound to the wildcard
1082 address.
1083 The argument must be
1084 .Dq yes
1085 or
1086 .Dq no .
1087 The default is
1088 .Dq yes .
1089 .It Cm XAuthLocation
1090 Specifies the full pathname of the
1091 .Xr xauth 1
1092 program.
1093 The default is
1094 .Pa /usr/X11R6/bin/xauth .
1095 .El
1096 .Sh TIME FORMATS
1097 .Xr sshd 8
1098 command-line arguments and configuration file options that specify time
1099 may be expressed using a sequence of the form:
1100 .Sm off
1101 .Ar time Op Ar qualifier ,
1102 .Sm on
1103 where
1104 .Ar time
1105 is a positive integer value and
1106 .Ar qualifier
1107 is one of the following:
1108 .Pp
1109 .Bl -tag -width Ds -compact -offset indent
1110 .It Aq Cm none
1111 seconds
1112 .It Cm s | Cm S
1113 seconds
1114 .It Cm m | Cm M
1115 minutes
1116 .It Cm h | Cm H
1117 hours
1118 .It Cm d | Cm D
1119 days
1120 .It Cm w | Cm W
1121 weeks
1122 .El
1123 .Pp
1124 Each member of the sequence is added together to calculate
1125 the total time value.
1126 .Pp
1127 Time format examples:
1128 .Pp
1129 .Bl -tag -width Ds -compact -offset indent
1130 .It 600
1131 600 seconds (10 minutes)
1132 .It 10m
1133 10 minutes
1134 .It 1h30m
1135 1 hour 30 minutes (90 minutes)
1136 .El
1137 .Sh FILES
1138 .Bl -tag -width Ds
1139 .It Pa /etc/ssh/sshd_config
1140 Contains configuration data for
1141 .Xr sshd 8 .
1142 This file should be writable by root only, but it is recommended
1143 (though not necessary) that it be world-readable.
1144 .El
1145 .Sh SEE ALSO
1146 .Xr sshd 8
1147 .Sh AUTHORS
1148 OpenSSH is a derivative of the original and free
1149 ssh 1.2.12 release by Tatu Ylonen.
1150 Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1151 Theo de Raadt and Dug Song
1152 removed many bugs, re-added newer features and
1153 created OpenSSH.
1154 Markus Friedl contributed the support for SSH
1155 protocol versions 1.5 and 2.0.
1156 Niels Provos and Markus Friedl contributed support
1157 for privilege separation.