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