Annotation of src/usr.bin/ssh/sshd_config.5, Revision 1.232
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.232 ! djm 36: .\" $OpenBSD: sshd_config.5,v 1.231 2016/09/07 18:39:24 jmc Exp $
! 37: .Dd $Mdocdate: September 7 2016 $
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.219 jmc 73: The
1.197 dtucker 74: .Ev TERM
1.199 jmc 75: environment variable is always sent whenever the client
1.204 djm 76: requests a pseudo-terminal as it is required by the protocol.
1.30 djm 77: Variables are specified by name, which may contain the wildcard characters
1.51 jmc 78: .Ql *
1.30 djm 79: and
80: .Ql \&? .
1.31 djm 81: Multiple environment variables may be separated by whitespace or spread
1.30 djm 82: across multiple
83: .Cm AcceptEnv
84: directives.
1.31 djm 85: Be warned that some environment variables could be used to bypass restricted
1.30 djm 86: user environments.
87: For this reason, care should be taken in the use of this directive.
88: The default is not to accept any environment variables.
1.37 djm 89: .It Cm AddressFamily
90: Specifies which address family should be used by
1.53 jmc 91: .Xr sshd 8 .
1.37 djm 92: Valid arguments are
93: .Dq any ,
94: .Dq inet
1.52 jmc 95: (use IPv4 only), or
1.37 djm 96: .Dq inet6
97: (use IPv6 only).
98: The default is
99: .Dq any .
1.89 jmc 100: .It Cm AllowAgentForwarding
101: Specifies whether
102: .Xr ssh-agent 1
103: forwarding is permitted.
104: The default is
105: .Dq yes .
106: Note that disabling agent forwarding does not improve security
107: unless users are also denied shell access, as they can always install
108: their own forwarders.
1.1 stevesk 109: .It Cm AllowGroups
110: This keyword can be followed by a list of group name patterns, separated
111: by spaces.
112: If specified, login is allowed only for users whose primary
113: group or supplementary group list matches one of the patterns.
114: Only group names are valid; a numerical group ID is not recognized.
115: By default, login is allowed for all groups.
1.54 jmc 116: The allow/deny directives are processed in the following order:
117: .Cm DenyUsers ,
118: .Cm AllowUsers ,
119: .Cm DenyGroups ,
120: and finally
121: .Cm AllowGroups .
1.49 jmc 122: .Pp
1.161 jmc 123: See PATTERNS in
1.49 jmc 124: .Xr ssh_config 5
125: for more information on patterns.
1.231 jmc 126: .It Cm AllowStreamLocalForwarding
127: Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted.
1.150 djm 128: The available options are
129: .Dq yes
130: or
131: .Dq all
1.231 jmc 132: to allow StreamLocal forwarding,
1.150 djm 133: .Dq no
1.231 jmc 134: to prevent all StreamLocal forwarding,
1.150 djm 135: .Dq local
136: to allow local (from the perspective of
1.151 jmc 137: .Xr ssh 1 )
138: forwarding only or
1.150 djm 139: .Dq remote
140: to allow remote forwarding only.
1.1 stevesk 141: The default is
142: .Dq yes .
1.231 jmc 143: Note that disabling StreamLocal forwarding does not improve security unless
1.1 stevesk 144: users are also denied shell access, as they can always install their
145: own forwarders.
1.231 jmc 146: .It Cm AllowTcpForwarding
147: Specifies whether TCP forwarding is permitted.
1.175 millert 148: The available options are
149: .Dq yes
150: or
151: .Dq all
1.231 jmc 152: to allow TCP forwarding,
1.175 millert 153: .Dq no
1.231 jmc 154: to prevent all TCP forwarding,
1.175 millert 155: .Dq local
156: to allow local (from the perspective of
157: .Xr ssh 1 )
158: forwarding only or
159: .Dq remote
160: to allow remote forwarding only.
161: The default is
162: .Dq yes .
1.231 jmc 163: Note that disabling TCP forwarding does not improve security unless
1.175 millert 164: users are also denied shell access, as they can always install their
165: own forwarders.
1.1 stevesk 166: .It Cm AllowUsers
167: This keyword can be followed by a list of user name patterns, separated
168: by spaces.
1.14 jmc 169: If specified, login is allowed only for user names that
1.1 stevesk 170: match one of the patterns.
171: Only user names are valid; a numerical user ID is not recognized.
172: By default, login is allowed for all users.
173: If the pattern takes the form USER@HOST then USER and HOST
174: are separately checked, restricting logins to particular
175: users from particular hosts.
1.222 jmc 176: HOST criteria may additionally contain addresses to match in CIDR
177: address/masklen format.
1.54 jmc 178: The allow/deny directives are processed in the following order:
179: .Cm DenyUsers ,
180: .Cm AllowUsers ,
181: .Cm DenyGroups ,
182: and finally
183: .Cm AllowGroups .
1.49 jmc 184: .Pp
1.161 jmc 185: See PATTERNS in
1.49 jmc 186: .Xr ssh_config 5
187: for more information on patterns.
1.149 djm 188: .It Cm AuthenticationMethods
189: Specifies the authentication methods that must be successfully completed
190: for a user to be granted access.
191: This option must be followed by one or more comma-separated lists of
1.224 djm 192: authentication method names, or by the single string
193: .Dq any
194: to indicate the default behaviour of accepting any single authentication
1.225 jmc 195: method.
1.224 djm 196: if the default is overridden, then successful authentication requires
197: completion of every method in at least one of these lists.
1.149 djm 198: .Pp
199: For example, an argument of
200: .Dq publickey,password publickey,keyboard-interactive
201: would require the user to complete public key authentication, followed by
202: either password or keyboard interactive authentication.
203: Only methods that are next in one or more lists are offered at each stage,
204: so for this example, it would not be possible to attempt password or
205: keyboard-interactive authentication before public key.
1.157 markus 206: .Pp
207: For keyboard interactive authentication it is also possible to
208: restrict authentication to a specific device by appending a
209: colon followed by the device identifier
210: .Dq bsdauth ,
211: .Dq pam ,
212: or
213: .Dq skey ,
214: depending on the server configuration.
215: For example,
216: .Dq keyboard-interactive:bsdauth
217: would restrict keyboard interactive authentication to the
218: .Dq bsdauth
219: device.
1.185 djm 220: .Pp
221: If the
222: .Dq publickey
1.187 jmc 223: method is listed more than once,
1.185 djm 224: .Xr sshd 8
225: verifies that keys that have been used successfully are not reused for
226: subsequent authentications.
227: For example, an
228: .Cm AuthenticationMethods
229: of
230: .Dq publickey,publickey
231: will require successful authentication using two different public keys.
1.181 djm 232: .Pp
1.149 djm 233: Note that each authentication method listed should also be explicitly enabled
234: in the configuration.
1.224 djm 235: The default
236: .Dq any
237: is not to require multiple authentication; successful completion
1.149 djm 238: of a single authentication method is sufficient.
1.146 djm 239: .It Cm AuthorizedKeysCommand
1.147 jmc 240: Specifies a program to be used to look up the user's public keys.
1.201 djm 241: The program must be owned by root, not writable by group or others and
242: specified by an absolute path.
243: .Pp
244: Arguments to
245: .Cm AuthorizedKeysCommand
246: may be provided using the following tokens, which will be expanded
247: at runtime: %% is replaced by a literal '%', %u is replaced by the
248: username being authenticated, %h is replaced by the home directory
249: of the user being authenticated, %t is replaced with the key type
250: offered for authentication, %f is replaced with the fingerprint of
251: the key, and %k is replaced with the key being offered for authentication.
252: If no arguments are specified then the username of the target user
253: will be supplied.
254: .Pp
255: The program should produce on standard output zero or
1.161 jmc 256: more lines of authorized_keys output (see AUTHORIZED_KEYS in
1.147 jmc 257: .Xr sshd 8 ) .
1.146 djm 258: If a key supplied by AuthorizedKeysCommand does not successfully authenticate
259: and authorize the user then public key authentication continues using the usual
260: .Cm AuthorizedKeysFile
261: files.
262: By default, no AuthorizedKeysCommand is run.
263: .It Cm AuthorizedKeysCommandUser
264: Specifies the user under whose account the AuthorizedKeysCommand is run.
265: It is recommended to use a dedicated user that has no other role on the host
266: than running authorized keys commands.
1.186 djm 267: If
1.181 djm 268: .Cm AuthorizedKeysCommand
1.186 djm 269: is specified but
270: .Cm AuthorizedKeysCommandUser
271: is not, then
272: .Xr sshd 8
273: will refuse to start.
1.1 stevesk 274: .It Cm AuthorizedKeysFile
275: Specifies the file that contains the public keys that can be used
276: for user authentication.
1.124 djm 277: The format is described in the
1.161 jmc 278: AUTHORIZED_KEYS FILE FORMAT
1.124 djm 279: section of
280: .Xr sshd 8 .
1.1 stevesk 281: .Cm AuthorizedKeysFile
282: may contain tokens of the form %T which are substituted during connection
1.52 jmc 283: setup.
1.17 jmc 284: The following tokens are defined: %% is replaced by a literal '%',
1.52 jmc 285: %h is replaced by the home directory of the user being authenticated, and
1.1 stevesk 286: %u is replaced by the username of that user.
287: After expansion,
288: .Cm AuthorizedKeysFile
289: is taken to be an absolute path or one relative to the user's home
290: directory.
1.133 jmc 291: Multiple files may be listed, separated by whitespace.
1.212 djm 292: Alternately this option may be set to
293: .Dq none
294: to skip checking for user keys in files.
1.133 jmc 295: The default is
296: .Dq .ssh/authorized_keys .ssh/authorized_keys2 .
1.202 djm 297: .It Cm AuthorizedPrincipalsCommand
298: Specifies a program to be used to generate the list of allowed
299: certificate principals as per
300: .Cm AuthorizedPrincipalsFile .
301: The program must be owned by root, not writable by group or others and
302: specified by an absolute path.
303: .Pp
304: Arguments to
305: .Cm AuthorizedPrincipalsCommand
306: may be provided using the following tokens, which will be expanded
1.232 ! djm 307: at runtime:
! 308: %% is replaced by a literal '%',
! 309: %u is replaced by the username being authenticated,
! 310: %h is replaced by the home directory of the user being authenticated,
! 311: %t is replaced with type of the certificate being offered,
! 312: %T with the type of the CA key,
! 313: %f is replaced with certificate fingerprint,
! 314: %F with the fingerprint of the CA key,
! 315: %k is replaced with the full base-64 encoded certificate and
! 316: %K is replaced with the base-64 encoded CA key.
! 317: If no arguments are specified then the username of the target user
! 318: will be supplied.
1.202 djm 319: .Pp
320: The program should produce on standard output zero or
321: more lines of
322: .Cm AuthorizedPrincipalsFile
323: output.
324: If either
325: .Cm AuthorizedPrincipalsCommand
326: or
327: .Cm AuthorizedPrincipalsFile
328: is specified, then certificates offered by the client for authentication
329: must contain a principal that is listed.
330: By default, no AuthorizedPrincipalsCommand is run.
331: .It Cm AuthorizedPrincipalsCommandUser
332: Specifies the user under whose account the AuthorizedPrincipalsCommand is run.
333: It is recommended to use a dedicated user that has no other role on the host
334: than running authorized principals commands.
335: If
336: .Cm AuthorizedPrincipalsCommand
337: is specified but
338: .Cm AuthorizedPrincipalsCommandUser
339: is not, then
340: .Xr sshd 8
341: will refuse to start.
1.121 djm 342: .It Cm AuthorizedPrincipalsFile
343: Specifies a file that lists principal names that are accepted for
344: certificate authentication.
345: When using certificates signed by a key listed in
346: .Cm TrustedUserCAKeys ,
347: this file lists names, one of which must appear in the certificate for it
348: to be accepted for authentication.
1.125 jmc 349: Names are listed one per line preceded by key options (as described
1.161 jmc 350: in AUTHORIZED_KEYS FILE FORMAT in
1.125 jmc 351: .Xr sshd 8 ) .
1.124 djm 352: Empty lines and comments starting with
1.121 djm 353: .Ql #
354: are ignored.
355: .Pp
356: .Cm AuthorizedPrincipalsFile
357: may contain tokens of the form %T which are substituted during connection
358: setup.
359: The following tokens are defined: %% is replaced by a literal '%',
360: %h is replaced by the home directory of the user being authenticated, and
361: %u is replaced by the username of that user.
362: After expansion,
363: .Cm AuthorizedPrincipalsFile
364: is taken to be an absolute path or one relative to the user's home
365: directory.
366: .Pp
1.138 djm 367: The default is
368: .Dq none ,
369: i.e. not to use a principals file \(en in this case, the username
1.121 djm 370: of the user must appear in a certificate's principals list for it to be
371: accepted.
372: Note that
373: .Cm AuthorizedPrincipalsFile
374: is only used when authentication proceeds using a CA listed in
375: .Cm TrustedUserCAKeys
376: and is not consulted for certification authorities trusted via
377: .Pa ~/.ssh/authorized_keys ,
378: though the
379: .Cm principals=
380: key option offers a similar facility (see
381: .Xr sshd 8
382: for details).
1.1 stevesk 383: .It Cm Banner
384: The contents of the specified file are sent to the remote user before
385: authentication is allowed.
1.78 djm 386: If the argument is
387: .Dq none
388: then no banner is displayed.
1.1 stevesk 389: By default, no banner is displayed.
390: .It Cm ChallengeResponseAuthentication
1.50 jmc 391: Specifies whether challenge-response authentication is allowed.
1.1 stevesk 392: All authentication styles from
393: .Xr login.conf 5
394: are supported.
395: The default is
396: .Dq yes .
1.80 djm 397: .It Cm ChrootDirectory
1.113 stevesk 398: Specifies the pathname of a directory to
1.80 djm 399: .Xr chroot 2
400: to after authentication.
1.190 deraadt 401: At session startup
402: .Xr sshd 8
403: checks that all components of the pathname are root-owned directories
404: which are not writable by any other user or group.
1.106 stevesk 405: After the chroot,
406: .Xr sshd 8
407: changes the working directory to the user's home directory.
1.80 djm 408: .Pp
1.113 stevesk 409: The pathname may contain the following tokens that are expanded at runtime once
1.80 djm 410: the connecting user has been authenticated: %% is replaced by a literal '%',
411: %h is replaced by the home directory of the user being authenticated, and
412: %u is replaced by the username of that user.
413: .Pp
414: The
415: .Cm ChrootDirectory
416: must contain the necessary files and directories to support the
1.103 stevesk 417: user's session.
1.80 djm 418: For an interactive session this requires at least a shell, typically
419: .Xr sh 1 ,
420: and basic
421: .Pa /dev
422: nodes such as
423: .Xr null 4 ,
424: .Xr zero 4 ,
425: .Xr stdin 4 ,
426: .Xr stdout 4 ,
427: .Xr stderr 4 ,
1.180 jmc 428: and
1.80 djm 429: .Xr tty 4
430: devices.
431: For file transfer sessions using
1.105 jmc 432: .Dq sftp ,
1.80 djm 433: no additional configuration of the environment is necessary if the
1.105 jmc 434: in-process sftp server is used,
1.176 schwarze 435: though sessions which use logging may require
1.104 stevesk 436: .Pa /dev/log
1.176 schwarze 437: inside the chroot directory on some operating systems (see
1.104 stevesk 438: .Xr sftp-server 8
1.81 jmc 439: for details).
1.190 deraadt 440: .Pp
1.191 jmc 441: For safety, it is very important that the directory hierarchy be
1.190 deraadt 442: prevented from modification by other processes on the system (especially
443: those outside the jail).
444: Misconfiguration can lead to unsafe environments which
445: .Xr sshd 8
446: cannot detect.
1.80 djm 447: .Pp
1.215 djm 448: The default is
449: .Dq none ,
450: indicating not to
1.80 djm 451: .Xr chroot 2 .
1.1 stevesk 452: .It Cm Ciphers
1.219 jmc 453: Specifies the ciphers allowed.
1.1 stevesk 454: Multiple ciphers must be comma-separated.
1.208 djm 455: If the specified value begins with a
456: .Sq +
457: character, then the specified ciphers will be appended to the default set
458: instead of replacing them.
459: .Pp
1.167 djm 460: The supported ciphers are:
461: .Pp
1.173 naddy 462: .Bl -item -compact -offset indent
463: .It
464: 3des-cbc
465: .It
466: aes128-cbc
467: .It
468: aes192-cbc
469: .It
470: aes256-cbc
471: .It
472: aes128-ctr
473: .It
474: aes192-ctr
475: .It
476: aes256-ctr
477: .It
478: aes128-gcm@openssh.com
479: .It
480: aes256-gcm@openssh.com
481: .It
482: arcfour
483: .It
484: arcfour128
485: .It
486: arcfour256
487: .It
488: blowfish-cbc
489: .It
490: cast128-cbc
491: .It
492: chacha20-poly1305@openssh.com
493: .El
1.167 djm 494: .Pp
1.52 jmc 495: The default is:
1.173 naddy 496: .Bd -literal -offset indent
1.211 jmc 497: chacha20-poly1305@openssh.com,
1.173 naddy 498: aes128-ctr,aes192-ctr,aes256-ctr,
1.211 jmc 499: aes128-gcm@openssh.com,aes256-gcm@openssh.com
1.1 stevesk 500: .Ed
1.167 djm 501: .Pp
502: The list of available ciphers may also be obtained using the
503: .Fl Q
504: option of
1.188 djm 505: .Xr ssh 1
506: with an argument of
507: .Dq cipher .
1.1 stevesk 508: .It Cm ClientAliveCountMax
1.48 jmc 509: Sets the number of client alive messages (see below) which may be
1.1 stevesk 510: sent without
1.52 jmc 511: .Xr sshd 8
1.17 jmc 512: receiving any messages back from the client.
513: If this threshold is reached while client alive messages are being sent,
1.52 jmc 514: sshd will disconnect the client, terminating the session.
1.17 jmc 515: It is important to note that the use of client alive messages is very
516: different from
1.27 markus 517: .Cm TCPKeepAlive
1.17 jmc 518: (below).
519: The client alive messages are sent through the encrypted channel
520: and therefore will not be spoofable.
521: The TCP keepalive option enabled by
1.27 markus 522: .Cm TCPKeepAlive
1.17 jmc 523: is spoofable.
524: The client alive mechanism is valuable when the client or
1.1 stevesk 525: server depend on knowing when a connection has become inactive.
526: .Pp
1.17 jmc 527: The default value is 3.
528: If
1.1 stevesk 529: .Cm ClientAliveInterval
1.48 jmc 530: (see below) is set to 15, and
1.1 stevesk 531: .Cm ClientAliveCountMax
1.52 jmc 532: is left at the default, unresponsive SSH clients
1.1 stevesk 533: will be disconnected after approximately 45 seconds.
1.42 djm 534: .It Cm ClientAliveInterval
535: Sets a timeout interval in seconds after which if no data has been received
536: from the client,
1.52 jmc 537: .Xr sshd 8
1.42 djm 538: will send a message through the encrypted
539: channel to request a response from the client.
540: The default
541: is 0, indicating that these messages will not be sent to the client.
1.3 markus 542: .It Cm Compression
1.44 markus 543: Specifies whether compression is allowed, or delayed until
544: the user has authenticated successfully.
1.3 markus 545: The argument must be
1.44 markus 546: .Dq yes ,
547: .Dq delayed ,
1.3 markus 548: or
549: .Dq no .
550: The default is
1.44 markus 551: .Dq delayed .
1.1 stevesk 552: .It Cm DenyGroups
553: This keyword can be followed by a list of group name patterns, separated
554: by spaces.
555: Login is disallowed for users whose primary group or supplementary
556: group list matches one of the patterns.
557: Only group names are valid; a numerical group ID is not recognized.
558: By default, login is allowed for all groups.
1.54 jmc 559: The allow/deny directives are processed in the following order:
560: .Cm DenyUsers ,
561: .Cm AllowUsers ,
562: .Cm DenyGroups ,
563: and finally
564: .Cm AllowGroups .
1.49 jmc 565: .Pp
1.161 jmc 566: See PATTERNS in
1.49 jmc 567: .Xr ssh_config 5
568: for more information on patterns.
1.1 stevesk 569: .It Cm DenyUsers
570: This keyword can be followed by a list of user name patterns, separated
571: by spaces.
572: Login is disallowed for user names that match one of the patterns.
573: Only user names are valid; a numerical user ID is not recognized.
574: By default, login is allowed for all users.
575: If the pattern takes the form USER@HOST then USER and HOST
576: are separately checked, restricting logins to particular
577: users from particular hosts.
1.222 jmc 578: HOST criteria may additionally contain addresses to match in CIDR
579: address/masklen format.
1.54 jmc 580: The allow/deny directives are processed in the following order:
581: .Cm DenyUsers ,
582: .Cm AllowUsers ,
583: .Cm DenyGroups ,
584: and finally
585: .Cm AllowGroups .
1.49 jmc 586: .Pp
1.161 jmc 587: See PATTERNS in
1.49 jmc 588: .Xr ssh_config 5
589: for more information on patterns.
1.183 djm 590: .It Cm FingerprintHash
591: Specifies the hash algorithm used when logging key fingerprints.
592: Valid options are:
593: .Dq md5
594: and
595: .Dq sha256 .
596: The default is
597: .Dq sha256 .
1.67 dtucker 598: .It Cm ForceCommand
599: Forces the execution of the command specified by
600: .Cm ForceCommand ,
1.84 djm 601: ignoring any command supplied by the client and
602: .Pa ~/.ssh/rc
603: if present.
1.67 dtucker 604: The command is invoked by using the user's login shell with the -c option.
605: This applies to shell, command, or subsystem execution.
606: It is most useful inside a
607: .Cm Match
608: block.
609: The command originally supplied by the client is available in the
610: .Ev SSH_ORIGINAL_COMMAND
611: environment variable.
1.82 djm 612: Specifying a command of
613: .Dq internal-sftp
614: will force the use of an in-process sftp server that requires no support
615: files when used with
616: .Cm ChrootDirectory .
1.215 djm 617: The default is
618: .Dq none .
1.1 stevesk 619: .It Cm GatewayPorts
620: Specifies whether remote hosts are allowed to connect to ports
621: forwarded for the client.
622: By default,
1.52 jmc 623: .Xr sshd 8
1.15 jmc 624: binds remote port forwardings to the loopback address.
625: This prevents other remote hosts from connecting to forwarded ports.
1.1 stevesk 626: .Cm GatewayPorts
1.52 jmc 627: can be used to specify that sshd
1.39 djm 628: should allow remote port forwardings to bind to non-loopback addresses, thus
629: allowing other hosts to connect.
630: The argument may be
631: .Dq no
632: to force remote port forwardings to be available to the local host only,
1.1 stevesk 633: .Dq yes
1.39 djm 634: to force remote port forwardings to bind to the wildcard address, or
635: .Dq clientspecified
636: to allow the client to select the address to which the forwarding is bound.
1.1 stevesk 637: The default is
638: .Dq no .
1.23 markus 639: .It Cm GSSAPIAuthentication
1.25 markus 640: Specifies whether user authentication based on GSSAPI is allowed.
1.26 djm 641: The default is
1.23 markus 642: .Dq no .
643: .It Cm GSSAPICleanupCredentials
644: Specifies whether to automatically destroy the user's credentials cache
645: on logout.
646: The default is
647: .Dq yes .
1.203 djm 648: .It Cm GSSAPIStrictAcceptorCheck
649: Determines whether to be strict about the identity of the GSSAPI acceptor
650: a client authenticates against.
651: If set to
652: .Dq yes
653: then the client must authenticate against the
654: .Pa host
655: service on the current hostname.
656: If set to
657: .Dq no
658: then the client may authenticate against any service key stored in the
659: machine's default store.
660: This facility is provided to assist with operation on multi homed machines.
661: The default is
662: .Dq yes .
1.189 djm 663: .It Cm HostbasedAcceptedKeyTypes
664: Specifies the key types that will be accepted for hostbased authentication
665: as a comma-separated pattern list.
1.208 djm 666: Alternately if the specified value begins with a
667: .Sq +
668: character, then the specified key types will be appended to the default set
669: instead of replacing them.
1.206 markus 670: The default for this option is:
671: .Bd -literal -offset 3n
672: ecdsa-sha2-nistp256-cert-v01@openssh.com,
673: ecdsa-sha2-nistp384-cert-v01@openssh.com,
674: ecdsa-sha2-nistp521-cert-v01@openssh.com,
675: ssh-ed25519-cert-v01@openssh.com,
676: ssh-rsa-cert-v01@openssh.com,
677: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1.220 djm 678: ssh-ed25519,ssh-rsa
1.206 markus 679: .Ed
680: .Pp
1.189 djm 681: The
682: .Fl Q
683: option of
684: .Xr ssh 1
685: may be used to list supported key types.
1.1 stevesk 686: .It Cm HostbasedAuthentication
687: Specifies whether rhosts or /etc/hosts.equiv authentication together
688: with successful public key client host authentication is allowed
1.50 jmc 689: (host-based authentication).
1.70 dtucker 690: The default is
691: .Dq no .
692: .It Cm HostbasedUsesNameFromPacketOnly
693: Specifies whether or not the server will attempt to perform a reverse
694: name lookup when matching the name in the
695: .Pa ~/.shosts ,
696: .Pa ~/.rhosts ,
697: and
698: .Pa /etc/hosts.equiv
699: files during
700: .Cm HostbasedAuthentication .
701: A setting of
702: .Dq yes
703: means that
704: .Xr sshd 8
705: uses the name supplied by the client rather than
706: attempting to resolve the name from the TCP connection itself.
1.1 stevesk 707: The default is
708: .Dq no .
1.117 djm 709: .It Cm HostCertificate
710: Specifies a file containing a public host certificate.
711: The certificate's public key must match a private host key already specified
712: by
713: .Cm HostKey .
714: The default behaviour of
715: .Xr sshd 8
716: is not to load any certificates.
1.1 stevesk 717: .It Cm HostKey
718: Specifies a file containing a private host key
719: used by SSH.
1.229 naddy 720: The defaults are
1.126 djm 721: .Pa /etc/ssh/ssh_host_dsa_key ,
1.169 naddy 722: .Pa /etc/ssh/ssh_host_ecdsa_key ,
723: .Pa /etc/ssh/ssh_host_ed25519_key
1.126 djm 724: and
1.229 naddy 725: .Pa /etc/ssh/ssh_host_rsa_key .
1.206 markus 726: .Pp
1.1 stevesk 727: Note that
1.52 jmc 728: .Xr sshd 8
1.206 markus 729: will refuse to use a file if it is group/world-accessible
730: and that the
731: .Cm HostKeyAlgorithms
732: option restricts which of the keys are actually used by
733: .Xr sshd 8 .
734: .Pp
1.1 stevesk 735: It is possible to have multiple host key files.
1.162 markus 736: It is also possible to specify public host key files instead.
737: In this case operations on the private key will be delegated
738: to an
739: .Xr ssh-agent 1 .
740: .It Cm HostKeyAgent
741: Identifies the UNIX-domain socket used to communicate
742: with an agent that has access to the private host keys.
1.223 markus 743: If the string
1.162 markus 744: .Dq SSH_AUTH_SOCK
745: is specified, the location of the socket will be read from the
746: .Ev SSH_AUTH_SOCK
747: environment variable.
1.206 markus 748: .It Cm HostKeyAlgorithms
1.219 jmc 749: Specifies the host key algorithms
1.206 markus 750: that the server offers.
751: The default for this option is:
752: .Bd -literal -offset 3n
753: ecdsa-sha2-nistp256-cert-v01@openssh.com,
754: ecdsa-sha2-nistp384-cert-v01@openssh.com,
755: ecdsa-sha2-nistp521-cert-v01@openssh.com,
756: ssh-ed25519-cert-v01@openssh.com,
757: ssh-rsa-cert-v01@openssh.com,
758: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1.220 djm 759: ssh-ed25519,ssh-rsa
1.206 markus 760: .Ed
761: .Pp
762: The list of available key types may also be obtained using the
763: .Fl Q
764: option of
765: .Xr ssh 1
766: with an argument of
767: .Dq key .
1.1 stevesk 768: .It Cm IgnoreRhosts
769: Specifies that
770: .Pa .rhosts
771: and
772: .Pa .shosts
773: files will not be used in
774: .Cm HostbasedAuthentication .
775: .Pp
776: .Pa /etc/hosts.equiv
777: and
778: .Pa /etc/shosts.equiv
779: are still used.
780: The default is
781: .Dq yes .
782: .It Cm IgnoreUserKnownHosts
783: Specifies whether
1.52 jmc 784: .Xr sshd 8
1.1 stevesk 785: should ignore the user's
1.41 djm 786: .Pa ~/.ssh/known_hosts
1.1 stevesk 787: during
788: .Cm HostbasedAuthentication .
789: The default is
790: .Dq no .
1.129 djm 791: .It Cm IPQoS
792: Specifies the IPv4 type-of-service or DSCP class for the connection.
793: Accepted values are
794: .Dq af11 ,
795: .Dq af12 ,
796: .Dq af13 ,
1.136 djm 797: .Dq af21 ,
1.129 djm 798: .Dq af22 ,
799: .Dq af23 ,
800: .Dq af31 ,
801: .Dq af32 ,
802: .Dq af33 ,
803: .Dq af41 ,
804: .Dq af42 ,
805: .Dq af43 ,
806: .Dq cs0 ,
807: .Dq cs1 ,
808: .Dq cs2 ,
809: .Dq cs3 ,
810: .Dq cs4 ,
811: .Dq cs5 ,
812: .Dq cs6 ,
813: .Dq cs7 ,
814: .Dq ef ,
815: .Dq lowdelay ,
816: .Dq throughput ,
817: .Dq reliability ,
818: or a numeric value.
1.131 djm 819: This option may take one or two arguments, separated by whitespace.
1.129 djm 820: If one argument is specified, it is used as the packet class unconditionally.
821: If two values are specified, the first is automatically selected for
822: interactive sessions and the second for non-interactive sessions.
823: The default is
824: .Dq lowdelay
825: for interactive sessions and
826: .Dq throughput
827: for non-interactive sessions.
1.171 jmc 828: .It Cm KbdInteractiveAuthentication
829: Specifies whether to allow keyboard-interactive authentication.
830: The argument to this keyword must be
831: .Dq yes
832: or
833: .Dq no .
834: The default is to use whatever value
835: .Cm ChallengeResponseAuthentication
836: is set to
837: (by default
838: .Dq yes ) .
1.1 stevesk 839: .It Cm KerberosAuthentication
1.24 markus 840: Specifies whether the password provided by the user for
1.1 stevesk 841: .Cm PasswordAuthentication
1.24 markus 842: will be validated through the Kerberos KDC.
1.1 stevesk 843: To use this option, the server needs a
844: Kerberos servtab which allows the verification of the KDC's identity.
1.52 jmc 845: The default is
1.29 dtucker 846: .Dq no .
847: .It Cm KerberosGetAFSToken
1.45 djm 848: If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
1.29 dtucker 849: an AFS token before accessing the user's home directory.
1.52 jmc 850: The default is
1.1 stevesk 851: .Dq no .
852: .It Cm KerberosOrLocalPasswd
1.52 jmc 853: If password authentication through Kerberos fails then
1.1 stevesk 854: the password will be validated via any additional local mechanism
855: such as
856: .Pa /etc/passwd .
1.52 jmc 857: The default is
1.1 stevesk 858: .Dq yes .
859: .It Cm KerberosTicketCleanup
860: Specifies whether to automatically destroy the user's ticket cache
861: file on logout.
1.52 jmc 862: The default is
1.1 stevesk 863: .Dq yes .
1.127 djm 864: .It Cm KexAlgorithms
865: Specifies the available KEX (Key Exchange) algorithms.
866: Multiple algorithms must be comma-separated.
1.208 djm 867: Alternately if the specified value begins with a
868: .Sq +
869: character, then the specified methods will be appended to the default set
870: instead of replacing them.
1.173 naddy 871: The supported algorithms are:
872: .Pp
873: .Bl -item -compact -offset indent
874: .It
875: curve25519-sha256@libssh.org
876: .It
877: diffie-hellman-group1-sha1
878: .It
879: diffie-hellman-group14-sha1
880: .It
881: diffie-hellman-group-exchange-sha1
882: .It
883: diffie-hellman-group-exchange-sha256
884: .It
885: ecdh-sha2-nistp256
886: .It
887: ecdh-sha2-nistp384
888: .It
889: ecdh-sha2-nistp521
890: .El
891: .Pp
892: The default is:
1.170 dtucker 893: .Bd -literal -offset indent
894: curve25519-sha256@libssh.org,
895: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
896: diffie-hellman-group-exchange-sha256,
1.173 naddy 897: diffie-hellman-group14-sha1
1.170 dtucker 898: .Ed
1.188 djm 899: .Pp
900: The list of available key exchange algorithms may also be obtained using the
901: .Fl Q
902: option of
903: .Xr ssh 1
904: with an argument of
905: .Dq kex .
1.1 stevesk 906: .It Cm ListenAddress
907: Specifies the local addresses
1.52 jmc 908: .Xr sshd 8
1.1 stevesk 909: should listen on.
910: The following forms may be used:
911: .Pp
912: .Bl -item -offset indent -compact
913: .It
914: .Cm ListenAddress
915: .Sm off
1.180 jmc 916: .Ar host | Ar IPv4_addr | Ar IPv6_addr
1.1 stevesk 917: .Sm on
918: .It
919: .Cm ListenAddress
920: .Sm off
1.180 jmc 921: .Ar host | Ar IPv4_addr : Ar port
1.1 stevesk 922: .Sm on
923: .It
924: .Cm ListenAddress
925: .Sm off
926: .Oo
1.180 jmc 927: .Ar host | Ar IPv6_addr Oc : Ar port
1.1 stevesk 928: .Sm on
929: .El
930: .Pp
931: If
932: .Ar port
933: is not specified,
1.200 dtucker 934: sshd will listen on the address and all
1.1 stevesk 935: .Cm Port
1.17 jmc 936: options specified.
937: The default is to listen on all local addresses.
1.15 jmc 938: Multiple
1.1 stevesk 939: .Cm ListenAddress
1.17 jmc 940: options are permitted.
1.1 stevesk 941: .It Cm LoginGraceTime
942: The server disconnects after this time if the user has not
943: successfully logged in.
944: If the value is 0, there is no time limit.
1.12 stevesk 945: The default is 120 seconds.
1.1 stevesk 946: .It Cm LogLevel
947: Gives the verbosity level that is used when logging messages from
1.53 jmc 948: .Xr sshd 8 .
1.1 stevesk 949: The possible values are:
1.52 jmc 950: QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
1.15 jmc 951: The default is INFO.
952: DEBUG and DEBUG1 are equivalent.
953: DEBUG2 and DEBUG3 each specify higher levels of debugging output.
954: Logging with a DEBUG level violates the privacy of users and is not recommended.
1.1 stevesk 955: .It Cm MACs
956: Specifies the available MAC (message authentication code) algorithms.
1.219 jmc 957: The MAC algorithm is used for data integrity protection.
1.1 stevesk 958: Multiple algorithms must be comma-separated.
1.208 djm 959: If the specified value begins with a
960: .Sq +
961: character, then the specified algorithms will be appended to the default set
962: instead of replacing them.
963: .Pp
1.152 markus 964: The algorithms that contain
965: .Dq -etm
966: calculate the MAC after encryption (encrypt-then-mac).
967: These are considered safer and their use recommended.
1.173 naddy 968: The supported MACs are:
969: .Pp
970: .Bl -item -compact -offset indent
971: .It
972: hmac-md5
973: .It
974: hmac-md5-96
975: .It
976: hmac-ripemd160
977: .It
978: hmac-sha1
979: .It
980: hmac-sha1-96
981: .It
982: hmac-sha2-256
983: .It
984: hmac-sha2-512
985: .It
986: umac-64@openssh.com
987: .It
988: umac-128@openssh.com
989: .It
990: hmac-md5-etm@openssh.com
991: .It
992: hmac-md5-96-etm@openssh.com
993: .It
994: hmac-ripemd160-etm@openssh.com
995: .It
996: hmac-sha1-etm@openssh.com
997: .It
998: hmac-sha1-96-etm@openssh.com
999: .It
1000: hmac-sha2-256-etm@openssh.com
1001: .It
1002: hmac-sha2-512-etm@openssh.com
1003: .It
1004: umac-64-etm@openssh.com
1005: .It
1006: umac-128-etm@openssh.com
1007: .El
1008: .Pp
1.52 jmc 1009: The default is:
1.77 jmc 1010: .Bd -literal -offset indent
1.152 markus 1011: umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1012: hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
1.217 djm 1013: hmac-sha1-etm@openssh.com,
1.173 naddy 1014: umac-64@openssh.com,umac-128@openssh.com,
1.217 djm 1015: hmac-sha2-256,hmac-sha2-512,hmac-sha1
1.77 jmc 1016: .Ed
1.188 djm 1017: .Pp
1018: The list of available MAC algorithms may also be obtained using the
1019: .Fl Q
1020: option of
1021: .Xr ssh 1
1022: with an argument of
1023: .Dq mac .
1.60 dtucker 1024: .It Cm Match
1.61 jmc 1025: Introduces a conditional block.
1.65 dtucker 1026: If all of the criteria on the
1.60 dtucker 1027: .Cm Match
1.65 dtucker 1028: line are satisfied, the keywords on the following lines override those
1029: set in the global section of the config file, until either another
1.60 dtucker 1030: .Cm Match
1.65 dtucker 1031: line or the end of the file.
1.172 djm 1032: If a keyword appears in multiple
1033: .Cm Match
1.177 sobrado 1034: blocks that are satisfied, only the first instance of the keyword is
1.172 djm 1035: applied.
1.91 djm 1036: .Pp
1.61 jmc 1037: The arguments to
1.60 dtucker 1038: .Cm Match
1.163 dtucker 1039: are one or more criteria-pattern pairs or the single token
1040: .Cm All
1041: which matches all criteria.
1.60 dtucker 1042: The available criteria are
1043: .Cm User ,
1.69 dtucker 1044: .Cm Group ,
1.60 dtucker 1045: .Cm Host ,
1.139 dtucker 1046: .Cm LocalAddress ,
1047: .Cm LocalPort ,
1.60 dtucker 1048: and
1049: .Cm Address .
1.91 djm 1050: The match patterns may consist of single entries or comma-separated
1051: lists and may use the wildcard and negation operators described in the
1.161 jmc 1052: PATTERNS section of
1.92 djm 1053: .Xr ssh_config 5 .
1.91 djm 1054: .Pp
1055: The patterns in an
1056: .Cm Address
1057: criteria may additionally contain addresses to match in CIDR
1.93 jmc 1058: address/masklen format, e.g.\&
1.91 djm 1059: .Dq 192.0.2.0/24
1060: or
1.228 jca 1061: .Dq 2001:db8::/32 .
1.91 djm 1062: Note that the mask length provided must be consistent with the address -
1063: it is an error to specify a mask length that is too long for the address
1.93 jmc 1064: or one with bits set in this host portion of the address.
1065: For example,
1.91 djm 1066: .Dq 192.0.2.0/33
1067: and
1.93 jmc 1068: .Dq 192.0.2.0/8
1.91 djm 1069: respectively.
1070: .Pp
1.60 dtucker 1071: Only a subset of keywords may be used on the lines following a
1072: .Cm Match
1073: keyword.
1074: Available keywords are
1.142 jmc 1075: .Cm AcceptEnv ,
1.99 okan 1076: .Cm AllowAgentForwarding ,
1.142 jmc 1077: .Cm AllowGroups ,
1.193 djm 1078: .Cm AllowStreamLocalForwarding ,
1.62 dtucker 1079: .Cm AllowTcpForwarding ,
1.141 markus 1080: .Cm AllowUsers ,
1.149 djm 1081: .Cm AuthenticationMethods ,
1.146 djm 1082: .Cm AuthorizedKeysCommand ,
1083: .Cm AuthorizedKeysCommandUser ,
1.147 jmc 1084: .Cm AuthorizedKeysFile ,
1.214 djm 1085: .Cm AuthorizedPrincipalsCommand ,
1086: .Cm AuthorizedPrincipalsCommandUser ,
1.123 djm 1087: .Cm AuthorizedPrincipalsFile ,
1.72 dtucker 1088: .Cm Banner ,
1.85 djm 1089: .Cm ChrootDirectory ,
1.141 markus 1090: .Cm DenyGroups ,
1091: .Cm DenyUsers ,
1.67 dtucker 1092: .Cm ForceCommand ,
1.194 djm 1093: .Cm GatewayPorts ,
1.193 djm 1094: .Cm GSSAPIAuthentication ,
1.189 djm 1095: .Cm HostbasedAcceptedKeyTypes ,
1.87 djm 1096: .Cm HostbasedAuthentication ,
1.123 djm 1097: .Cm HostbasedUsesNameFromPacketOnly ,
1.193 djm 1098: .Cm IPQoS ,
1.74 jmc 1099: .Cm KbdInteractiveAuthentication ,
1.72 dtucker 1100: .Cm KerberosAuthentication ,
1.95 dtucker 1101: .Cm MaxAuthTries ,
1.94 dtucker 1102: .Cm MaxSessions ,
1.72 dtucker 1103: .Cm PasswordAuthentication ,
1.97 djm 1104: .Cm PermitEmptyPasswords ,
1.66 dtucker 1105: .Cm PermitOpen ,
1.79 dtucker 1106: .Cm PermitRootLogin ,
1.164 djm 1107: .Cm PermitTTY ,
1.123 djm 1108: .Cm PermitTunnel ,
1.174 djm 1109: .Cm PermitUserRC ,
1.189 djm 1110: .Cm PubkeyAcceptedKeyTypes ,
1.107 dtucker 1111: .Cm PubkeyAuthentication ,
1.159 dtucker 1112: .Cm RekeyLimit ,
1.193 djm 1113: .Cm RevokedKeys ,
1114: .Cm StreamLocalBindMask ,
1115: .Cm StreamLocalBindUnlink ,
1116: .Cm TrustedUserCAKeys ,
1.66 dtucker 1117: .Cm X11DisplayOffset ,
1.101 djm 1118: .Cm X11Forwarding
1.60 dtucker 1119: and
1.102 djm 1120: .Cm X11UseLocalHost .
1.33 dtucker 1121: .It Cm MaxAuthTries
1122: Specifies the maximum number of authentication attempts permitted per
1.35 jmc 1123: connection.
1124: Once the number of failures reaches half this value,
1125: additional failures are logged.
1126: The default is 6.
1.90 djm 1127: .It Cm MaxSessions
1.216 djm 1128: Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1129: sessions permitted per network connection.
1130: Multiple sessions may be established by clients that support connection
1131: multiplexing.
1132: Setting
1133: .Cm MaxSessions
1134: to 1 will effectively disable session multiplexing, whereas setting it to 0
1135: will prevent all shell, login and subsystem sessions while still permitting
1136: forwarding.
1.90 djm 1137: The default is 10.
1.1 stevesk 1138: .It Cm MaxStartups
1139: Specifies the maximum number of concurrent unauthenticated connections to the
1.52 jmc 1140: SSH daemon.
1.1 stevesk 1141: Additional connections will be dropped until authentication succeeds or the
1142: .Cm LoginGraceTime
1143: expires for a connection.
1.156 dtucker 1144: The default is 10:30:100.
1.1 stevesk 1145: .Pp
1146: Alternatively, random early drop can be enabled by specifying
1147: the three colon separated values
1148: .Dq start:rate:full
1.51 jmc 1149: (e.g. "10:30:60").
1.53 jmc 1150: .Xr sshd 8
1.1 stevesk 1151: will refuse connection attempts with a probability of
1152: .Dq rate/100
1153: (30%)
1154: if there are currently
1155: .Dq start
1156: (10)
1157: unauthenticated connections.
1158: The probability increases linearly and all connection attempts
1159: are refused if the number of unauthenticated connections reaches
1160: .Dq full
1161: (60).
1162: .It Cm PasswordAuthentication
1163: Specifies whether password authentication is allowed.
1164: The default is
1165: .Dq yes .
1166: .It Cm PermitEmptyPasswords
1167: When password authentication is allowed, it specifies whether the
1168: server allows login to accounts with empty password strings.
1169: The default is
1170: .Dq no .
1.62 dtucker 1171: .It Cm PermitOpen
1172: Specifies the destinations to which TCP port forwarding is permitted.
1173: The forwarding specification must be one of the following forms:
1174: .Pp
1175: .Bl -item -offset indent -compact
1176: .It
1177: .Cm PermitOpen
1178: .Sm off
1179: .Ar host : port
1180: .Sm on
1181: .It
1182: .Cm PermitOpen
1183: .Sm off
1184: .Ar IPv4_addr : port
1185: .Sm on
1186: .It
1187: .Cm PermitOpen
1188: .Sm off
1189: .Ar \&[ IPv6_addr \&] : port
1190: .Sm on
1191: .El
1192: .Pp
1.68 dtucker 1193: Multiple forwards may be specified by separating them with whitespace.
1.62 dtucker 1194: An argument of
1195: .Dq any
1196: can be used to remove all restrictions and permit any forwarding requests.
1.140 dtucker 1197: An argument of
1198: .Dq none
1199: can be used to prohibit all forwarding requests.
1.227 jmc 1200: The wildcard
1.226 dtucker 1201: .Dq *
1.227 jmc 1202: can be used for host or port to allow all hosts or ports, respectively.
1.63 jmc 1203: By default all port forwarding requests are permitted.
1.1 stevesk 1204: .It Cm PermitRootLogin
1.38 jmc 1205: Specifies whether root can log in using
1.1 stevesk 1206: .Xr ssh 1 .
1207: The argument must be
1208: .Dq yes ,
1.210 deraadt 1209: .Dq prohibit-password ,
1.1 stevesk 1210: .Dq without-password ,
1.52 jmc 1211: .Dq forced-commands-only ,
1.1 stevesk 1212: or
1213: .Dq no .
1214: The default is
1.210 deraadt 1215: .Dq prohibit-password .
1.1 stevesk 1216: .Pp
1217: If this option is set to
1.210 deraadt 1218: .Dq prohibit-password
1219: or
1.52 jmc 1220: .Dq without-password ,
1.210 deraadt 1221: password and keyboard-interactive authentication are disabled for root.
1.1 stevesk 1222: .Pp
1223: If this option is set to
1.52 jmc 1224: .Dq forced-commands-only ,
1.1 stevesk 1225: root login with public key authentication will be allowed,
1226: but only if the
1227: .Ar command
1228: option has been specified
1229: (which may be useful for taking remote backups even if root login is
1.17 jmc 1230: normally not allowed).
1231: All other authentication methods are disabled for root.
1.1 stevesk 1232: .Pp
1233: If this option is set to
1.52 jmc 1234: .Dq no ,
1.38 jmc 1235: root is not allowed to log in.
1.231 jmc 1236: .It Cm PermitTTY
1237: Specifies whether
1238: .Xr pty 4
1239: allocation is permitted.
1240: The default is
1241: .Dq yes .
1.46 reyk 1242: .It Cm PermitTunnel
1243: Specifies whether
1244: .Xr tun 4
1245: device forwarding is allowed.
1.47 reyk 1246: The argument must be
1247: .Dq yes ,
1.58 stevesk 1248: .Dq point-to-point
1249: (layer 3),
1250: .Dq ethernet
1251: (layer 2), or
1.47 reyk 1252: .Dq no .
1.58 stevesk 1253: Specifying
1254: .Dq yes
1255: permits both
1256: .Dq point-to-point
1257: and
1258: .Dq ethernet .
1.46 reyk 1259: The default is
1260: .Dq no .
1.178 djm 1261: .Pp
1262: Independent of this setting, the permissions of the selected
1263: .Xr tun 4
1264: device must allow access to the user.
1.6 markus 1265: .It Cm PermitUserEnvironment
1266: Specifies whether
1267: .Pa ~/.ssh/environment
1.9 stevesk 1268: and
1.6 markus 1269: .Cm environment=
1270: options in
1271: .Pa ~/.ssh/authorized_keys
1.9 stevesk 1272: are processed by
1.52 jmc 1273: .Xr sshd 8 .
1.6 markus 1274: The default is
1275: .Dq no .
1.9 stevesk 1276: Enabling environment processing may enable users to bypass access
1277: restrictions in some configurations using mechanisms such as
1278: .Ev LD_PRELOAD .
1.174 djm 1279: .It Cm PermitUserRC
1280: Specifies whether any
1281: .Pa ~/.ssh/rc
1282: file is executed.
1283: The default is
1284: .Dq yes .
1.1 stevesk 1285: .It Cm PidFile
1.4 stevesk 1286: Specifies the file that contains the process ID of the
1.195 dtucker 1287: SSH daemon, or
1288: .Dq none
1289: to not write one.
1.1 stevesk 1290: The default is
1291: .Pa /var/run/sshd.pid .
1292: .It Cm Port
1293: Specifies the port number that
1.52 jmc 1294: .Xr sshd 8
1.1 stevesk 1295: listens on.
1296: The default is 22.
1297: Multiple options of this type are permitted.
1298: See also
1299: .Cm ListenAddress .
1300: .It Cm PrintLastLog
1301: Specifies whether
1.52 jmc 1302: .Xr sshd 8
1.36 jaredy 1303: should print the date and time of the last user login when a user logs
1304: in interactively.
1.1 stevesk 1305: The default is
1306: .Dq yes .
1307: .It Cm PrintMotd
1308: Specifies whether
1.52 jmc 1309: .Xr sshd 8
1.1 stevesk 1310: should print
1311: .Pa /etc/motd
1312: when a user logs in interactively.
1313: (On some systems it is also printed by the shell,
1314: .Pa /etc/profile ,
1315: or equivalent.)
1316: The default is
1317: .Dq yes .
1.189 djm 1318: .It Cm PubkeyAcceptedKeyTypes
1319: Specifies the key types that will be accepted for public key authentication
1320: as a comma-separated pattern list.
1.208 djm 1321: Alternately if the specified value begins with a
1322: .Sq +
1323: character, then the specified key types will be appended to the default set
1324: instead of replacing them.
1.206 markus 1325: The default for this option is:
1326: .Bd -literal -offset 3n
1327: ecdsa-sha2-nistp256-cert-v01@openssh.com,
1328: ecdsa-sha2-nistp384-cert-v01@openssh.com,
1329: ecdsa-sha2-nistp521-cert-v01@openssh.com,
1330: ssh-ed25519-cert-v01@openssh.com,
1331: ssh-rsa-cert-v01@openssh.com,
1332: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1.220 djm 1333: ssh-ed25519,ssh-rsa
1.206 markus 1334: .Ed
1335: .Pp
1.189 djm 1336: The
1337: .Fl Q
1338: option of
1339: .Xr ssh 1
1340: may be used to list supported key types.
1.1 stevesk 1341: .It Cm PubkeyAuthentication
1342: Specifies whether public key authentication is allowed.
1343: The default is
1344: .Dq yes .
1.159 dtucker 1345: .It Cm RekeyLimit
1346: Specifies the maximum amount of data that may be transmitted before the
1347: session key is renegotiated, optionally followed a maximum amount of
1348: time that may pass before the session key is renegotiated.
1349: The first argument is specified in bytes and may have a suffix of
1350: .Sq K ,
1351: .Sq M ,
1352: or
1353: .Sq G
1354: to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1355: The default is between
1356: .Sq 1G
1357: and
1358: .Sq 4G ,
1359: depending on the cipher.
1360: The optional second value is specified in seconds and may use any of the
1361: units documented in the
1362: .Sx TIME FORMATS
1.160 jmc 1363: section.
1.159 dtucker 1364: The default value for
1365: .Cm RekeyLimit
1366: is
1367: .Dq default none ,
1368: which means that rekeying is performed after the cipher's default amount
1369: of data has been sent or received and no time based rekeying is done.
1.118 djm 1370: .It Cm RevokedKeys
1.195 dtucker 1371: Specifies revoked public keys file, or
1372: .Dq none
1373: to not use one.
1.118 djm 1374: Keys listed in this file will be refused for public key authentication.
1375: Note that if this file is not readable, then public key authentication will
1376: be refused for all users.
1.154 djm 1377: Keys may be specified as a text file, listing one public key per line, or as
1378: an OpenSSH Key Revocation List (KRL) as generated by
1.155 jmc 1379: .Xr ssh-keygen 1 .
1.161 jmc 1380: For more information on KRLs, see the KEY REVOCATION LISTS section in
1.154 djm 1381: .Xr ssh-keygen 1 .
1.175 millert 1382: .It Cm StreamLocalBindMask
1383: Sets the octal file creation mode mask
1384: .Pq umask
1385: used when creating a Unix-domain socket file for local or remote
1386: port forwarding.
1387: This option is only used for port forwarding to a Unix-domain socket file.
1388: .Pp
1389: The default value is 0177, which creates a Unix-domain socket file that is
1390: readable and writable only by the owner.
1391: Note that not all operating systems honor the file mode on Unix-domain
1392: socket files.
1393: .It Cm StreamLocalBindUnlink
1394: Specifies whether to remove an existing Unix-domain socket file for local
1395: or remote port forwarding before creating a new one.
1396: If the socket file already exists and
1397: .Cm StreamLocalBindUnlink
1398: is not enabled,
1399: .Nm sshd
1400: will be unable to forward the port to the Unix-domain socket file.
1401: This option is only used for port forwarding to a Unix-domain socket file.
1402: .Pp
1403: The argument must be
1404: .Dq yes
1405: or
1406: .Dq no .
1407: The default is
1408: .Dq no .
1.1 stevesk 1409: .It Cm StrictModes
1410: Specifies whether
1.52 jmc 1411: .Xr sshd 8
1.1 stevesk 1412: should check file modes and ownership of the
1413: user's files and home directory before accepting login.
1414: This is normally desirable because novices sometimes accidentally leave their
1415: directory or files world-writable.
1416: The default is
1417: .Dq yes .
1.112 djm 1418: Note that this does not apply to
1419: .Cm ChrootDirectory ,
1420: whose permissions and ownership are checked unconditionally.
1.1 stevesk 1421: .It Cm Subsystem
1.51 jmc 1422: Configures an external subsystem (e.g. file transfer daemon).
1.59 djm 1423: Arguments should be a subsystem name and a command (with optional arguments)
1424: to execute upon subsystem request.
1.80 djm 1425: .Pp
1.1 stevesk 1426: The command
1427: .Xr sftp-server 8
1428: implements the
1429: .Dq sftp
1430: file transfer subsystem.
1.80 djm 1431: .Pp
1432: Alternately the name
1433: .Dq internal-sftp
1434: implements an in-process
1435: .Dq sftp
1436: server.
1437: This may simplify configurations using
1438: .Cm ChrootDirectory
1439: to force a different filesystem root on clients.
1440: .Pp
1.1 stevesk 1441: By default no subsystems are defined.
1442: .It Cm SyslogFacility
1443: Gives the facility code that is used when logging messages from
1.53 jmc 1444: .Xr sshd 8 .
1.1 stevesk 1445: The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1446: LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1447: The default is AUTH.
1.27 markus 1448: .It Cm TCPKeepAlive
1449: Specifies whether the system should send TCP keepalive messages to the
1450: other side.
1451: If they are sent, death of the connection or crash of one
1452: of the machines will be properly noticed.
1453: However, this means that
1454: connections will die if the route is down temporarily, and some people
1455: find it annoying.
1456: On the other hand, if TCP keepalives are not sent,
1457: sessions may hang indefinitely on the server, leaving
1458: .Dq ghost
1459: users and consuming server resources.
1460: .Pp
1461: The default is
1462: .Dq yes
1463: (to send TCP keepalive messages), and the server will notice
1464: if the network goes down or the client host crashes.
1465: This avoids infinitely hanging sessions.
1466: .Pp
1467: To disable TCP keepalive messages, the value should be set to
1468: .Dq no .
1.118 djm 1469: .It Cm TrustedUserCAKeys
1470: Specifies a file containing public keys of certificate authorities that are
1.195 dtucker 1471: trusted to sign user certificates for authentication, or
1472: .Dq none
1473: to not use one.
1.119 jmc 1474: Keys are listed one per line; empty lines and comments starting with
1.118 djm 1475: .Ql #
1476: are allowed.
1477: If a certificate is presented for authentication and has its signing CA key
1478: listed in this file, then it may be used for authentication for any user
1479: listed in the certificate's principals list.
1480: Note that certificates that lack a list of principals will not be permitted
1481: for authentication using
1482: .Cm TrustedUserCAKeys .
1.161 jmc 1483: For more details on certificates, see the CERTIFICATES section in
1.118 djm 1484: .Xr ssh-keygen 1 .
1.18 markus 1485: .It Cm UseDNS
1486: Specifies whether
1.52 jmc 1487: .Xr sshd 8
1.207 djm 1488: should look up the remote host name, and to check that
1.18 markus 1489: the resolved host name for the remote IP address maps back to the
1490: very same IP address.
1.207 djm 1491: .Pp
1492: If this option is set to
1493: .Dq no
1494: (the default) then only addresses and not host names may be used in
1.221 djm 1495: .Pa ~/.ssh/authorized_keys
1.207 djm 1496: .Cm from
1497: and
1.211 jmc 1498: .Nm
1.207 djm 1499: .Cm Match
1500: .Cm Host
1501: directives.
1.1 stevesk 1502: .It Cm UsePrivilegeSeparation
1503: Specifies whether
1.52 jmc 1504: .Xr sshd 8
1.2 stevesk 1505: separates privileges by creating an unprivileged child process
1.15 jmc 1506: to deal with incoming network traffic.
1507: After successful authentication, another process will be created that has
1508: the privilege of the authenticated user.
1509: The goal of privilege separation is to prevent privilege
1.1 stevesk 1510: escalation by containing any corruption within the unprivileged processes.
1.213 sobrado 1511: The argument must be
1512: .Dq yes ,
1513: .Dq no ,
1514: or
1515: .Dq sandbox .
1.134 djm 1516: If
1517: .Cm UsePrivilegeSeparation
1518: is set to
1519: .Dq sandbox
1520: then the pre-authentication unprivileged process is subject to additional
1521: restrictions.
1.213 sobrado 1522: The default is
1523: .Dq sandbox .
1.137 djm 1524: .It Cm VersionAddendum
1525: Optionally specifies additional text to append to the SSH protocol banner
1526: sent by the server upon connection.
1527: The default is
1528: .Dq none .
1.1 stevesk 1529: .It Cm X11DisplayOffset
1530: Specifies the first display number available for
1.52 jmc 1531: .Xr sshd 8 Ns 's
1.1 stevesk 1532: X11 forwarding.
1.52 jmc 1533: This prevents sshd from interfering with real X11 servers.
1.1 stevesk 1534: The default is 10.
1535: .It Cm X11Forwarding
1536: Specifies whether X11 forwarding is permitted.
1.13 stevesk 1537: The argument must be
1538: .Dq yes
1539: or
1540: .Dq no .
1.1 stevesk 1541: The default is
1542: .Dq no .
1.13 stevesk 1543: .Pp
1544: When X11 forwarding is enabled, there may be additional exposure to
1545: the server and to client displays if the
1.52 jmc 1546: .Xr sshd 8
1.13 stevesk 1547: proxy display is configured to listen on the wildcard address (see
1548: .Cm X11UseLocalhost
1.52 jmc 1549: below), though this is not the default.
1.13 stevesk 1550: Additionally, the authentication spoofing and authentication data
1551: verification and substitution occur on the client side.
1552: The security risk of using X11 forwarding is that the client's X11
1.52 jmc 1553: display server may be exposed to attack when the SSH client requests
1.13 stevesk 1554: forwarding (see the warnings for
1555: .Cm ForwardX11
1556: in
1.19 jmc 1557: .Xr ssh_config 5 ) .
1.13 stevesk 1558: A system administrator may have a stance in which they want to
1559: protect clients that may expose themselves to attack by unwittingly
1560: requesting X11 forwarding, which can warrant a
1561: .Dq no
1562: setting.
1563: .Pp
1564: Note that disabling X11 forwarding does not prevent users from
1565: forwarding X11 traffic, as users can always install their own forwarders.
1.1 stevesk 1566: .It Cm X11UseLocalhost
1567: Specifies whether
1.52 jmc 1568: .Xr sshd 8
1.1 stevesk 1569: should bind the X11 forwarding server to the loopback address or to
1.15 jmc 1570: the wildcard address.
1571: By default,
1.52 jmc 1572: sshd binds the forwarding server to the loopback address and sets the
1.1 stevesk 1573: hostname part of the
1574: .Ev DISPLAY
1575: environment variable to
1576: .Dq localhost .
1.8 stevesk 1577: This prevents remote hosts from connecting to the proxy display.
1.1 stevesk 1578: However, some older X11 clients may not function with this
1579: configuration.
1580: .Cm X11UseLocalhost
1581: may be set to
1582: .Dq no
1583: to specify that the forwarding server should be bound to the wildcard
1584: address.
1585: The argument must be
1586: .Dq yes
1587: or
1588: .Dq no .
1589: The default is
1590: .Dq yes .
1591: .It Cm XAuthLocation
1.11 stevesk 1592: Specifies the full pathname of the
1.1 stevesk 1593: .Xr xauth 1
1.195 dtucker 1594: program, or
1595: .Dq none
1596: to not use one.
1.1 stevesk 1597: The default is
1598: .Pa /usr/X11R6/bin/xauth .
1599: .El
1.55 jmc 1600: .Sh TIME FORMATS
1.53 jmc 1601: .Xr sshd 8
1.1 stevesk 1602: command-line arguments and configuration file options that specify time
1603: may be expressed using a sequence of the form:
1604: .Sm off
1.7 stevesk 1605: .Ar time Op Ar qualifier ,
1.1 stevesk 1606: .Sm on
1607: where
1608: .Ar time
1609: is a positive integer value and
1610: .Ar qualifier
1611: is one of the following:
1612: .Pp
1613: .Bl -tag -width Ds -compact -offset indent
1.64 jmc 1614: .It Aq Cm none
1.1 stevesk 1615: seconds
1616: .It Cm s | Cm S
1617: seconds
1618: .It Cm m | Cm M
1619: minutes
1620: .It Cm h | Cm H
1621: hours
1622: .It Cm d | Cm D
1623: days
1624: .It Cm w | Cm W
1625: weeks
1626: .El
1627: .Pp
1628: Each member of the sequence is added together to calculate
1629: the total time value.
1630: .Pp
1631: Time format examples:
1632: .Pp
1633: .Bl -tag -width Ds -compact -offset indent
1634: .It 600
1635: 600 seconds (10 minutes)
1636: .It 10m
1637: 10 minutes
1638: .It 1h30m
1639: 1 hour 30 minutes (90 minutes)
1640: .El
1641: .Sh FILES
1642: .Bl -tag -width Ds
1643: .It Pa /etc/ssh/sshd_config
1644: Contains configuration data for
1.53 jmc 1645: .Xr sshd 8 .
1.1 stevesk 1646: This file should be writable by root only, but it is recommended
1647: (though not necessary) that it be world-readable.
1648: .El
1.19 jmc 1649: .Sh SEE ALSO
1650: .Xr sshd 8
1.1 stevesk 1651: .Sh AUTHORS
1652: OpenSSH is a derivative of the original and free
1653: ssh 1.2.12 release by Tatu Ylonen.
1654: Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1655: Theo de Raadt and Dug Song
1656: removed many bugs, re-added newer features and
1657: created OpenSSH.
1658: Markus Friedl contributed the support for SSH
1659: protocol versions 1.5 and 2.0.
1660: Niels Provos and Markus Friedl contributed support
1661: for privilege separation.