Annotation of src/usr.bin/ssh/sshd_config.5, Revision 1.128
1.1 stevesk 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: .\"
1.128 ! jmc 36: .\" $OpenBSD: sshd_config.5,v 1.127 2010/09/22 05:01:30 djm Exp $
! 37: .Dd $Mdocdate: September 22 2010 $
1.1 stevesk 38: .Dt SSHD_CONFIG 5
39: .Os
40: .Sh NAME
41: .Nm sshd_config
42: .Nd OpenSSH SSH daemon configuration file
43: .Sh SYNOPSIS
1.71 jmc 44: .Nm /etc/ssh/sshd_config
1.1 stevesk 45: .Sh DESCRIPTION
1.53 jmc 46: .Xr sshd 8
1.1 stevesk 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.
1.56 dtucker 56: Arguments may optionally be enclosed in double quotes
57: .Pq \&"
58: in order to represent arguments containing spaces.
1.1 stevesk 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
1.30 djm 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.
1.31 djm 73: Note that environment passing is only supported for protocol 2.
1.30 djm 74: Variables are specified by name, which may contain the wildcard characters
1.51 jmc 75: .Ql *
1.30 djm 76: and
77: .Ql \&? .
1.31 djm 78: Multiple environment variables may be separated by whitespace or spread
1.30 djm 79: across multiple
80: .Cm AcceptEnv
81: directives.
1.31 djm 82: Be warned that some environment variables could be used to bypass restricted
1.30 djm 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.
1.37 djm 86: .It Cm AddressFamily
87: Specifies which address family should be used by
1.53 jmc 88: .Xr sshd 8 .
1.37 djm 89: Valid arguments are
90: .Dq any ,
91: .Dq inet
1.52 jmc 92: (use IPv4 only), or
1.37 djm 93: .Dq inet6
94: (use IPv6 only).
95: The default is
96: .Dq any .
1.89 jmc 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.
1.1 stevesk 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.
1.54 jmc 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 .
1.49 jmc 119: .Pp
120: See
121: .Sx PATTERNS
122: in
123: .Xr ssh_config 5
124: for more information on patterns.
1.1 stevesk 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.
1.14 jmc 135: If specified, login is allowed only for user names that
1.1 stevesk 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.
1.54 jmc 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 .
1.49 jmc 148: .Pp
149: See
150: .Sx PATTERNS
151: in
152: .Xr ssh_config 5
153: for more information on patterns.
1.1 stevesk 154: .It Cm AuthorizedKeysFile
155: Specifies the file that contains the public keys that can be used
156: for user authentication.
1.124 djm 157: The format is described in the
158: .Sx AUTHORIZED_KEYS FILE FORMAT
159: section of
160: .Xr sshd 8 .
1.1 stevesk 161: .Cm AuthorizedKeysFile
162: may contain tokens of the form %T which are substituted during connection
1.52 jmc 163: setup.
1.17 jmc 164: The following tokens are defined: %% is replaced by a literal '%',
1.52 jmc 165: %h is replaced by the home directory of the user being authenticated, and
1.1 stevesk 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: The default is
172: .Dq .ssh/authorized_keys .
1.121 djm 173: .It Cm AuthorizedPrincipalsFile
174: Specifies a file that lists principal names that are accepted for
175: certificate authentication.
176: When using certificates signed by a key listed in
177: .Cm TrustedUserCAKeys ,
178: this file lists names, one of which must appear in the certificate for it
179: to be accepted for authentication.
1.125 jmc 180: Names are listed one per line preceded by key options (as described
1.124 djm 181: in
182: .Sx AUTHORIZED_KEYS FILE FORMAT
183: in
1.125 jmc 184: .Xr sshd 8 ) .
1.124 djm 185: Empty lines and comments starting with
1.121 djm 186: .Ql #
187: are ignored.
188: .Pp
189: .Cm AuthorizedPrincipalsFile
190: may contain tokens of the form %T which are substituted during connection
191: setup.
192: The following tokens are defined: %% is replaced by a literal '%',
193: %h is replaced by the home directory of the user being authenticated, and
194: %u is replaced by the username of that user.
195: After expansion,
196: .Cm AuthorizedPrincipalsFile
197: is taken to be an absolute path or one relative to the user's home
198: directory.
199: .Pp
1.122 jmc 200: The default is not to use a principals file \(en in this case, the username
1.121 djm 201: of the user must appear in a certificate's principals list for it to be
202: accepted.
203: Note that
204: .Cm AuthorizedPrincipalsFile
205: is only used when authentication proceeds using a CA listed in
206: .Cm TrustedUserCAKeys
207: and is not consulted for certification authorities trusted via
208: .Pa ~/.ssh/authorized_keys ,
209: though the
210: .Cm principals=
211: key option offers a similar facility (see
212: .Xr sshd 8
213: for details).
1.1 stevesk 214: .It Cm Banner
215: The contents of the specified file are sent to the remote user before
216: authentication is allowed.
1.78 djm 217: If the argument is
218: .Dq none
219: then no banner is displayed.
1.1 stevesk 220: This option is only available for protocol version 2.
221: By default, no banner is displayed.
222: .It Cm ChallengeResponseAuthentication
1.50 jmc 223: Specifies whether challenge-response authentication is allowed.
1.1 stevesk 224: All authentication styles from
225: .Xr login.conf 5
226: are supported.
227: The default is
228: .Dq yes .
1.80 djm 229: .It Cm ChrootDirectory
1.113 stevesk 230: Specifies the pathname of a directory to
1.80 djm 231: .Xr chroot 2
232: to after authentication.
1.113 stevesk 233: All components of the pathname must be root-owned directories that are
1.80 djm 234: not writable by any other user or group.
1.106 stevesk 235: After the chroot,
236: .Xr sshd 8
237: changes the working directory to the user's home directory.
1.80 djm 238: .Pp
1.113 stevesk 239: The pathname may contain the following tokens that are expanded at runtime once
1.80 djm 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
1.103 stevesk 247: user's session.
1.80 djm 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
1.105 jmc 263: .Dq sftp ,
1.80 djm 264: no additional configuration of the environment is necessary if the
1.105 jmc 265: in-process sftp server is used,
266: though sessions which use logging do require
1.104 stevesk 267: .Pa /dev/log
268: inside the chroot directory (see
269: .Xr sftp-server 8
1.81 jmc 270: for details).
1.80 djm 271: .Pp
272: The default is not to
273: .Xr chroot 2 .
1.1 stevesk 274: .It Cm Ciphers
275: Specifies the ciphers allowed for protocol version 2.
276: Multiple ciphers must be comma-separated.
1.34 dtucker 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 ,
1.43 djm 285: .Dq arcfour128 ,
286: .Dq arcfour256 ,
1.34 dtucker 287: .Dq arcfour ,
288: .Dq blowfish-cbc ,
289: and
290: .Dq cast128-cbc .
1.52 jmc 291: The default is:
292: .Bd -literal -offset 3n
1.100 naddy 293: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,
294: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,
295: aes256-cbc,arcfour
1.1 stevesk 296: .Ed
297: .It Cm ClientAliveCountMax
1.48 jmc 298: Sets the number of client alive messages (see below) which may be
1.1 stevesk 299: sent without
1.52 jmc 300: .Xr sshd 8
1.17 jmc 301: receiving any messages back from the client.
302: If this threshold is reached while client alive messages are being sent,
1.52 jmc 303: sshd will disconnect the client, terminating the session.
1.17 jmc 304: It is important to note that the use of client alive messages is very
305: different from
1.27 markus 306: .Cm TCPKeepAlive
1.17 jmc 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
1.27 markus 311: .Cm TCPKeepAlive
1.17 jmc 312: is spoofable.
313: The client alive mechanism is valuable when the client or
1.1 stevesk 314: server depend on knowing when a connection has become inactive.
315: .Pp
1.17 jmc 316: The default value is 3.
317: If
1.1 stevesk 318: .Cm ClientAliveInterval
1.48 jmc 319: (see below) is set to 15, and
1.1 stevesk 320: .Cm ClientAliveCountMax
1.52 jmc 321: is left at the default, unresponsive SSH clients
1.1 stevesk 322: will be disconnected after approximately 45 seconds.
1.57 markus 323: This option applies to protocol version 2 only.
1.42 djm 324: .It Cm ClientAliveInterval
325: Sets a timeout interval in seconds after which if no data has been received
326: from the client,
1.52 jmc 327: .Xr sshd 8
1.42 djm 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.
1.3 markus 333: .It Cm Compression
1.44 markus 334: Specifies whether compression is allowed, or delayed until
335: the user has authenticated successfully.
1.3 markus 336: The argument must be
1.44 markus 337: .Dq yes ,
338: .Dq delayed ,
1.3 markus 339: or
340: .Dq no .
341: The default is
1.44 markus 342: .Dq delayed .
1.1 stevesk 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.
1.54 jmc 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 .
1.49 jmc 356: .Pp
357: See
358: .Sx PATTERNS
359: in
360: .Xr ssh_config 5
361: for more information on patterns.
1.1 stevesk 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.
1.54 jmc 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 .
1.49 jmc 377: .Pp
378: See
379: .Sx PATTERNS
380: in
381: .Xr ssh_config 5
382: for more information on patterns.
1.67 dtucker 383: .It Cm ForceCommand
384: Forces the execution of the command specified by
385: .Cm ForceCommand ,
1.84 djm 386: ignoring any command supplied by the client and
387: .Pa ~/.ssh/rc
388: if present.
1.67 dtucker 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.
1.82 djm 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 .
1.1 stevesk 402: .It Cm GatewayPorts
403: Specifies whether remote hosts are allowed to connect to ports
404: forwarded for the client.
405: By default,
1.52 jmc 406: .Xr sshd 8
1.15 jmc 407: binds remote port forwardings to the loopback address.
408: This prevents other remote hosts from connecting to forwarded ports.
1.1 stevesk 409: .Cm GatewayPorts
1.52 jmc 410: can be used to specify that sshd
1.39 djm 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,
1.1 stevesk 416: .Dq yes
1.39 djm 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.
1.1 stevesk 420: The default is
421: .Dq no .
1.23 markus 422: .It Cm GSSAPIAuthentication
1.25 markus 423: Specifies whether user authentication based on GSSAPI is allowed.
1.26 djm 424: The default is
1.23 markus 425: .Dq no .
426: Note that this option applies to protocol version 2 only.
427: .It Cm GSSAPICleanupCredentials
428: Specifies whether to automatically destroy the user's credentials cache
429: on logout.
430: The default is
431: .Dq yes .
432: Note that this option applies to protocol version 2 only.
1.1 stevesk 433: .It Cm HostbasedAuthentication
434: Specifies whether rhosts or /etc/hosts.equiv authentication together
435: with successful public key client host authentication is allowed
1.50 jmc 436: (host-based authentication).
1.1 stevesk 437: This option is similar to
438: .Cm RhostsRSAAuthentication
439: and applies to protocol version 2 only.
1.70 dtucker 440: The default is
441: .Dq no .
442: .It Cm HostbasedUsesNameFromPacketOnly
443: Specifies whether or not the server will attempt to perform a reverse
444: name lookup when matching the name in the
445: .Pa ~/.shosts ,
446: .Pa ~/.rhosts ,
447: and
448: .Pa /etc/hosts.equiv
449: files during
450: .Cm HostbasedAuthentication .
451: A setting of
452: .Dq yes
453: means that
454: .Xr sshd 8
455: uses the name supplied by the client rather than
456: attempting to resolve the name from the TCP connection itself.
1.1 stevesk 457: The default is
458: .Dq no .
1.117 djm 459: .It Cm HostCertificate
460: Specifies a file containing a public host certificate.
461: The certificate's public key must match a private host key already specified
462: by
463: .Cm HostKey .
464: The default behaviour of
465: .Xr sshd 8
466: is not to load any certificates.
1.1 stevesk 467: .It Cm HostKey
468: Specifies a file containing a private host key
469: used by SSH.
470: The default is
471: .Pa /etc/ssh/ssh_host_key
472: for protocol version 1, and
1.126 djm 473: .Pa /etc/ssh/ssh_host_dsa_key ,
474: .Pa /etc/ssh/ssh_host_ecdsa_key
475: and
1.1 stevesk 476: .Pa /etc/ssh/ssh_host_rsa_key
477: for protocol version 2.
478: Note that
1.52 jmc 479: .Xr sshd 8
1.1 stevesk 480: will refuse to use a file if it is group/world-accessible.
481: It is possible to have multiple host key files.
482: .Dq rsa1
483: keys are used for version 1 and
1.126 djm 484: .Dq dsa ,
485: .Dq ecdsa
1.1 stevesk 486: or
487: .Dq rsa
488: are used for version 2 of the SSH protocol.
489: .It Cm IgnoreRhosts
490: Specifies that
491: .Pa .rhosts
492: and
493: .Pa .shosts
494: files will not be used in
495: .Cm RhostsRSAAuthentication
496: or
497: .Cm HostbasedAuthentication .
498: .Pp
499: .Pa /etc/hosts.equiv
500: and
501: .Pa /etc/shosts.equiv
502: are still used.
503: The default is
504: .Dq yes .
505: .It Cm IgnoreUserKnownHosts
506: Specifies whether
1.52 jmc 507: .Xr sshd 8
1.1 stevesk 508: should ignore the user's
1.41 djm 509: .Pa ~/.ssh/known_hosts
1.1 stevesk 510: during
511: .Cm RhostsRSAAuthentication
512: or
513: .Cm HostbasedAuthentication .
514: The default is
515: .Dq no .
516: .It Cm KerberosAuthentication
1.24 markus 517: Specifies whether the password provided by the user for
1.1 stevesk 518: .Cm PasswordAuthentication
1.24 markus 519: will be validated through the Kerberos KDC.
1.1 stevesk 520: To use this option, the server needs a
521: Kerberos servtab which allows the verification of the KDC's identity.
1.52 jmc 522: The default is
1.29 dtucker 523: .Dq no .
524: .It Cm KerberosGetAFSToken
1.45 djm 525: If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
1.29 dtucker 526: an AFS token before accessing the user's home directory.
1.52 jmc 527: The default is
1.1 stevesk 528: .Dq no .
529: .It Cm KerberosOrLocalPasswd
1.52 jmc 530: If password authentication through Kerberos fails then
1.1 stevesk 531: the password will be validated via any additional local mechanism
532: such as
533: .Pa /etc/passwd .
1.52 jmc 534: The default is
1.1 stevesk 535: .Dq yes .
536: .It Cm KerberosTicketCleanup
537: Specifies whether to automatically destroy the user's ticket cache
538: file on logout.
1.52 jmc 539: The default is
1.1 stevesk 540: .Dq yes .
1.127 djm 541: .It Cm KexAlgorithms
542: Specifies the available KEX (Key Exchange) algorithms.
543: Multiple algorithms must be comma-separated.
544: The default is
545: .Dq ecdh-sha2-nistp256 ,
546: .Dq ecdh-sha2-nistp384 ,
547: .Dq ecdh-sha2-nistp521 ,
548: .Dq diffie-hellman-group-exchange-sha256 ,
549: .Dq diffie-hellman-group-exchange-sha1 ,
550: .Dq diffie-hellman-group14-sha1 ,
551: .Dq diffie-hellman-group1-sha1 .
1.1 stevesk 552: .It Cm KeyRegenerationInterval
553: In protocol version 1, the ephemeral server key is automatically regenerated
554: after this many seconds (if it has been used).
555: The purpose of regeneration is to prevent
556: decrypting captured sessions by later breaking into the machine and
557: stealing the keys.
558: The key is never stored anywhere.
559: If the value is 0, the key is never regenerated.
560: The default is 3600 (seconds).
561: .It Cm ListenAddress
562: Specifies the local addresses
1.52 jmc 563: .Xr sshd 8
1.1 stevesk 564: should listen on.
565: The following forms may be used:
566: .Pp
567: .Bl -item -offset indent -compact
568: .It
569: .Cm ListenAddress
570: .Sm off
571: .Ar host No | Ar IPv4_addr No | Ar IPv6_addr
572: .Sm on
573: .It
574: .Cm ListenAddress
575: .Sm off
576: .Ar host No | Ar IPv4_addr No : Ar port
577: .Sm on
578: .It
579: .Cm ListenAddress
580: .Sm off
581: .Oo
582: .Ar host No | Ar IPv6_addr Oc : Ar port
583: .Sm on
584: .El
585: .Pp
586: If
587: .Ar port
588: is not specified,
1.52 jmc 589: sshd will listen on the address and all prior
1.1 stevesk 590: .Cm Port
1.17 jmc 591: options specified.
592: The default is to listen on all local addresses.
1.15 jmc 593: Multiple
1.1 stevesk 594: .Cm ListenAddress
1.17 jmc 595: options are permitted.
596: Additionally, any
1.1 stevesk 597: .Cm Port
1.52 jmc 598: options must precede this option for non-port qualified addresses.
1.1 stevesk 599: .It Cm LoginGraceTime
600: The server disconnects after this time if the user has not
601: successfully logged in.
602: If the value is 0, there is no time limit.
1.12 stevesk 603: The default is 120 seconds.
1.1 stevesk 604: .It Cm LogLevel
605: Gives the verbosity level that is used when logging messages from
1.53 jmc 606: .Xr sshd 8 .
1.1 stevesk 607: The possible values are:
1.52 jmc 608: QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
1.15 jmc 609: The default is INFO.
610: DEBUG and DEBUG1 are equivalent.
611: DEBUG2 and DEBUG3 each specify higher levels of debugging output.
612: Logging with a DEBUG level violates the privacy of users and is not recommended.
1.1 stevesk 613: .It Cm MACs
614: Specifies the available MAC (message authentication code) algorithms.
615: The MAC algorithm is used in protocol version 2
616: for data integrity protection.
617: Multiple algorithms must be comma-separated.
1.52 jmc 618: The default is:
1.77 jmc 619: .Bd -literal -offset indent
620: hmac-md5,hmac-sha1,umac-64@openssh.com,
621: hmac-ripemd160,hmac-sha1-96,hmac-md5-96
622: .Ed
1.60 dtucker 623: .It Cm Match
1.61 jmc 624: Introduces a conditional block.
1.65 dtucker 625: If all of the criteria on the
1.60 dtucker 626: .Cm Match
1.65 dtucker 627: line are satisfied, the keywords on the following lines override those
628: set in the global section of the config file, until either another
1.60 dtucker 629: .Cm Match
1.65 dtucker 630: line or the end of the file.
1.91 djm 631: .Pp
1.61 jmc 632: The arguments to
1.60 dtucker 633: .Cm Match
1.65 dtucker 634: are one or more criteria-pattern pairs.
1.60 dtucker 635: The available criteria are
636: .Cm User ,
1.69 dtucker 637: .Cm Group ,
1.60 dtucker 638: .Cm Host ,
639: and
640: .Cm Address .
1.91 djm 641: The match patterns may consist of single entries or comma-separated
642: lists and may use the wildcard and negation operators described in the
1.92 djm 643: .Sx PATTERNS
1.91 djm 644: section of
1.92 djm 645: .Xr ssh_config 5 .
1.91 djm 646: .Pp
647: The patterns in an
648: .Cm Address
649: criteria may additionally contain addresses to match in CIDR
1.93 jmc 650: address/masklen format, e.g.\&
1.91 djm 651: .Dq 192.0.2.0/24
652: or
653: .Dq 3ffe:ffff::/32 .
654: Note that the mask length provided must be consistent with the address -
655: it is an error to specify a mask length that is too long for the address
1.93 jmc 656: or one with bits set in this host portion of the address.
657: For example,
1.91 djm 658: .Dq 192.0.2.0/33
659: and
1.93 jmc 660: .Dq 192.0.2.0/8
1.91 djm 661: respectively.
662: .Pp
1.60 dtucker 663: Only a subset of keywords may be used on the lines following a
664: .Cm Match
665: keyword.
666: Available keywords are
1.99 okan 667: .Cm AllowAgentForwarding ,
1.62 dtucker 668: .Cm AllowTcpForwarding ,
1.123 djm 669: .Cm AuthorizedKeysFile ,
670: .Cm AuthorizedPrincipalsFile ,
1.72 dtucker 671: .Cm Banner ,
1.85 djm 672: .Cm ChrootDirectory ,
1.67 dtucker 673: .Cm ForceCommand ,
1.62 dtucker 674: .Cm GatewayPorts ,
1.87 djm 675: .Cm GSSAPIAuthentication ,
676: .Cm HostbasedAuthentication ,
1.123 djm 677: .Cm HostbasedUsesNameFromPacketOnly ,
1.74 jmc 678: .Cm KbdInteractiveAuthentication ,
1.72 dtucker 679: .Cm KerberosAuthentication ,
1.95 dtucker 680: .Cm MaxAuthTries ,
1.94 dtucker 681: .Cm MaxSessions ,
1.72 dtucker 682: .Cm PasswordAuthentication ,
1.97 djm 683: .Cm PermitEmptyPasswords ,
1.66 dtucker 684: .Cm PermitOpen ,
1.79 dtucker 685: .Cm PermitRootLogin ,
1.123 djm 686: .Cm PermitTunnel ,
1.107 dtucker 687: .Cm PubkeyAuthentication ,
1.72 dtucker 688: .Cm RhostsRSAAuthentication ,
689: .Cm RSAAuthentication ,
1.66 dtucker 690: .Cm X11DisplayOffset ,
1.101 djm 691: .Cm X11Forwarding
1.60 dtucker 692: and
1.102 djm 693: .Cm X11UseLocalHost .
1.33 dtucker 694: .It Cm MaxAuthTries
695: Specifies the maximum number of authentication attempts permitted per
1.35 jmc 696: connection.
697: Once the number of failures reaches half this value,
698: additional failures are logged.
699: The default is 6.
1.90 djm 700: .It Cm MaxSessions
701: Specifies the maximum number of open sessions permitted per network connection.
702: The default is 10.
1.1 stevesk 703: .It Cm MaxStartups
704: Specifies the maximum number of concurrent unauthenticated connections to the
1.52 jmc 705: SSH daemon.
1.1 stevesk 706: Additional connections will be dropped until authentication succeeds or the
707: .Cm LoginGraceTime
708: expires for a connection.
709: The default is 10.
710: .Pp
711: Alternatively, random early drop can be enabled by specifying
712: the three colon separated values
713: .Dq start:rate:full
1.51 jmc 714: (e.g. "10:30:60").
1.53 jmc 715: .Xr sshd 8
1.1 stevesk 716: will refuse connection attempts with a probability of
717: .Dq rate/100
718: (30%)
719: if there are currently
720: .Dq start
721: (10)
722: unauthenticated connections.
723: The probability increases linearly and all connection attempts
724: are refused if the number of unauthenticated connections reaches
725: .Dq full
726: (60).
727: .It Cm PasswordAuthentication
728: Specifies whether password authentication is allowed.
729: The default is
730: .Dq yes .
731: .It Cm PermitEmptyPasswords
732: When password authentication is allowed, it specifies whether the
733: server allows login to accounts with empty password strings.
734: The default is
735: .Dq no .
1.62 dtucker 736: .It Cm PermitOpen
737: Specifies the destinations to which TCP port forwarding is permitted.
738: The forwarding specification must be one of the following forms:
739: .Pp
740: .Bl -item -offset indent -compact
741: .It
742: .Cm PermitOpen
743: .Sm off
744: .Ar host : port
745: .Sm on
746: .It
747: .Cm PermitOpen
748: .Sm off
749: .Ar IPv4_addr : port
750: .Sm on
751: .It
752: .Cm PermitOpen
753: .Sm off
754: .Ar \&[ IPv6_addr \&] : port
755: .Sm on
756: .El
757: .Pp
1.68 dtucker 758: Multiple forwards may be specified by separating them with whitespace.
1.62 dtucker 759: An argument of
760: .Dq any
761: can be used to remove all restrictions and permit any forwarding requests.
1.63 jmc 762: By default all port forwarding requests are permitted.
1.1 stevesk 763: .It Cm PermitRootLogin
1.38 jmc 764: Specifies whether root can log in using
1.1 stevesk 765: .Xr ssh 1 .
766: The argument must be
767: .Dq yes ,
768: .Dq without-password ,
1.52 jmc 769: .Dq forced-commands-only ,
1.1 stevesk 770: or
771: .Dq no .
772: The default is
773: .Dq yes .
774: .Pp
775: If this option is set to
1.52 jmc 776: .Dq without-password ,
1.1 stevesk 777: password authentication is disabled for root.
778: .Pp
779: If this option is set to
1.52 jmc 780: .Dq forced-commands-only ,
1.1 stevesk 781: root login with public key authentication will be allowed,
782: but only if the
783: .Ar command
784: option has been specified
785: (which may be useful for taking remote backups even if root login is
1.17 jmc 786: normally not allowed).
787: All other authentication methods are disabled for root.
1.1 stevesk 788: .Pp
789: If this option is set to
1.52 jmc 790: .Dq no ,
1.38 jmc 791: root is not allowed to log in.
1.46 reyk 792: .It Cm PermitTunnel
793: Specifies whether
794: .Xr tun 4
795: device forwarding is allowed.
1.47 reyk 796: The argument must be
797: .Dq yes ,
1.58 stevesk 798: .Dq point-to-point
799: (layer 3),
800: .Dq ethernet
801: (layer 2), or
1.47 reyk 802: .Dq no .
1.58 stevesk 803: Specifying
804: .Dq yes
805: permits both
806: .Dq point-to-point
807: and
808: .Dq ethernet .
1.46 reyk 809: The default is
810: .Dq no .
1.6 markus 811: .It Cm PermitUserEnvironment
812: Specifies whether
813: .Pa ~/.ssh/environment
1.9 stevesk 814: and
1.6 markus 815: .Cm environment=
816: options in
817: .Pa ~/.ssh/authorized_keys
1.9 stevesk 818: are processed by
1.52 jmc 819: .Xr sshd 8 .
1.6 markus 820: The default is
821: .Dq no .
1.9 stevesk 822: Enabling environment processing may enable users to bypass access
823: restrictions in some configurations using mechanisms such as
824: .Ev LD_PRELOAD .
1.1 stevesk 825: .It Cm PidFile
1.4 stevesk 826: Specifies the file that contains the process ID of the
1.53 jmc 827: SSH daemon.
1.1 stevesk 828: The default is
829: .Pa /var/run/sshd.pid .
830: .It Cm Port
831: Specifies the port number that
1.52 jmc 832: .Xr sshd 8
1.1 stevesk 833: listens on.
834: The default is 22.
835: Multiple options of this type are permitted.
836: See also
837: .Cm ListenAddress .
838: .It Cm PrintLastLog
839: Specifies whether
1.52 jmc 840: .Xr sshd 8
1.36 jaredy 841: should print the date and time of the last user login when a user logs
842: in interactively.
1.1 stevesk 843: The default is
844: .Dq yes .
845: .It Cm PrintMotd
846: Specifies whether
1.52 jmc 847: .Xr sshd 8
1.1 stevesk 848: should print
849: .Pa /etc/motd
850: when a user logs in interactively.
851: (On some systems it is also printed by the shell,
852: .Pa /etc/profile ,
853: or equivalent.)
854: The default is
855: .Dq yes .
856: .It Cm Protocol
857: Specifies the protocol versions
1.52 jmc 858: .Xr sshd 8
1.5 stevesk 859: supports.
1.1 stevesk 860: The possible values are
1.52 jmc 861: .Sq 1
1.1 stevesk 862: and
1.52 jmc 863: .Sq 2 .
1.1 stevesk 864: Multiple versions must be comma-separated.
865: The default is
1.109 jmc 866: .Sq 2 .
1.5 stevesk 867: Note that the order of the protocol list does not indicate preference,
868: because the client selects among multiple protocol versions offered
869: by the server.
870: Specifying
871: .Dq 2,1
872: is identical to
873: .Dq 1,2 .
1.1 stevesk 874: .It Cm PubkeyAuthentication
875: Specifies whether public key authentication is allowed.
876: The default is
877: .Dq yes .
878: Note that this option applies to protocol version 2 only.
1.118 djm 879: .It Cm RevokedKeys
880: Specifies a list of revoked public keys.
881: Keys listed in this file will be refused for public key authentication.
882: Note that if this file is not readable, then public key authentication will
883: be refused for all users.
1.1 stevesk 884: .It Cm RhostsRSAAuthentication
885: Specifies whether rhosts or /etc/hosts.equiv authentication together
886: with successful RSA host authentication is allowed.
887: The default is
888: .Dq no .
889: This option applies to protocol version 1 only.
890: .It Cm RSAAuthentication
891: Specifies whether pure RSA authentication is allowed.
892: The default is
893: .Dq yes .
894: This option applies to protocol version 1 only.
895: .It Cm ServerKeyBits
896: Defines the number of bits in the ephemeral protocol version 1 server key.
1.96 djm 897: The minimum value is 512, and the default is 1024.
1.1 stevesk 898: .It Cm StrictModes
899: Specifies whether
1.52 jmc 900: .Xr sshd 8
1.1 stevesk 901: should check file modes and ownership of the
902: user's files and home directory before accepting login.
903: This is normally desirable because novices sometimes accidentally leave their
904: directory or files world-writable.
905: The default is
906: .Dq yes .
1.112 djm 907: Note that this does not apply to
908: .Cm ChrootDirectory ,
909: whose permissions and ownership are checked unconditionally.
1.1 stevesk 910: .It Cm Subsystem
1.51 jmc 911: Configures an external subsystem (e.g. file transfer daemon).
1.59 djm 912: Arguments should be a subsystem name and a command (with optional arguments)
913: to execute upon subsystem request.
1.80 djm 914: .Pp
1.1 stevesk 915: The command
916: .Xr sftp-server 8
917: implements the
918: .Dq sftp
919: file transfer subsystem.
1.80 djm 920: .Pp
921: Alternately the name
922: .Dq internal-sftp
923: implements an in-process
924: .Dq sftp
925: server.
926: This may simplify configurations using
927: .Cm ChrootDirectory
928: to force a different filesystem root on clients.
929: .Pp
1.1 stevesk 930: By default no subsystems are defined.
931: Note that this option applies to protocol version 2 only.
932: .It Cm SyslogFacility
933: Gives the facility code that is used when logging messages from
1.53 jmc 934: .Xr sshd 8 .
1.1 stevesk 935: The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
936: LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
937: The default is AUTH.
1.27 markus 938: .It Cm TCPKeepAlive
939: Specifies whether the system should send TCP keepalive messages to the
940: other side.
941: If they are sent, death of the connection or crash of one
942: of the machines will be properly noticed.
943: However, this means that
944: connections will die if the route is down temporarily, and some people
945: find it annoying.
946: On the other hand, if TCP keepalives are not sent,
947: sessions may hang indefinitely on the server, leaving
948: .Dq ghost
949: users and consuming server resources.
950: .Pp
951: The default is
952: .Dq yes
953: (to send TCP keepalive messages), and the server will notice
954: if the network goes down or the client host crashes.
955: This avoids infinitely hanging sessions.
956: .Pp
957: To disable TCP keepalive messages, the value should be set to
958: .Dq no .
1.118 djm 959: .It Cm TrustedUserCAKeys
960: Specifies a file containing public keys of certificate authorities that are
1.120 djm 961: trusted to sign user certificates for authentication.
1.119 jmc 962: Keys are listed one per line; empty lines and comments starting with
1.118 djm 963: .Ql #
964: are allowed.
965: If a certificate is presented for authentication and has its signing CA key
966: listed in this file, then it may be used for authentication for any user
967: listed in the certificate's principals list.
968: Note that certificates that lack a list of principals will not be permitted
969: for authentication using
970: .Cm TrustedUserCAKeys .
1.119 jmc 971: For more details on certificates, see the
1.118 djm 972: .Sx CERTIFICATES
973: section in
974: .Xr ssh-keygen 1 .
1.18 markus 975: .It Cm UseDNS
976: Specifies whether
1.52 jmc 977: .Xr sshd 8
1.40 jmc 978: should look up the remote host name and check that
1.18 markus 979: the resolved host name for the remote IP address maps back to the
980: very same IP address.
981: The default is
982: .Dq yes .
1.1 stevesk 983: .It Cm UseLogin
984: Specifies whether
985: .Xr login 1
986: is used for interactive login sessions.
987: The default is
988: .Dq no .
989: Note that
990: .Xr login 1
991: is never used for remote command execution.
992: Note also, that if this is enabled,
993: .Cm X11Forwarding
994: will be disabled because
995: .Xr login 1
996: does not know how to handle
997: .Xr xauth 1
1.15 jmc 998: cookies.
999: If
1.1 stevesk 1000: .Cm UsePrivilegeSeparation
1001: is specified, it will be disabled after authentication.
1002: .It Cm UsePrivilegeSeparation
1003: Specifies whether
1.52 jmc 1004: .Xr sshd 8
1.2 stevesk 1005: separates privileges by creating an unprivileged child process
1.15 jmc 1006: to deal with incoming network traffic.
1007: After successful authentication, another process will be created that has
1008: the privilege of the authenticated user.
1009: The goal of privilege separation is to prevent privilege
1.1 stevesk 1010: escalation by containing any corruption within the unprivileged processes.
1011: The default is
1012: .Dq yes .
1013: .It Cm X11DisplayOffset
1014: Specifies the first display number available for
1.52 jmc 1015: .Xr sshd 8 Ns 's
1.1 stevesk 1016: X11 forwarding.
1.52 jmc 1017: This prevents sshd from interfering with real X11 servers.
1.1 stevesk 1018: The default is 10.
1019: .It Cm X11Forwarding
1020: Specifies whether X11 forwarding is permitted.
1.13 stevesk 1021: The argument must be
1022: .Dq yes
1023: or
1024: .Dq no .
1.1 stevesk 1025: The default is
1026: .Dq no .
1.13 stevesk 1027: .Pp
1028: When X11 forwarding is enabled, there may be additional exposure to
1029: the server and to client displays if the
1.52 jmc 1030: .Xr sshd 8
1.13 stevesk 1031: proxy display is configured to listen on the wildcard address (see
1032: .Cm X11UseLocalhost
1.52 jmc 1033: below), though this is not the default.
1.13 stevesk 1034: Additionally, the authentication spoofing and authentication data
1035: verification and substitution occur on the client side.
1036: The security risk of using X11 forwarding is that the client's X11
1.52 jmc 1037: display server may be exposed to attack when the SSH client requests
1.13 stevesk 1038: forwarding (see the warnings for
1039: .Cm ForwardX11
1040: in
1.19 jmc 1041: .Xr ssh_config 5 ) .
1.13 stevesk 1042: A system administrator may have a stance in which they want to
1043: protect clients that may expose themselves to attack by unwittingly
1044: requesting X11 forwarding, which can warrant a
1045: .Dq no
1046: setting.
1047: .Pp
1048: Note that disabling X11 forwarding does not prevent users from
1049: forwarding X11 traffic, as users can always install their own forwarders.
1.1 stevesk 1050: X11 forwarding is automatically disabled if
1051: .Cm UseLogin
1052: is enabled.
1053: .It Cm X11UseLocalhost
1054: Specifies whether
1.52 jmc 1055: .Xr sshd 8
1.1 stevesk 1056: should bind the X11 forwarding server to the loopback address or to
1.15 jmc 1057: the wildcard address.
1058: By default,
1.52 jmc 1059: sshd binds the forwarding server to the loopback address and sets the
1.1 stevesk 1060: hostname part of the
1061: .Ev DISPLAY
1062: environment variable to
1063: .Dq localhost .
1.8 stevesk 1064: This prevents remote hosts from connecting to the proxy display.
1.1 stevesk 1065: However, some older X11 clients may not function with this
1066: configuration.
1067: .Cm X11UseLocalhost
1068: may be set to
1069: .Dq no
1070: to specify that the forwarding server should be bound to the wildcard
1071: address.
1072: The argument must be
1073: .Dq yes
1074: or
1075: .Dq no .
1076: The default is
1077: .Dq yes .
1078: .It Cm XAuthLocation
1.11 stevesk 1079: Specifies the full pathname of the
1.1 stevesk 1080: .Xr xauth 1
1081: program.
1082: The default is
1083: .Pa /usr/X11R6/bin/xauth .
1084: .El
1.55 jmc 1085: .Sh TIME FORMATS
1.53 jmc 1086: .Xr sshd 8
1.1 stevesk 1087: command-line arguments and configuration file options that specify time
1088: may be expressed using a sequence of the form:
1089: .Sm off
1.7 stevesk 1090: .Ar time Op Ar qualifier ,
1.1 stevesk 1091: .Sm on
1092: where
1093: .Ar time
1094: is a positive integer value and
1095: .Ar qualifier
1096: is one of the following:
1097: .Pp
1098: .Bl -tag -width Ds -compact -offset indent
1.64 jmc 1099: .It Aq Cm none
1.1 stevesk 1100: seconds
1101: .It Cm s | Cm S
1102: seconds
1103: .It Cm m | Cm M
1104: minutes
1105: .It Cm h | Cm H
1106: hours
1107: .It Cm d | Cm D
1108: days
1109: .It Cm w | Cm W
1110: weeks
1111: .El
1112: .Pp
1113: Each member of the sequence is added together to calculate
1114: the total time value.
1115: .Pp
1116: Time format examples:
1117: .Pp
1118: .Bl -tag -width Ds -compact -offset indent
1119: .It 600
1120: 600 seconds (10 minutes)
1121: .It 10m
1122: 10 minutes
1123: .It 1h30m
1124: 1 hour 30 minutes (90 minutes)
1125: .El
1126: .Sh FILES
1127: .Bl -tag -width Ds
1128: .It Pa /etc/ssh/sshd_config
1129: Contains configuration data for
1.53 jmc 1130: .Xr sshd 8 .
1.1 stevesk 1131: This file should be writable by root only, but it is recommended
1132: (though not necessary) that it be world-readable.
1133: .El
1.19 jmc 1134: .Sh SEE ALSO
1135: .Xr sshd 8
1.1 stevesk 1136: .Sh AUTHORS
1137: OpenSSH is a derivative of the original and free
1138: ssh 1.2.12 release by Tatu Ylonen.
1139: Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1140: Theo de Raadt and Dug Song
1141: removed many bugs, re-added newer features and
1142: created OpenSSH.
1143: Markus Friedl contributed the support for SSH
1144: protocol versions 1.5 and 2.0.
1145: Niels Provos and Markus Friedl contributed support
1146: for privilege separation.