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