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