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