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