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