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