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