Annotation of src/usr.bin/ssh/ssh_config.5, Revision 1.389
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.389 ! djm 36: .\" $OpenBSD: ssh_config.5,v 1.388 2023/10/04 05:42:10 jmc Exp $
1.388 jmc 37: .Dd $Mdocdate: October 4 2023 $
1.1 stevesk 38: .Dt SSH_CONFIG 5
39: .Os
40: .Sh NAME
41: .Nm ssh_config
1.310 jmc 42: .Nd OpenSSH client configuration file
1.1 stevesk 43: .Sh DESCRIPTION
1.84 jmc 44: .Xr ssh 1
1.1 stevesk 45: obtains configuration data from the following sources in
46: the following order:
1.79 jmc 47: .Pp
1.2 stevesk 48: .Bl -enum -offset indent -compact
49: .It
50: command-line options
51: .It
52: user's configuration file
1.50 djm 53: .Pq Pa ~/.ssh/config
1.2 stevesk 54: .It
55: system-wide configuration file
56: .Pq Pa /etc/ssh/ssh_config
57: .El
1.1 stevesk 58: .Pp
1.379 djm 59: Unless noted otherwise, for each parameter, the first obtained value
1.1 stevesk 60: will be used.
1.41 jmc 61: The configuration files contain sections separated by
1.240 jmc 62: .Cm Host
1.1 stevesk 63: specifications, and that section is only applied for hosts that
64: match one of the patterns given in the specification.
1.193 djm 65: The matched host name is usually the one given on the command line
66: (see the
67: .Cm CanonicalizeHostname
1.240 jmc 68: option for exceptions).
1.1 stevesk 69: .Pp
70: Since the first obtained value for each parameter is used, more
71: host-specific declarations should be given near the beginning of the
72: file, and general defaults at the end.
1.80 jmc 73: .Pp
1.240 jmc 74: The file contains keyword-argument pairs, one per line.
75: Lines starting with
1.1 stevesk 76: .Ql #
1.240 jmc 77: and empty lines are interpreted as comments.
78: Arguments may optionally be enclosed in double quotes
79: .Pq \&"
80: in order to represent arguments containing spaces.
1.1 stevesk 81: Configuration options may be separated by whitespace or
82: optional whitespace and exactly one
83: .Ql = ;
84: the latter format is useful to avoid the need to quote whitespace
85: when specifying configuration options using the
86: .Nm ssh ,
1.87 jmc 87: .Nm scp ,
1.1 stevesk 88: and
89: .Nm sftp
90: .Fl o
91: option.
92: .Pp
93: The possible
94: keywords and their meanings are as follows (note that
95: keywords are case-insensitive and arguments are case-sensitive):
96: .Bl -tag -width Ds
97: .It Cm Host
98: Restricts the following declarations (up to the next
99: .Cm Host
1.169 djm 100: or
101: .Cm Match
1.1 stevesk 102: keyword) to be only for those hosts that match one of the patterns
103: given after the keyword.
1.112 krw 104: If more than one pattern is provided, they should be separated by whitespace.
1.1 stevesk 105: A single
1.83 jmc 106: .Ql *
1.1 stevesk 107: as a pattern can be used to provide global
108: defaults for all hosts.
1.193 djm 109: The host is usually the
1.1 stevesk 110: .Ar hostname
1.193 djm 111: argument given on the command line
112: (see the
113: .Cm CanonicalizeHostname
1.240 jmc 114: keyword for exceptions).
1.148 djm 115: .Pp
116: A pattern entry may be negated by prefixing it with an exclamation mark
117: .Pq Sq !\& .
118: If a negated entry is matched, then the
119: .Cm Host
120: entry is ignored, regardless of whether any other patterns on the line
121: match.
122: Negated matches are therefore useful to provide exceptions for wildcard
123: matches.
1.81 jmc 124: .Pp
125: See
126: .Sx PATTERNS
127: for more information on patterns.
1.170 jmc 128: .It Cm Match
1.169 djm 129: Restricts the following declarations (up to the next
130: .Cm Host
131: or
132: .Cm Match
133: keyword) to be used only when the conditions following the
134: .Cm Match
135: keyword are satisfied.
1.220 sobrado 136: Match conditions are specified using one or more criteria
1.178 dtucker 137: or the single token
138: .Cm all
1.193 djm 139: which always matches.
140: The available criteria keywords are:
141: .Cm canonical ,
1.287 djm 142: .Cm final ,
1.176 djm 143: .Cm exec ,
1.381 djm 144: .Cm localnetwork ,
1.169 djm 145: .Cm host ,
146: .Cm originalhost ,
1.382 djm 147: .Cm Tag ,
1.169 djm 148: .Cm user ,
149: and
150: .Cm localuser .
1.193 djm 151: The
152: .Cm all
153: criteria must appear alone or immediately after
1.287 djm 154: .Cm canonical
155: or
156: .Cm final .
1.193 djm 157: Other criteria may be combined arbitrarily.
158: All criteria but
1.288 jmc 159: .Cm all ,
160: .Cm canonical ,
1.193 djm 161: and
1.287 djm 162: .Cm final
1.193 djm 163: require an argument.
164: Criteria may be negated by prepending an exclamation mark
165: .Pq Sq !\& .
1.169 djm 166: .Pp
1.177 jmc 167: The
1.193 djm 168: .Cm canonical
1.210 dtucker 169: keyword matches only when the configuration file is being re-parsed
1.193 djm 170: after hostname canonicalization (see the
171: .Cm CanonicalizeHostname
1.288 jmc 172: option).
1.193 djm 173: This may be useful to specify conditions that work with canonical host
174: names only.
1.287 djm 175: .Pp
176: The
177: .Cm final
178: keyword requests that the configuration be re-parsed (regardless of whether
179: .Cm CanonicalizeHostname
180: is enabled), and matches only during this final pass.
181: If
182: .Cm CanonicalizeHostname
183: is enabled, then
184: .Cm canonical
185: and
186: .Cm final
187: match during the same pass.
188: .Pp
1.193 djm 189: The
1.176 djm 190: .Cm exec
1.177 jmc 191: keyword executes the specified command under the user's shell.
1.169 djm 192: If the command returns a zero exit status then the condition is considered true.
193: Commands containing whitespace characters must be quoted.
1.239 jmc 194: Arguments to
195: .Cm exec
196: accept the tokens described in the
197: .Sx TOKENS
198: section.
1.381 djm 199: .Pp
200: The
201: .Cm localnetwork
202: keyword matches the addresses of active local network interfaces against the
203: supplied list of networks in CIDR format.
204: This may be convenient for varying the effective configuration on devices that
205: roam between networks.
206: Note that network address is not a trustworthy criteria in many
207: situations (e.g. when the network is automatically configured using DHCP)
208: and so caution should be applied if using it to control security-sensitive
209: configuration.
1.169 djm 210: .Pp
211: The other keywords' criteria must be single entries or comma-separated
212: lists and may use the wildcard and negation operators described in the
213: .Sx PATTERNS
214: section.
215: The criteria for the
216: .Cm host
217: keyword are matched against the target hostname, after any substitution
218: by the
1.295 jmc 219: .Cm Hostname
1.193 djm 220: or
221: .Cm CanonicalizeHostname
222: options.
1.169 djm 223: The
224: .Cm originalhost
225: keyword matches against the hostname as it was specified on the command-line.
226: The
1.382 djm 227: .Cm tagged
228: keyword matches a tag name specified by a prior
229: .Cm Tag
230: directive or on the
231: .Xr ssh 1
232: command-line using the
233: .Fl P
234: flag.
235: The
1.169 djm 236: .Cm user
237: keyword matches against the target username on the remote host.
238: The
239: .Cm localuser
240: keyword matches against the name of the local user running
241: .Xr ssh 1
242: (this keyword may be useful in system-wide
243: .Nm
244: files).
1.222 jcs 245: .It Cm AddKeysToAgent
246: Specifies whether keys should be automatically added to a running
1.223 jmc 247: .Xr ssh-agent 1 .
1.222 jcs 248: If this option is set to
1.240 jmc 249: .Cm yes
1.222 jcs 250: and a key is loaded from a file, the key and its passphrase are added to
251: the agent with the default lifetime, as if by
252: .Xr ssh-add 1 .
253: If this option is set to
1.240 jmc 254: .Cm ask ,
255: .Xr ssh 1
1.222 jcs 256: will require confirmation using the
257: .Ev SSH_ASKPASS
258: program before adding a key (see
259: .Xr ssh-add 1
260: for details).
261: If this option is set to
1.240 jmc 262: .Cm confirm ,
1.222 jcs 263: each use of the key must be confirmed, as if the
264: .Fl c
265: option was specified to
266: .Xr ssh-add 1 .
267: If this option is set to
1.240 jmc 268: .Cm no ,
1.222 jcs 269: no keys are added to the agent.
1.332 djm 270: Alternately, this option may be specified as a time interval
271: using the format described in the
272: .Sx TIME FORMATS
273: section of
274: .Xr sshd_config 5
275: to specify the key's lifetime in
276: .Xr ssh-agent 1 ,
277: after which it will automatically be removed.
1.222 jcs 278: The argument must be
1.332 djm 279: .Cm no
280: (the default),
1.240 jmc 281: .Cm yes ,
1.332 djm 282: .Cm confirm
283: (optionally followed by a time interval),
284: .Cm ask
285: or a time interval.
1.10 djm 286: .It Cm AddressFamily
1.11 jmc 287: Specifies which address family to use when connecting.
288: Valid arguments are
1.240 jmc 289: .Cm any
290: (the default),
291: .Cm inet
1.84 jmc 292: (use IPv4 only), or
1.240 jmc 293: .Cm inet6
1.40 jmc 294: (use IPv6 only).
1.1 stevesk 295: .It Cm BatchMode
296: If set to
1.240 jmc 297: .Cm yes ,
1.318 djm 298: user interaction such as password prompts and host key confirmation requests
299: will be disabled.
1.1 stevesk 300: This option is useful in scripts and other batch jobs where no user
1.318 djm 301: is present to interact with
302: .Xr ssh 1 .
1.1 stevesk 303: The argument must be
1.240 jmc 304: .Cm yes
1.1 stevesk 305: or
1.240 jmc 306: .Cm no
307: (the default).
1.268 jmc 308: .It Cm BindAddress
309: Use the specified address on the local machine as the source address of
310: the connection.
311: Only useful on systems with more than one address.
312: .It Cm BindInterface
313: Use the address of the specified interface on the local machine as the
314: source address of the connection.
1.171 djm 315: .It Cm CanonicalDomains
1.172 jmc 316: When
1.173 djm 317: .Cm CanonicalizeHostname
1.171 djm 318: is enabled, this option specifies the list of domain suffixes in which to
319: search for the specified destination host.
1.173 djm 320: .It Cm CanonicalizeFallbackLocal
1.174 djm 321: Specifies whether to fail with an error when hostname canonicalization fails.
1.172 jmc 322: The default,
1.240 jmc 323: .Cm yes ,
1.172 jmc 324: will attempt to look up the unqualified hostname using the system resolver's
1.171 djm 325: search rules.
326: A value of
1.240 jmc 327: .Cm no
1.171 djm 328: will cause
329: .Xr ssh 1
330: to fail instantly if
1.173 djm 331: .Cm CanonicalizeHostname
1.171 djm 332: is enabled and the target hostname cannot be found in any of the domains
333: specified by
334: .Cm CanonicalDomains .
1.173 djm 335: .It Cm CanonicalizeHostname
1.174 djm 336: Controls whether explicit hostname canonicalization is performed.
1.172 jmc 337: The default,
1.240 jmc 338: .Cm no ,
1.171 djm 339: is not to perform any name rewriting and let the system resolver handle all
340: hostname lookups.
341: If set to
1.240 jmc 342: .Cm yes
1.171 djm 343: then, for connections that do not use a
1.284 djm 344: .Cm ProxyCommand
345: or
346: .Cm ProxyJump ,
1.171 djm 347: .Xr ssh 1
1.173 djm 348: will attempt to canonicalize the hostname specified on the command line
1.171 djm 349: using the
350: .Cm CanonicalDomains
351: suffixes and
1.173 djm 352: .Cm CanonicalizePermittedCNAMEs
1.171 djm 353: rules.
354: If
1.173 djm 355: .Cm CanonicalizeHostname
1.171 djm 356: is set to
1.240 jmc 357: .Cm always ,
1.174 djm 358: then canonicalization is applied to proxied connections too.
1.185 djm 359: .Pp
1.193 djm 360: If this option is enabled, then the configuration files are processed
361: again using the new target name to pick up any new configuration in matching
1.185 djm 362: .Cm Host
1.193 djm 363: and
364: .Cm Match
1.185 djm 365: stanzas.
1.361 dtucker 366: A value of
367: .Cm none
368: disables the use of a
369: .Cm ProxyJump
370: host.
1.173 djm 371: .It Cm CanonicalizeMaxDots
1.172 jmc 372: Specifies the maximum number of dot characters in a hostname before
1.174 djm 373: canonicalization is disabled.
1.240 jmc 374: The default, 1,
1.172 jmc 375: allows a single dot (i.e. hostname.subdomain).
1.173 djm 376: .It Cm CanonicalizePermittedCNAMEs
1.172 jmc 377: Specifies rules to determine whether CNAMEs should be followed when
1.173 djm 378: canonicalizing hostnames.
1.171 djm 379: The rules consist of one or more arguments of
1.172 jmc 380: .Ar source_domain_list : Ns Ar target_domain_list ,
1.171 djm 381: where
382: .Ar source_domain_list
1.174 djm 383: is a pattern-list of domains that may follow CNAMEs in canonicalization,
1.171 djm 384: and
385: .Ar target_domain_list
1.172 jmc 386: is a pattern-list of domains that they may resolve to.
1.171 djm 387: .Pp
388: For example,
1.240 jmc 389: .Qq *.a.example.com:*.b.example.com,*.c.example.com
1.171 djm 390: will allow hostnames matching
1.240 jmc 391: .Qq *.a.example.com
1.173 djm 392: to be canonicalized to names in the
1.240 jmc 393: .Qq *.b.example.com
1.171 djm 394: or
1.240 jmc 395: .Qq *.c.example.com
1.171 djm 396: domains.
1.365 djm 397: .Pp
398: A single argument of
399: .Qq none
400: causes no CNAMEs to be considered for canonicalization.
401: This is the default behaviour.
1.283 jmc 402: .It Cm CASignatureAlgorithms
403: Specifies which algorithms are allowed for signing of certificates
404: by certificate authorities (CAs).
405: The default is:
406: .Bd -literal -offset indent
1.362 djm 407: ssh-ed25519,ecdsa-sha2-nistp256,
408: ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
409: sk-ssh-ed25519@openssh.com,
410: sk-ecdsa-sha2-nistp256@openssh.com,
1.351 djm 411: rsa-sha2-512,rsa-sha2-256
1.283 jmc 412: .Ed
1.362 djm 413: .Pp
414: If the specified list begins with a
415: .Sq +
416: character, then the specified algorithms will be appended to the default set
417: instead of replacing them.
418: If the specified list begins with a
419: .Sq -
420: character, then the specified algorithms (including wildcards) will be removed
421: from the default set instead of replacing them.
1.283 jmc 422: .Pp
423: .Xr ssh 1
424: will not accept host certificates signed using algorithms other than those
425: specified.
1.221 djm 426: .It Cm CertificateFile
427: Specifies a file from which the user's certificate is read.
428: A corresponding private key must be provided separately in order
429: to use this certificate either
430: from an
431: .Cm IdentityFile
432: directive or
433: .Fl i
434: flag to
435: .Xr ssh 1 ,
436: via
437: .Xr ssh-agent 1 ,
438: or via a
1.305 naddy 439: .Cm PKCS11Provider
440: or
441: .Cm SecurityKeyProvider .
1.221 djm 442: .Pp
1.239 jmc 443: Arguments to
444: .Cm CertificateFile
1.326 dtucker 445: may use the tilde syntax to refer to a user's home directory,
446: the tokens described in the
1.239 jmc 447: .Sx TOKENS
1.326 dtucker 448: section and environment variables as described in the
449: .Sx ENVIRONMENT VARIABLES
1.239 jmc 450: section.
1.221 djm 451: .Pp
452: It is possible to have multiple certificate files specified in
453: configuration files; these certificates will be tried in sequence.
454: Multiple
455: .Cm CertificateFile
456: directives will add to the list of certificates used for
457: authentication.
1.1 stevesk 458: .It Cm CheckHostIP
1.240 jmc 459: If set to
1.370 naddy 460: .Cm yes ,
1.84 jmc 461: .Xr ssh 1
462: will additionally check the host IP address in the
1.1 stevesk 463: .Pa known_hosts
464: file.
1.240 jmc 465: This allows it to detect if a host key changed due to DNS spoofing
1.211 djm 466: and will add addresses of destination hosts to
467: .Pa ~/.ssh/known_hosts
468: in the process, regardless of the setting of
469: .Cm StrictHostKeyChecking .
1.107 grunk 470: If the option is set to
1.341 djm 471: .Cm no
472: (the default),
1.1 stevesk 473: the check will not be executed.
474: .It Cm Ciphers
1.245 djm 475: Specifies the ciphers allowed and their order of preference.
1.1 stevesk 476: Multiple ciphers must be comma-separated.
1.299 kn 477: If the specified list begins with a
1.214 djm 478: .Sq +
479: character, then the specified ciphers will be appended to the default set
480: instead of replacing them.
1.299 kn 481: If the specified list begins with a
1.241 djm 482: .Sq -
483: character, then the specified ciphers (including wildcards) will be removed
484: from the default set instead of replacing them.
1.301 naddy 485: If the specified list begins with a
486: .Sq ^
487: character, then the specified ciphers will be placed at the head of the
488: default set.
1.214 djm 489: .Pp
1.180 djm 490: The supported ciphers are:
1.240 jmc 491: .Bd -literal -offset indent
1.186 naddy 492: 3des-cbc
493: aes128-cbc
494: aes192-cbc
495: aes256-cbc
496: aes128-ctr
497: aes192-ctr
498: aes256-ctr
499: aes128-gcm@openssh.com
500: aes256-gcm@openssh.com
501: chacha20-poly1305@openssh.com
1.240 jmc 502: .Ed
1.180 djm 503: .Pp
1.84 jmc 504: The default is:
1.186 naddy 505: .Bd -literal -offset indent
1.215 jmc 506: chacha20-poly1305@openssh.com,
1.186 naddy 507: aes128-ctr,aes192-ctr,aes256-ctr,
1.270 djm 508: aes128-gcm@openssh.com,aes256-gcm@openssh.com
1.1 stevesk 509: .Ed
1.180 djm 510: .Pp
1.240 jmc 511: The list of available ciphers may also be obtained using
512: .Qq ssh -Q cipher .
1.1 stevesk 513: .It Cm ClearAllForwardings
1.84 jmc 514: Specifies that all local, remote, and dynamic port forwardings
1.1 stevesk 515: specified in the configuration files or on the command line be
1.7 jmc 516: cleared.
517: This option is primarily useful when used from the
1.84 jmc 518: .Xr ssh 1
1.1 stevesk 519: command line to clear port forwardings set in
520: configuration files, and is automatically set by
521: .Xr scp 1
522: and
523: .Xr sftp 1 .
524: The argument must be
1.240 jmc 525: .Cm yes
1.1 stevesk 526: or
1.240 jmc 527: .Cm no
528: (the default).
1.1 stevesk 529: .It Cm Compression
530: Specifies whether to use compression.
531: The argument must be
1.240 jmc 532: .Cm yes
1.1 stevesk 533: or
1.240 jmc 534: .Cm no
535: (the default).
1.247 naddy 536: .It Cm ConnectionAttempts
537: Specifies the number of tries (one per second) to make before exiting.
538: The argument must be an integer.
539: This may be useful in scripts if the connection sometimes fails.
540: The default is 1.
1.9 djm 541: .It Cm ConnectTimeout
1.84 jmc 542: Specifies the timeout (in seconds) used when connecting to the
543: SSH server, instead of using the default system TCP timeout.
1.302 djm 544: This timeout is applied both to establishing the connection and to performing
545: the initial SSH protocol handshake and key exchange.
1.36 djm 546: .It Cm ControlMaster
547: Enables the sharing of multiple sessions over a single network connection.
548: When set to
1.240 jmc 549: .Cm yes ,
1.84 jmc 550: .Xr ssh 1
1.36 djm 551: will listen for connections on a control socket specified using the
552: .Cm ControlPath
553: argument.
554: Additional sessions can connect to this socket using the same
555: .Cm ControlPath
556: with
557: .Cm ControlMaster
558: set to
1.240 jmc 559: .Cm no
1.38 jmc 560: (the default).
1.64 jmc 561: These sessions will try to reuse the master instance's network connection
1.63 djm 562: rather than initiating new ones, but will fall back to connecting normally
563: if the control socket does not exist, or is not listening.
564: .Pp
1.37 djm 565: Setting this to
1.240 jmc 566: .Cm ask
567: will cause
568: .Xr ssh 1
1.206 jmc 569: to listen for control connections, but require confirmation using
570: .Xr ssh-askpass 1 .
1.51 jakob 571: If the
572: .Cm ControlPath
1.84 jmc 573: cannot be opened,
1.240 jmc 574: .Xr ssh 1
575: will continue without connecting to a master instance.
1.58 djm 576: .Pp
577: X11 and
1.59 jmc 578: .Xr ssh-agent 1
1.58 djm 579: forwarding is supported over these multiplexed connections, however the
1.70 stevesk 580: display and agent forwarded will be the one belonging to the master
1.59 jmc 581: connection i.e. it is not possible to forward multiple displays or agents.
1.56 djm 582: .Pp
583: Two additional options allow for opportunistic multiplexing: try to use a
584: master connection but fall back to creating a new one if one does not already
585: exist.
586: These options are:
1.240 jmc 587: .Cm auto
1.56 djm 588: and
1.240 jmc 589: .Cm autoask .
1.56 djm 590: The latter requires confirmation like the
1.240 jmc 591: .Cm ask
1.56 djm 592: option.
1.36 djm 593: .It Cm ControlPath
1.55 djm 594: Specify the path to the control socket used for connection sharing as described
595: in the
1.36 djm 596: .Cm ControlMaster
1.57 djm 597: section above or the string
1.240 jmc 598: .Cm none
1.57 djm 599: to disable connection sharing.
1.239 jmc 600: Arguments to
601: .Cm ControlPath
1.326 dtucker 602: may use the tilde syntax to refer to a user's home directory,
603: the tokens described in the
1.239 jmc 604: .Sx TOKENS
1.326 dtucker 605: section and environment variables as described in the
606: .Sx ENVIRONMENT VARIABLES
1.239 jmc 607: section.
1.56 djm 608: It is recommended that any
609: .Cm ControlPath
610: used for opportunistic connection sharing include
1.195 djm 611: at least %h, %p, and %r (or alternatively %C) and be placed in a directory
612: that is not writable by other users.
1.56 djm 613: This ensures that shared connections are uniquely identified.
1.137 djm 614: .It Cm ControlPersist
615: When used in conjunction with
616: .Cm ControlMaster ,
617: specifies that the master connection should remain open
618: in the background (waiting for future client connections)
619: after the initial client connection has been closed.
620: If set to
1.314 naddy 621: .Cm no
622: (the default),
1.137 djm 623: then the master connection will not be placed into the background,
624: and will close as soon as the initial client connection is closed.
625: If set to
1.240 jmc 626: .Cm yes
627: or 0,
1.137 djm 628: then the master connection will remain in the background indefinitely
629: (until killed or closed via a mechanism such as the
1.240 jmc 630: .Qq ssh -O exit ) .
1.137 djm 631: If set to a time in seconds, or a time in any of the formats documented in
632: .Xr sshd_config 5 ,
633: then the backgrounded master connection will automatically terminate
634: after it has remained idle (with no client connections) for the
635: specified time.
1.38 jmc 636: .It Cm DynamicForward
1.74 jmc 637: Specifies that a TCP port on the local machine be forwarded
1.38 jmc 638: over the secure channel, and the application
639: protocol is then used to determine where to connect to from the
640: remote machine.
1.62 djm 641: .Pp
642: The argument must be
643: .Sm off
644: .Oo Ar bind_address : Oc Ar port .
645: .Sm on
1.138 djm 646: IPv6 addresses can be specified by enclosing addresses in square brackets.
1.62 djm 647: By default, the local port is bound in accordance with the
648: .Cm GatewayPorts
649: setting.
650: However, an explicit
651: .Ar bind_address
652: may be used to bind the connection to a specific address.
653: The
654: .Ar bind_address
655: of
1.240 jmc 656: .Cm localhost
1.62 djm 657: indicates that the listening port be bound for local use only, while an
658: empty address or
659: .Sq *
660: indicates that the port should be available from all interfaces.
661: .Pp
1.38 jmc 662: Currently the SOCKS4 and SOCKS5 protocols are supported, and
1.84 jmc 663: .Xr ssh 1
1.38 jmc 664: will act as a SOCKS server.
665: Multiple forwardings may be specified, and
666: additional forwardings can be given on the command line.
667: Only the superuser can forward privileged ports.
1.376 djm 668: .It Cm EnableEscapeCommandline
669: Enables the command line option in the
670: .Cm EscapeChar
671: menu for interactive sessions (default
672: .Ql ~C ) .
673: By default, the command line is disabled.
1.14 markus 674: .It Cm EnableSSHKeysign
675: Setting this option to
1.240 jmc 676: .Cm yes
1.14 markus 677: in the global client configuration file
678: .Pa /etc/ssh/ssh_config
679: enables the use of the helper program
680: .Xr ssh-keysign 8
681: during
682: .Cm HostbasedAuthentication .
683: The argument must be
1.240 jmc 684: .Cm yes
1.14 markus 685: or
1.240 jmc 686: .Cm no
687: (the default).
1.23 jmc 688: This option should be placed in the non-hostspecific section.
1.14 markus 689: See
690: .Xr ssh-keysign 8
691: for more information.
1.1 stevesk 692: .It Cm EscapeChar
693: Sets the escape character (default:
694: .Ql ~ ) .
695: The escape character can also
696: be set on the command line.
697: The argument should be a single character,
698: .Ql ^
699: followed by a letter, or
1.240 jmc 700: .Cm none
1.1 stevesk 701: to disable the escape
702: character entirely (making the connection transparent for binary
703: data).
1.96 markus 704: .It Cm ExitOnForwardFailure
705: Specifies whether
706: .Xr ssh 1
707: should terminate the connection if it cannot set up all requested
1.216 djm 708: dynamic, tunnel, local, and remote port forwardings, (e.g.\&
1.217 jmc 709: if either end is unable to bind and listen on a specified port).
1.216 djm 710: Note that
711: .Cm ExitOnForwardFailure
712: does not apply to connections made over port forwardings and will not,
713: for example, cause
714: .Xr ssh 1
715: to exit if TCP connections to the ultimate forwarding destination fail.
1.96 markus 716: The argument must be
1.240 jmc 717: .Cm yes
1.96 markus 718: or
1.240 jmc 719: .Cm no
720: (the default).
1.197 djm 721: .It Cm FingerprintHash
722: Specifies the hash algorithm used when displaying key fingerprints.
723: Valid options are:
1.240 jmc 724: .Cm md5
1.197 djm 725: and
1.240 jmc 726: .Cm sha256
1.359 djm 727: (the default).
728: .It Cm ForkAfterAuthentication
729: Requests
730: .Nm ssh
731: to go to background just before command execution.
732: This is useful if
733: .Nm ssh
734: is going to ask for passwords or passphrases, but the user
735: wants it in the background.
736: This implies the
737: .Cm StdinNull
738: configuration option being set to
739: .Dq yes .
740: The recommended way to start X11 programs at a remote site is with
741: something like
742: .Ic ssh -f host xterm ,
743: which is the same as
744: .Ic ssh host xterm
745: if the
746: .Cm ForkAfterAuthentication
747: configuration option is set to
748: .Dq yes .
749: .Pp
750: If the
751: .Cm ExitOnForwardFailure
752: configuration option is set to
753: .Dq yes ,
754: then a client started with the
755: .Cm ForkAfterAuthentication
756: configuration option being set to
757: .Dq yes
758: will wait for all remote port forwards to be successfully established
759: before placing itself in the background.
760: The argument to this keyword must be
761: .Cm yes
762: (same as the
763: .Fl f
764: option) or
765: .Cm no
1.240 jmc 766: (the default).
1.1 stevesk 767: .It Cm ForwardAgent
768: Specifies whether the connection to the authentication agent (if any)
769: will be forwarded to the remote machine.
1.312 djm 770: The argument may be
771: .Cm yes ,
1.240 jmc 772: .Cm no
1.312 djm 773: (the default),
774: an explicit path to an agent socket or the name of an environment variable
775: (beginning with
776: .Sq $ )
777: in which to find the path.
1.3 stevesk 778: .Pp
1.7 jmc 779: Agent forwarding should be enabled with caution.
780: Users with the ability to bypass file permissions on the remote host
781: (for the agent's Unix-domain socket)
782: can access the local agent through the forwarded connection.
783: An attacker cannot obtain key material from the agent,
1.3 stevesk 784: however they can perform operations on the keys that enable them to
785: authenticate using the identities loaded into the agent.
1.1 stevesk 786: .It Cm ForwardX11
787: Specifies whether X11 connections will be automatically redirected
788: over the secure channel and
789: .Ev DISPLAY
790: set.
791: The argument must be
1.240 jmc 792: .Cm yes
1.1 stevesk 793: or
1.240 jmc 794: .Cm no
795: (the default).
1.3 stevesk 796: .Pp
1.7 jmc 797: X11 forwarding should be enabled with caution.
798: Users with the ability to bypass file permissions on the remote host
1.22 markus 799: (for the user's X11 authorization database)
1.7 jmc 800: can access the local X11 display through the forwarded connection.
1.22 markus 801: An attacker may then be able to perform activities such as keystroke monitoring
802: if the
803: .Cm ForwardX11Trusted
804: option is also enabled.
1.134 djm 805: .It Cm ForwardX11Timeout
1.135 jmc 806: Specify a timeout for untrusted X11 forwarding
807: using the format described in the
1.240 jmc 808: .Sx TIME FORMATS
809: section of
1.134 djm 810: .Xr sshd_config 5 .
811: X11 connections received by
812: .Xr ssh 1
813: after this time will be refused.
1.285 djm 814: Setting
815: .Cm ForwardX11Timeout
816: to zero will disable the timeout and permit X11 forwarding for the life
817: of the connection.
1.134 djm 818: The default is to disable untrusted X11 forwarding after twenty minutes has
819: elapsed.
1.22 markus 820: .It Cm ForwardX11Trusted
1.34 jmc 821: If this option is set to
1.240 jmc 822: .Cm yes ,
1.84 jmc 823: remote X11 clients will have full access to the original X11 display.
1.42 djm 824: .Pp
1.22 markus 825: If this option is set to
1.240 jmc 826: .Cm no
827: (the default),
1.84 jmc 828: remote X11 clients will be considered untrusted and prevented
1.22 markus 829: from stealing or tampering with data belonging to trusted X11
830: clients.
1.42 djm 831: Furthermore, the
832: .Xr xauth 1
833: token used for the session will be set to expire after 20 minutes.
834: Remote clients will be refused access after this time.
1.22 markus 835: .Pp
836: See the X11 SECURITY extension specification for full details on
837: the restrictions imposed on untrusted clients.
1.1 stevesk 838: .It Cm GatewayPorts
839: Specifies whether remote hosts are allowed to connect to local
840: forwarded ports.
841: By default,
1.84 jmc 842: .Xr ssh 1
1.7 jmc 843: binds local port forwardings to the loopback address.
844: This prevents other remote hosts from connecting to forwarded ports.
1.1 stevesk 845: .Cm GatewayPorts
1.84 jmc 846: can be used to specify that ssh
1.1 stevesk 847: should bind local port forwardings to the wildcard address,
848: thus allowing remote hosts to connect to forwarded ports.
849: The argument must be
1.240 jmc 850: .Cm yes
1.1 stevesk 851: or
1.240 jmc 852: .Cm no
853: (the default).
1.1 stevesk 854: .It Cm GlobalKnownHostsFile
1.151 djm 855: Specifies one or more files to use for the global
856: host key database, separated by whitespace.
857: The default is
858: .Pa /etc/ssh/ssh_known_hosts ,
859: .Pa /etc/ssh/ssh_known_hosts2 .
1.18 markus 860: .It Cm GSSAPIAuthentication
1.27 markus 861: Specifies whether user authentication based on GSSAPI is allowed.
1.20 jmc 862: The default is
1.240 jmc 863: .Cm no .
1.18 markus 864: .It Cm GSSAPIDelegateCredentials
865: Forward (delegate) credentials to the server.
866: The default is
1.240 jmc 867: .Cm no .
1.44 djm 868: .It Cm HashKnownHosts
869: Indicates that
1.84 jmc 870: .Xr ssh 1
1.44 djm 871: should hash host names and addresses when they are added to
1.50 djm 872: .Pa ~/.ssh/known_hosts .
1.44 djm 873: These hashed names may be used normally by
1.84 jmc 874: .Xr ssh 1
1.44 djm 875: and
1.84 jmc 876: .Xr sshd 8 ,
1.316 djm 877: but they do not visually reveal identifying information if the
878: file's contents are disclosed.
1.44 djm 879: The default is
1.240 jmc 880: .Cm no .
1.97 jmc 881: Note that existing names and addresses in known hosts files
882: will not be converted automatically,
883: but may be manually hashed using
1.45 djm 884: .Xr ssh-keygen 1 .
1.344 dtucker 885: .It Cm HostbasedAcceptedAlgorithms
1.348 djm 886: Specifies the signature algorithms that will be used for hostbased
887: authentication as a comma-separated list of patterns.
1.300 naddy 888: Alternately if the specified list begins with a
1.214 djm 889: .Sq +
1.348 djm 890: character, then the specified signature algorithms will be appended
891: to the default set instead of replacing them.
1.300 naddy 892: If the specified list begins with a
1.241 djm 893: .Sq -
1.348 djm 894: character, then the specified signature algorithms (including wildcards)
895: will be removed from the default set instead of replacing them.
1.301 naddy 896: If the specified list begins with a
897: .Sq ^
1.348 djm 898: character, then the specified signature algorithms will be placed
899: at the head of the default set.
1.213 markus 900: The default for this option is:
901: .Bd -literal -offset 3n
1.333 djm 902: ssh-ed25519-cert-v01@openssh.com,
1.213 markus 903: ecdsa-sha2-nistp256-cert-v01@openssh.com,
904: ecdsa-sha2-nistp384-cert-v01@openssh.com,
905: ecdsa-sha2-nistp521-cert-v01@openssh.com,
1.333 djm 906: sk-ssh-ed25519-cert-v01@openssh.com,
1.311 naddy 907: sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
1.305 naddy 908: rsa-sha2-512-cert-v01@openssh.com,
909: rsa-sha2-256-cert-v01@openssh.com,
1.333 djm 910: ssh-ed25519,
1.213 markus 911: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1.333 djm 912: sk-ssh-ed25519@openssh.com,
1.311 naddy 913: sk-ecdsa-sha2-nistp256@openssh.com,
1.366 kn 914: rsa-sha2-512,rsa-sha2-256
1.213 markus 915: .Ed
916: .Pp
1.202 djm 917: The
918: .Fl Q
919: option of
920: .Xr ssh 1
1.348 djm 921: may be used to list supported signature algorithms.
1.344 dtucker 922: This was formerly named HostbasedKeyTypes.
1.345 naddy 923: .It Cm HostbasedAuthentication
924: Specifies whether to try rhosts based authentication with public key
925: authentication.
926: The argument must be
927: .Cm yes
928: or
929: .Cm no
930: (the default).
1.1 stevesk 931: .It Cm HostKeyAlgorithms
1.348 djm 932: Specifies the host key signature algorithms
1.1 stevesk 933: that the client wants to use in order of preference.
1.300 naddy 934: Alternately if the specified list begins with a
1.214 djm 935: .Sq +
1.348 djm 936: character, then the specified signature algorithms will be appended to
937: the default set instead of replacing them.
1.300 naddy 938: If the specified list begins with a
1.241 djm 939: .Sq -
1.348 djm 940: character, then the specified signature algorithms (including wildcards)
941: will be removed from the default set instead of replacing them.
1.301 naddy 942: If the specified list begins with a
943: .Sq ^
1.348 djm 944: character, then the specified signature algorithms will be placed
945: at the head of the default set.
1.1 stevesk 946: The default for this option is:
1.139 djm 947: .Bd -literal -offset 3n
1.333 djm 948: ssh-ed25519-cert-v01@openssh.com,
1.139 djm 949: ecdsa-sha2-nistp256-cert-v01@openssh.com,
950: ecdsa-sha2-nistp384-cert-v01@openssh.com,
951: ecdsa-sha2-nistp521-cert-v01@openssh.com,
1.333 djm 952: sk-ssh-ed25519-cert-v01@openssh.com,
1.311 naddy 953: sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
1.305 naddy 954: rsa-sha2-512-cert-v01@openssh.com,
955: rsa-sha2-256-cert-v01@openssh.com,
1.333 djm 956: ssh-ed25519,
1.139 djm 957: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1.311 naddy 958: sk-ecdsa-sha2-nistp256@openssh.com,
1.333 djm 959: sk-ssh-ed25519@openssh.com,
1.366 kn 960: rsa-sha2-512,rsa-sha2-256
1.139 djm 961: .Ed
1.145 djm 962: .Pp
963: If hostkeys are known for the destination host then this default is modified
964: to prefer their algorithms.
1.198 djm 965: .Pp
1.348 djm 966: The list of available signature algorithms may also be obtained using
1.322 dtucker 967: .Qq ssh -Q HostKeyAlgorithms .
1.1 stevesk 968: .It Cm HostKeyAlias
969: Specifies an alias that should be used instead of the
970: real host name when looking up or saving the host key
1.251 djm 971: in the host key database files and when validating host certificates.
1.84 jmc 972: This option is useful for tunneling SSH connections
1.1 stevesk 973: or for multiple servers running on a single host.
1.295 jmc 974: .It Cm Hostname
1.1 stevesk 975: Specifies the real host name to log into.
976: This can be used to specify nicknames or abbreviations for hosts.
1.239 jmc 977: Arguments to
1.295 jmc 978: .Cm Hostname
1.239 jmc 979: accept the tokens described in the
980: .Sx TOKENS
981: section.
1.1 stevesk 982: Numeric IP addresses are also permitted (both on the command line and in
1.295 jmc 983: .Cm Hostname
1.1 stevesk 984: specifications).
1.239 jmc 985: The default is the name given on the command line.
1.29 markus 986: .It Cm IdentitiesOnly
987: Specifies that
1.84 jmc 988: .Xr ssh 1
1.304 djm 989: should only use the configured authentication identity and certificate files
990: (either the default files, or those explicitly configured in the
1.31 jmc 991: .Nm
1.221 djm 992: files
993: or passed on the
994: .Xr ssh 1
1.304 djm 995: command-line),
1.84 jmc 996: even if
997: .Xr ssh-agent 1
1.159 djm 998: or a
999: .Cm PKCS11Provider
1.305 naddy 1000: or
1001: .Cm SecurityKeyProvider
1.29 markus 1002: offers more identities.
1003: The argument to this keyword must be
1.240 jmc 1004: .Cm yes
1.29 markus 1005: or
1.240 jmc 1006: .Cm no
1007: (the default).
1.84 jmc 1008: This option is intended for situations where ssh-agent
1.29 markus 1009: offers many different identities.
1.231 markus 1010: .It Cm IdentityAgent
1011: Specifies the
1012: .Ux Ns -domain
1013: socket used to communicate with the authentication agent.
1014: .Pp
1015: This option overrides the
1.240 jmc 1016: .Ev SSH_AUTH_SOCK
1.231 markus 1017: environment variable and can be used to select a specific agent.
1018: Setting the socket name to
1.240 jmc 1019: .Cm none
1.231 markus 1020: disables the use of an authentication agent.
1.232 markus 1021: If the string
1.240 jmc 1022: .Qq SSH_AUTH_SOCK
1.232 markus 1023: is specified, the location of the socket will be read from the
1024: .Ev SSH_AUTH_SOCK
1025: environment variable.
1.286 djm 1026: Otherwise if the specified value begins with a
1027: .Sq $
1028: character, then it will be treated as an environment variable containing
1029: the location of the socket.
1.231 markus 1030: .Pp
1.239 jmc 1031: Arguments to
1032: .Cm IdentityAgent
1.326 dtucker 1033: may use the tilde syntax to refer to a user's home directory,
1034: the tokens described in the
1.239 jmc 1035: .Sx TOKENS
1.326 dtucker 1036: section and environment variables as described in the
1037: .Sx ENVIRONMENT VARIABLES
1.239 jmc 1038: section.
1.67 jmc 1039: .It Cm IdentityFile
1.313 naddy 1040: Specifies a file from which the user's DSA, ECDSA, authenticator-hosted ECDSA,
1041: Ed25519, authenticator-hosted Ed25519 or RSA authentication identity is read.
1.375 dtucker 1042: You can also specify a public key file to use the corresponding
1043: private key that is loaded in
1044: .Xr ssh-agent 1
1045: when the private key file is not present locally.
1.67 jmc 1046: The default is
1.368 dtucker 1047: .Pa ~/.ssh/id_rsa ,
1.183 naddy 1048: .Pa ~/.ssh/id_ecdsa ,
1.305 naddy 1049: .Pa ~/.ssh/id_ecdsa_sk ,
1.308 naddy 1050: .Pa ~/.ssh/id_ed25519 ,
1051: .Pa ~/.ssh/id_ed25519_sk
1.139 djm 1052: and
1.368 dtucker 1053: .Pa ~/.ssh/id_dsa .
1.67 jmc 1054: Additionally, any identities represented by the authentication agent
1.165 djm 1055: will be used for authentication unless
1056: .Cm IdentitiesOnly
1057: is set.
1.221 djm 1058: If no certificates have been explicitly specified by
1059: .Cm CertificateFile ,
1.129 djm 1060: .Xr ssh 1
1061: will try to load certificate information from the filename obtained by
1062: appending
1063: .Pa -cert.pub
1064: to the path of a specified
1065: .Cm IdentityFile .
1.90 djm 1066: .Pp
1.239 jmc 1067: Arguments to
1068: .Cm IdentityFile
1069: may use the tilde syntax to refer to a user's home directory
1070: or the tokens described in the
1071: .Sx TOKENS
1072: section.
1.389 ! djm 1073: Alternately an argument of
! 1074: .Cm none
! 1075: may be used to indicate no identity files should be loaded.
1.90 djm 1076: .Pp
1.67 jmc 1077: It is possible to have
1078: multiple identity files specified in configuration files; all these
1079: identities will be tried in sequence.
1.152 djm 1080: Multiple
1081: .Cm IdentityFile
1082: directives will add to the list of identities tried (this behaviour
1083: differs from that of other configuration directives).
1.165 djm 1084: .Pp
1085: .Cm IdentityFile
1086: may be used in conjunction with
1087: .Cm IdentitiesOnly
1088: to select which identities in an agent are offered during authentication.
1.221 djm 1089: .Cm IdentityFile
1090: may also be used in conjunction with
1091: .Cm CertificateFile
1092: in order to provide any certificate also needed for authentication with
1093: the identity.
1.164 jmc 1094: .It Cm IgnoreUnknown
1095: Specifies a pattern-list of unknown options to be ignored if they are
1096: encountered in configuration parsing.
1097: This may be used to suppress errors if
1098: .Nm
1099: contains options that are unrecognised by
1100: .Xr ssh 1 .
1101: It is recommended that
1102: .Cm IgnoreUnknown
1103: be listed early in the configuration file as it will not be applied
1104: to unknown options that appear before it.
1.229 djm 1105: .It Cm Include
1106: Include the specified configuration file(s).
1.230 jmc 1107: Multiple pathnames may be specified and each pathname may contain
1.281 kn 1108: .Xr glob 7
1.229 djm 1109: wildcards and, for user configurations, shell-like
1.240 jmc 1110: .Sq ~
1.229 djm 1111: references to user home directories.
1.327 djm 1112: Wildcards will be expanded and processed in lexical order.
1.229 djm 1113: Files without absolute paths are assumed to be in
1114: .Pa ~/.ssh
1.230 jmc 1115: if included in a user configuration file or
1.229 djm 1116: .Pa /etc/ssh
1117: if included from the system configuration file.
1118: .Cm Include
1119: directive may appear inside a
1120: .Cm Match
1121: or
1122: .Cm Host
1123: block
1124: to perform conditional inclusion.
1.143 djm 1125: .It Cm IPQoS
1126: Specifies the IPv4 type-of-service or DSCP class for connections.
1127: Accepted values are
1.240 jmc 1128: .Cm af11 ,
1129: .Cm af12 ,
1130: .Cm af13 ,
1131: .Cm af21 ,
1132: .Cm af22 ,
1133: .Cm af23 ,
1134: .Cm af31 ,
1135: .Cm af32 ,
1136: .Cm af33 ,
1137: .Cm af41 ,
1138: .Cm af42 ,
1139: .Cm af43 ,
1140: .Cm cs0 ,
1141: .Cm cs1 ,
1142: .Cm cs2 ,
1143: .Cm cs3 ,
1144: .Cm cs4 ,
1145: .Cm cs5 ,
1146: .Cm cs6 ,
1147: .Cm cs7 ,
1148: .Cm ef ,
1.319 djm 1149: .Cm le ,
1.240 jmc 1150: .Cm lowdelay ,
1151: .Cm throughput ,
1152: .Cm reliability ,
1.253 djm 1153: a numeric value, or
1154: .Cm none
1155: to use the operating system default.
1.146 djm 1156: This option may take one or two arguments, separated by whitespace.
1.143 djm 1157: If one argument is specified, it is used as the packet class unconditionally.
1158: If two values are specified, the first is automatically selected for
1159: interactive sessions and the second for non-interactive sessions.
1160: The default is
1.269 job 1161: .Cm af21
1.272 jmc 1162: (Low-Latency Data)
1.143 djm 1163: for interactive sessions and
1.269 job 1164: .Cm cs1
1.272 jmc 1165: (Lower Effort)
1.143 djm 1166: for non-interactive sessions.
1.103 djm 1167: .It Cm KbdInteractiveAuthentication
1168: Specifies whether to use keyboard-interactive authentication.
1169: The argument to this keyword must be
1.240 jmc 1170: .Cm yes
1171: (the default)
1.103 djm 1172: or
1.240 jmc 1173: .Cm no .
1.355 dtucker 1174: .Cm ChallengeResponseAuthentication
1175: is a deprecated alias for this.
1.39 djm 1176: .It Cm KbdInteractiveDevices
1177: Specifies the list of methods to use in keyboard-interactive authentication.
1178: Multiple method names must be comma-separated.
1179: The default is to use the server specified list.
1.85 jmc 1180: The methods available vary depending on what the server supports.
1181: For an OpenSSH server,
1182: it may be zero or more of:
1.240 jmc 1183: .Cm bsdauth ,
1184: .Cm pam ,
1.85 jmc 1185: and
1.240 jmc 1186: .Cm skey .
1.140 djm 1187: .It Cm KexAlgorithms
1188: Specifies the available KEX (Key Exchange) algorithms.
1189: Multiple algorithms must be comma-separated.
1.299 kn 1190: If the specified list begins with a
1.214 djm 1191: .Sq +
1.363 dtucker 1192: character, then the specified algorithms will be appended to the default set
1.214 djm 1193: instead of replacing them.
1.299 kn 1194: If the specified list begins with a
1.241 djm 1195: .Sq -
1.363 dtucker 1196: character, then the specified algorithms (including wildcards) will be removed
1.241 djm 1197: from the default set instead of replacing them.
1.301 naddy 1198: If the specified list begins with a
1199: .Sq ^
1.363 dtucker 1200: character, then the specified algorithms will be placed at the head of the
1.301 naddy 1201: default set.
1.141 jmc 1202: The default is:
1203: .Bd -literal -offset indent
1.371 naddy 1204: sntrup761x25519-sha512@openssh.com,
1.238 djm 1205: curve25519-sha256,curve25519-sha256@libssh.org,
1.141 jmc 1206: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
1207: diffie-hellman-group-exchange-sha256,
1.266 djm 1208: diffie-hellman-group16-sha512,
1209: diffie-hellman-group18-sha512,
1.317 tedu 1210: diffie-hellman-group14-sha256
1.141 jmc 1211: .Ed
1.198 djm 1212: .Pp
1.240 jmc 1213: The list of available key exchange algorithms may also be obtained using
1214: .Qq ssh -Q kex .
1.339 djm 1215: .It Cm KnownHostsCommand
1.340 jmc 1216: Specifies a command to use to obtain a list of host keys, in addition to
1.339 djm 1217: those listed in
1218: .Cm UserKnownHostsFile
1219: and
1220: .Cm GlobalKnownHostsFile .
1221: This command is executed after the files have been read.
1.340 jmc 1222: It may write host key lines to standard output in identical format to the
1.339 djm 1223: usual files (described in the
1224: .Sx VERIFYING HOST KEYS
1225: section in
1226: .Xr ssh 1 ) .
1227: Arguments to
1228: .Cm KnownHostsCommand
1229: accept the tokens described in the
1230: .Sx TOKENS
1231: section.
1.340 jmc 1232: The command may be invoked multiple times per connection: once when preparing
1.339 djm 1233: the preference list of host key algorithms to use, again to obtain the
1234: host key for the requested host name and, if
1235: .Cm CheckHostIP
1236: is enabled, one more time to obtain the host key matching the server's
1237: address.
1238: If the command exits abnormally or returns a non-zero exit status then the
1239: connection is terminated.
1.65 reyk 1240: .It Cm LocalCommand
1241: Specifies a command to execute on the local machine after successfully
1242: connecting to the server.
1243: The command string extends to the end of the line, and is executed with
1.105 jmc 1244: the user's shell.
1.239 jmc 1245: Arguments to
1246: .Cm LocalCommand
1247: accept the tokens described in the
1248: .Sx TOKENS
1249: section.
1.123 djm 1250: .Pp
1251: The command is run synchronously and does not have access to the
1252: session of the
1253: .Xr ssh 1
1254: that spawned it.
1255: It should not be used for interactive commands.
1256: .Pp
1.65 reyk 1257: This directive is ignored unless
1258: .Cm PermitLocalCommand
1259: has been enabled.
1.1 stevesk 1260: .It Cm LocalForward
1.74 jmc 1261: Specifies that a TCP port on the local machine be forwarded over
1.1 stevesk 1262: the secure channel to the specified host and port from the remote machine.
1.324 dtucker 1263: The first argument specifies the listener and may be
1.43 djm 1264: .Sm off
1.49 jmc 1265: .Oo Ar bind_address : Oc Ar port
1.43 djm 1266: .Sm on
1.324 dtucker 1267: or a Unix domain socket path.
1268: The second argument is the destination and may be
1269: .Ar host : Ns Ar hostport
1270: or a Unix domain socket path if the remote host supports it.
1271: .Pp
1.138 djm 1272: IPv6 addresses can be specified by enclosing addresses in square brackets.
1.46 jmc 1273: Multiple forwardings may be specified, and additional forwardings can be
1.43 djm 1274: given on the command line.
1.1 stevesk 1275: Only the superuser can forward privileged ports.
1.43 djm 1276: By default, the local port is bound in accordance with the
1277: .Cm GatewayPorts
1278: setting.
1279: However, an explicit
1280: .Ar bind_address
1281: may be used to bind the connection to a specific address.
1282: The
1283: .Ar bind_address
1284: of
1.240 jmc 1285: .Cm localhost
1.46 jmc 1286: indicates that the listening port be bound for local use only, while an
1287: empty address or
1288: .Sq *
1.43 djm 1289: indicates that the port should be available from all interfaces.
1.326 dtucker 1290: Unix domain socket paths may use the tokens described in the
1.324 dtucker 1291: .Sx TOKENS
1.326 dtucker 1292: section and environment variables as described in the
1293: .Sx ENVIRONMENT VARIABLES
1.324 dtucker 1294: section.
1.1 stevesk 1295: .It Cm LogLevel
1296: Gives the verbosity level that is used when logging messages from
1.84 jmc 1297: .Xr ssh 1 .
1.1 stevesk 1298: The possible values are:
1.84 jmc 1299: QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
1.7 jmc 1300: The default is INFO.
1301: DEBUG and DEBUG1 are equivalent.
1302: DEBUG2 and DEBUG3 each specify higher levels of verbose output.
1.337 djm 1303: .It Cm LogVerbose
1304: Specify one or more overrides to LogLevel.
1305: An override consists of a pattern lists that matches the source file, function
1306: and line number to force detailed logging for.
1307: For example, an override pattern of:
1308: .Bd -literal -offset indent
1309: kex.c:*:1000,*:kex_exchange_identification():*,packet.c:*
1310: .Ed
1311: .Pp
1312: would enable detailed logging for line 1000 of
1.338 jmc 1313: .Pa kex.c ,
1.337 djm 1314: everything in the
1315: .Fn kex_exchange_identification
1316: function, and all code in the
1317: .Pa packet.c
1318: file.
1319: This option is intended for debugging and no overrides are enabled by default.
1.1 stevesk 1320: .It Cm MACs
1321: Specifies the MAC (message authentication code) algorithms
1322: in order of preference.
1.226 jmc 1323: The MAC algorithm is used for data integrity protection.
1.1 stevesk 1324: Multiple algorithms must be comma-separated.
1.299 kn 1325: If the specified list begins with a
1.214 djm 1326: .Sq +
1327: character, then the specified algorithms will be appended to the default set
1328: instead of replacing them.
1.299 kn 1329: If the specified list begins with a
1.241 djm 1330: .Sq -
1331: character, then the specified algorithms (including wildcards) will be removed
1332: from the default set instead of replacing them.
1.301 naddy 1333: If the specified list begins with a
1334: .Sq ^
1335: character, then the specified algorithms will be placed at the head of the
1336: default set.
1.214 djm 1337: .Pp
1.160 markus 1338: The algorithms that contain
1.240 jmc 1339: .Qq -etm
1.160 markus 1340: calculate the MAC after encryption (encrypt-then-mac).
1341: These are considered safer and their use recommended.
1.214 djm 1342: .Pp
1.84 jmc 1343: The default is:
1.101 jmc 1344: .Bd -literal -offset indent
1.160 markus 1345: umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1346: hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
1.224 djm 1347: hmac-sha1-etm@openssh.com,
1.186 naddy 1348: umac-64@openssh.com,umac-128@openssh.com,
1.224 djm 1349: hmac-sha2-256,hmac-sha2-512,hmac-sha1
1.101 jmc 1350: .Ed
1.198 djm 1351: .Pp
1.240 jmc 1352: The list of available MAC algorithms may also be obtained using
1353: .Qq ssh -Q mac .
1.1 stevesk 1354: .It Cm NoHostAuthenticationForLocalhost
1.264 djm 1355: Disable host authentication for localhost (loopback addresses).
1.1 stevesk 1356: The argument to this keyword must be
1.240 jmc 1357: .Cm yes
1.1 stevesk 1358: or
1.242 jmc 1359: .Cm no
1.240 jmc 1360: (the default).
1.1 stevesk 1361: .It Cm NumberOfPasswordPrompts
1362: Specifies the number of password prompts before giving up.
1363: The argument to this keyword must be an integer.
1.84 jmc 1364: The default is 3.
1.384 djm 1365: .It Cm ObscureKeystrokeTiming
1366: Specifies whether
1367: .Xr ssh 1
1368: should try to obscure inter-keystroke timings from passive observers of
1369: network traffic.
1370: If enabled, then for interactive sessions,
1371: .Xr ssh 1
1372: will send keystrokes at fixed intervals of a few tens of milliseconds
1373: and will send fake keystroke packets for some time after typing ceases.
1374: The argument to this keyword must be
1375: .Cm yes ,
1376: .Cm no
1377: or an interval specifier of the form
1378: .Cm interval:milliseconds
1379: (e.g.\&
1.386 djm 1380: .Cm interval:80
1381: for 80 milliseconds).
1.384 djm 1382: The default is to obscure keystrokes using a 20ms packet interval.
1383: Note that smaller intervals will result in higher fake keystroke packet rates.
1.1 stevesk 1384: .It Cm PasswordAuthentication
1385: Specifies whether to use password authentication.
1386: The argument to this keyword must be
1.240 jmc 1387: .Cm yes
1388: (the default)
1.1 stevesk 1389: or
1.240 jmc 1390: .Cm no .
1.65 reyk 1391: .It Cm PermitLocalCommand
1392: Allow local command execution via the
1393: .Ic LocalCommand
1394: option or using the
1.66 jmc 1395: .Ic !\& Ns Ar command
1.65 reyk 1396: escape sequence in
1397: .Xr ssh 1 .
1398: The argument must be
1.240 jmc 1399: .Cm yes
1.65 reyk 1400: or
1.240 jmc 1401: .Cm no
1402: (the default).
1.347 markus 1403: .It Cm PermitRemoteOpen
1404: Specifies the destinations to which remote TCP port forwarding is permitted when
1405: .Cm RemoteForward
1406: is used as a SOCKS proxy.
1407: The forwarding specification must be one of the following forms:
1408: .Pp
1409: .Bl -item -offset indent -compact
1410: .It
1411: .Cm PermitRemoteOpen
1412: .Sm off
1413: .Ar host : port
1414: .Sm on
1415: .It
1416: .Cm PermitRemoteOpen
1417: .Sm off
1418: .Ar IPv4_addr : port
1419: .Sm on
1420: .It
1421: .Cm PermitRemoteOpen
1422: .Sm off
1423: .Ar \&[ IPv6_addr \&] : port
1424: .Sm on
1425: .El
1426: .Pp
1427: Multiple forwards may be specified by separating them with whitespace.
1428: An argument of
1429: .Cm any
1430: can be used to remove all restrictions and permit any forwarding requests.
1431: An argument of
1432: .Cm none
1433: can be used to prohibit all forwarding requests.
1434: The wildcard
1435: .Sq *
1436: can be used for host or port to allow all hosts or ports respectively.
1437: Otherwise, no pattern matching or address lookups are performed on supplied
1438: names.
1.127 markus 1439: .It Cm PKCS11Provider
1.292 djm 1440: Specifies which PKCS#11 provider to use or
1441: .Cm none
1442: to indicate that no provider should be used (the default).
1443: The argument to this keyword is a path to the PKCS#11 shared library
1.127 markus 1444: .Xr ssh 1
1.292 djm 1445: should use to communicate with a PKCS#11 token providing keys for user
1446: authentication.
1.67 jmc 1447: .It Cm Port
1448: Specifies the port number to connect on the remote host.
1.84 jmc 1449: The default is 22.
1.1 stevesk 1450: .It Cm PreferredAuthentications
1.226 jmc 1451: Specifies the order in which the client should try authentication methods.
1.48 jmc 1452: This allows a client to prefer one method (e.g.\&
1.1 stevesk 1453: .Cm keyboard-interactive )
1.48 jmc 1454: over another method (e.g.\&
1.131 jmc 1455: .Cm password ) .
1456: The default is:
1457: .Bd -literal -offset indent
1458: gssapi-with-mic,hostbased,publickey,
1459: keyboard-interactive,password
1460: .Ed
1.1 stevesk 1461: .It Cm ProxyCommand
1462: Specifies the command to use to connect to the server.
1463: The command
1.190 djm 1464: string extends to the end of the line, and is executed
1465: using the user's shell
1466: .Ql exec
1467: directive to avoid a lingering shell process.
1468: .Pp
1.239 jmc 1469: Arguments to
1470: .Cm ProxyCommand
1471: accept the tokens described in the
1472: .Sx TOKENS
1473: section.
1.1 stevesk 1474: The command can be basically anything,
1475: and should read from its standard input and write to its standard output.
1476: It should eventually connect an
1477: .Xr sshd 8
1478: server running on some machine, or execute
1479: .Ic sshd -i
1480: somewhere.
1481: Host key management will be done using the
1.296 jmc 1482: .Cm Hostname
1483: of the host being connected (defaulting to the name typed by the user).
1.7 jmc 1484: Setting the command to
1.240 jmc 1485: .Cm none
1.6 markus 1486: disables this option entirely.
1.1 stevesk 1487: Note that
1488: .Cm CheckHostIP
1489: is not available for connects with a proxy command.
1.52 djm 1490: .Pp
1491: This directive is useful in conjunction with
1492: .Xr nc 1
1493: and its proxy support.
1.53 jmc 1494: For example, the following directive would connect via an HTTP proxy at
1.52 djm 1495: 192.0.2.0:
1496: .Bd -literal -offset 3n
1497: ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p
1498: .Ed
1.233 djm 1499: .It Cm ProxyJump
1.260 millert 1500: Specifies one or more jump proxies as either
1.233 djm 1501: .Xo
1502: .Sm off
1.234 jmc 1503: .Op Ar user No @
1.233 djm 1504: .Ar host
1.234 jmc 1505: .Op : Ns Ar port
1.233 djm 1506: .Sm on
1.260 millert 1507: or an ssh URI
1.233 djm 1508: .Xc .
1.235 djm 1509: Multiple proxies may be separated by comma characters and will be visited
1.236 djm 1510: sequentially.
1.233 djm 1511: Setting this option will cause
1512: .Xr ssh 1
1513: to connect to the target host by first making a
1514: .Xr ssh 1
1515: connection to the specified
1516: .Cm ProxyJump
1517: host and then establishing a
1.234 jmc 1518: TCP forwarding to the ultimate target from there.
1.346 dlg 1519: Setting the host to
1520: .Cm none
1521: disables this option entirely.
1.233 djm 1522: .Pp
1523: Note that this option will compete with the
1524: .Cm ProxyCommand
1525: option - whichever is specified first will prevent later instances of the
1526: other from taking effect.
1.289 djm 1527: .Pp
1528: Note also that the configuration for the destination host (either supplied
1529: via the command-line or the configuration file) is not generally applied
1530: to jump hosts.
1531: .Pa ~/.ssh/config
1532: should be used if specific configuration is required for jump hosts.
1.167 djm 1533: .It Cm ProxyUseFdpass
1.168 jmc 1534: Specifies that
1.167 djm 1535: .Cm ProxyCommand
1536: will pass a connected file descriptor back to
1.168 jmc 1537: .Xr ssh 1
1.167 djm 1538: instead of continuing to execute and pass data.
1539: The default is
1.240 jmc 1540: .Cm no .
1.343 dtucker 1541: .It Cm PubkeyAcceptedAlgorithms
1542: Specifies the signature algorithms that will be used for public key
1543: authentication as a comma-separated list of patterns.
1.299 kn 1544: If the specified list begins with a
1.214 djm 1545: .Sq +
1.343 dtucker 1546: character, then the algorithms after it will be appended to the default
1.214 djm 1547: instead of replacing it.
1.299 kn 1548: If the specified list begins with a
1.241 djm 1549: .Sq -
1.343 dtucker 1550: character, then the specified algorithms (including wildcards) will be removed
1.241 djm 1551: from the default set instead of replacing them.
1.301 naddy 1552: If the specified list begins with a
1553: .Sq ^
1.343 dtucker 1554: character, then the specified algorithms will be placed at the head of the
1.301 naddy 1555: default set.
1.213 markus 1556: The default for this option is:
1557: .Bd -literal -offset 3n
1.333 djm 1558: ssh-ed25519-cert-v01@openssh.com,
1.213 markus 1559: ecdsa-sha2-nistp256-cert-v01@openssh.com,
1560: ecdsa-sha2-nistp384-cert-v01@openssh.com,
1561: ecdsa-sha2-nistp521-cert-v01@openssh.com,
1.333 djm 1562: sk-ssh-ed25519-cert-v01@openssh.com,
1.311 naddy 1563: sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
1.305 naddy 1564: rsa-sha2-512-cert-v01@openssh.com,
1565: rsa-sha2-256-cert-v01@openssh.com,
1.333 djm 1566: ssh-ed25519,
1.311 naddy 1567: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1.333 djm 1568: sk-ssh-ed25519@openssh.com,
1.305 naddy 1569: sk-ecdsa-sha2-nistp256@openssh.com,
1.366 kn 1570: rsa-sha2-512,rsa-sha2-256
1.213 markus 1571: .Ed
1572: .Pp
1.348 djm 1573: The list of available signature algorithms may also be obtained using
1.343 dtucker 1574: .Qq ssh -Q PubkeyAcceptedAlgorithms .
1.1 stevesk 1575: .It Cm PubkeyAuthentication
1576: Specifies whether to try public key authentication.
1577: The argument to this keyword must be
1.240 jmc 1578: .Cm yes
1.369 djm 1579: (the default),
1580: .Cm no ,
1581: .Cm unbound
1.1 stevesk 1582: or
1.369 djm 1583: .Cm host-bound .
1584: The final two options enable public key authentication while respectively
1585: disabling or enabling the OpenSSH host-bound authentication protocol
1586: extension required for restricted
1587: .Xr ssh-agent 1
1588: forwarding.
1.75 dtucker 1589: .It Cm RekeyLimit
1.373 djm 1590: Specifies the maximum amount of data that may be transmitted or received
1591: before the session key is renegotiated, optionally followed by a maximum
1592: amount of time that may pass before the session key is renegotiated.
1.162 dtucker 1593: The first argument is specified in bytes and may have a suffix of
1.76 jmc 1594: .Sq K ,
1595: .Sq M ,
1.75 dtucker 1596: or
1.76 jmc 1597: .Sq G
1.75 dtucker 1598: to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1599: The default is between
1.84 jmc 1600: .Sq 1G
1.75 dtucker 1601: and
1.84 jmc 1602: .Sq 4G ,
1.75 dtucker 1603: depending on the cipher.
1.162 dtucker 1604: The optional second value is specified in seconds and may use any of the
1.293 schwarze 1605: units documented in the TIME FORMATS section of
1.162 dtucker 1606: .Xr sshd_config 5 .
1607: The default value for
1608: .Cm RekeyLimit
1609: is
1.240 jmc 1610: .Cm default none ,
1.162 dtucker 1611: which means that rekeying is performed after the cipher's default amount
1612: of data has been sent or received and no time based rekeying is done.
1.249 bluhm 1613: .It Cm RemoteCommand
1614: Specifies a command to execute on the remote machine after successfully
1615: connecting to the server.
1616: The command string extends to the end of the line, and is executed with
1617: the user's shell.
1.250 jmc 1618: Arguments to
1619: .Cm RemoteCommand
1620: accept the tokens described in the
1621: .Sx TOKENS
1622: section.
1.1 stevesk 1623: .It Cm RemoteForward
1.74 jmc 1624: Specifies that a TCP port on the remote machine be forwarded over
1.256 markus 1625: the secure channel.
1.273 djm 1626: The remote port may either be forwarded to a specified host and port
1.256 markus 1627: from the local machine, or may act as a SOCKS 4/5 proxy that allows a remote
1628: client to connect to arbitrary destinations from the local machine.
1.324 dtucker 1629: The first argument is the listening specification and may be
1.43 djm 1630: .Sm off
1.49 jmc 1631: .Oo Ar bind_address : Oc Ar port
1.43 djm 1632: .Sm on
1.324 dtucker 1633: or, if the remote host supports it, a Unix domain socket path.
1.256 markus 1634: If forwarding to a specific destination then the second argument must be
1.324 dtucker 1635: .Ar host : Ns Ar hostport
1636: or a Unix domain socket path,
1.256 markus 1637: otherwise if no destination argument is specified then the remote forwarding
1638: will be established as a SOCKS proxy.
1.370 naddy 1639: When acting as a SOCKS proxy, the destination of the connection can be
1.347 markus 1640: restricted by
1641: .Cm PermitRemoteOpen .
1.256 markus 1642: .Pp
1.138 djm 1643: IPv6 addresses can be specified by enclosing addresses in square brackets.
1.1 stevesk 1644: Multiple forwardings may be specified, and additional
1645: forwardings can be given on the command line.
1.113 stevesk 1646: Privileged ports can be forwarded only when
1647: logging in as root on the remote machine.
1.326 dtucker 1648: Unix domain socket paths may use the tokens described in the
1.324 dtucker 1649: .Sx TOKENS
1.326 dtucker 1650: section and environment variables as described in the
1651: .Sx ENVIRONMENT VARIABLES
1.324 dtucker 1652: section.
1.118 jmc 1653: .Pp
1.117 djm 1654: If the
1655: .Ar port
1.240 jmc 1656: argument is 0,
1.117 djm 1657: the listen port will be dynamically allocated on the server and reported
1658: to the client at run time.
1.43 djm 1659: .Pp
1660: If the
1661: .Ar bind_address
1662: is not specified, the default is to only bind to loopback addresses.
1663: If the
1664: .Ar bind_address
1665: is
1666: .Ql *
1667: or an empty string, then the forwarding is requested to listen on all
1668: interfaces.
1669: Specifying a remote
1670: .Ar bind_address
1.46 jmc 1671: will only succeed if the server's
1672: .Cm GatewayPorts
1.43 djm 1673: option is enabled (see
1.46 jmc 1674: .Xr sshd_config 5 ) .
1.149 djm 1675: .It Cm RequestTTY
1676: Specifies whether to request a pseudo-tty for the session.
1677: The argument may be one of:
1.240 jmc 1678: .Cm no
1.149 djm 1679: (never request a TTY),
1.240 jmc 1680: .Cm yes
1.149 djm 1681: (always request a TTY when standard input is a TTY),
1.240 jmc 1682: .Cm force
1.149 djm 1683: (always request a TTY) or
1.240 jmc 1684: .Cm auto
1.149 djm 1685: (request a TTY when opening a login session).
1686: This option mirrors the
1687: .Fl t
1688: and
1689: .Fl T
1690: flags for
1691: .Xr ssh 1 .
1.374 djm 1692: .It Cm RequiredRSASize
1693: Specifies the minimum RSA key size (in bits) that
1694: .Xr ssh 1
1695: will accept.
1696: User authentication keys smaller than this limit will be ignored.
1697: Servers that present host keys smaller than this limit will cause the
1698: connection to be terminated.
1699: The default is
1700: .Cm 1024
1701: bits.
1702: Note that this limit may only be raised from the default.
1.196 djm 1703: .It Cm RevokedHostKeys
1704: Specifies revoked host public keys.
1705: Keys listed in this file will be refused for host authentication.
1706: Note that if this file does not exist or is not readable,
1707: then host authentication will be refused for all hosts.
1708: Keys may be specified as a text file, listing one public key per line, or as
1709: an OpenSSH Key Revocation List (KRL) as generated by
1710: .Xr ssh-keygen 1 .
1711: For more information on KRLs, see the KEY REVOCATION LISTS section in
1712: .Xr ssh-keygen 1 .
1.380 dtucker 1713: Arguments to
1714: .Cm RevokedHostKeys
1715: may use the tilde syntax to refer to a user's home directory,
1716: the tokens described in the
1717: .Sx TOKENS
1718: section and environment variables as described in the
1719: .Sx ENVIRONMENT VARIABLES
1720: section.
1.305 naddy 1721: .It Cm SecurityKeyProvider
1.313 naddy 1722: Specifies a path to a library that will be used when loading any
1723: FIDO authenticator-hosted keys, overriding the default of using
1724: the built-in USB HID support.
1.309 naddy 1725: .Pp
1726: If the specified value begins with a
1727: .Sq $
1728: character, then it will be treated as an environment variable containing
1729: the path to the library.
1.32 djm 1730: .It Cm SendEnv
1731: Specifies what variables from the local
1732: .Xr environ 7
1733: should be sent to the server.
1.84 jmc 1734: The server must also support it, and the server must be configured to
1.33 djm 1735: accept these environment variables.
1.207 dtucker 1736: Note that the
1737: .Ev TERM
1.208 jmc 1738: environment variable is always sent whenever a
1.207 dtucker 1739: pseudo-terminal is requested as it is required by the protocol.
1.32 djm 1740: Refer to
1741: .Cm AcceptEnv
1742: in
1743: .Xr sshd_config 5
1744: for how to configure the server.
1.80 jmc 1745: Variables are specified by name, which may contain wildcard characters.
1.33 djm 1746: Multiple environment variables may be separated by whitespace or spread
1.32 djm 1747: across multiple
1748: .Cm SendEnv
1749: directives.
1.81 jmc 1750: .Pp
1751: See
1752: .Sx PATTERNS
1753: for more information on patterns.
1.271 djm 1754: .Pp
1.272 jmc 1755: It is possible to clear previously set
1.271 djm 1756: .Cm SendEnv
1757: variable names by prefixing patterns with
1758: .Pa - .
1759: The default is not to send any environment variables.
1.28 markus 1760: .It Cm ServerAliveCountMax
1.73 jmc 1761: Sets the number of server alive messages (see below) which may be
1.28 markus 1762: sent without
1.84 jmc 1763: .Xr ssh 1
1.28 markus 1764: receiving any messages back from the server.
1765: If this threshold is reached while server alive messages are being sent,
1.84 jmc 1766: ssh will disconnect from the server, terminating the session.
1.28 markus 1767: It is important to note that the use of server alive messages is very
1768: different from
1769: .Cm TCPKeepAlive
1770: (below).
1771: The server alive messages are sent through the encrypted channel
1772: and therefore will not be spoofable.
1773: The TCP keepalive option enabled by
1774: .Cm TCPKeepAlive
1775: is spoofable.
1776: The server alive mechanism is valuable when the client or
1.298 dtucker 1777: server depend on knowing when a connection has become unresponsive.
1.28 markus 1778: .Pp
1779: The default value is 3.
1780: If, for example,
1781: .Cm ServerAliveInterval
1.84 jmc 1782: (see below) is set to 15 and
1.28 markus 1783: .Cm ServerAliveCountMax
1.84 jmc 1784: is left at the default, if the server becomes unresponsive,
1785: ssh will disconnect after approximately 45 seconds.
1.67 jmc 1786: .It Cm ServerAliveInterval
1787: Sets a timeout interval in seconds after which if no data has been received
1788: from the server,
1.84 jmc 1789: .Xr ssh 1
1.67 jmc 1790: will send a message through the encrypted
1791: channel to request a response from the server.
1792: The default
1793: is 0, indicating that these messages will not be sent to the server.
1.357 jmc 1794: .It Cm SessionType
1795: May be used to either request invocation of a subsystem on the remote system,
1796: or to prevent the execution of a remote command at all.
1797: The latter is useful for just forwarding ports.
1798: The argument to this keyword must be
1799: .Cm none
1800: (same as the
1801: .Fl N
1802: option),
1803: .Cm subsystem
1804: (same as the
1805: .Fl s
1806: option) or
1807: .Cm default
1808: (shell or command execution).
1.277 jmc 1809: .It Cm SetEnv
1810: Directly specify one or more environment variables and their contents to
1811: be sent to the server.
1812: Similarly to
1813: .Cm SendEnv ,
1.354 djm 1814: with the exception of the
1815: .Ev TERM
1816: variable, the server must be prepared to accept the environment variable.
1.358 djm 1817: .It Cm StdinNull
1818: Redirects stdin from
1819: .Pa /dev/null
1820: (actually, prevents reading from stdin).
1821: Either this or the equivalent
1822: .Fl n
1823: option must be used when
1824: .Nm ssh
1825: is run in the background.
1826: The argument to this keyword must be
1827: .Cm yes
1828: (same as the
1829: .Fl n
1830: option) or
1831: .Cm no
1832: (the default).
1.191 millert 1833: .It Cm StreamLocalBindMask
1834: Sets the octal file creation mode mask
1835: .Pq umask
1836: used when creating a Unix-domain socket file for local or remote
1837: port forwarding.
1838: This option is only used for port forwarding to a Unix-domain socket file.
1839: .Pp
1840: The default value is 0177, which creates a Unix-domain socket file that is
1841: readable and writable only by the owner.
1842: Note that not all operating systems honor the file mode on Unix-domain
1843: socket files.
1844: .It Cm StreamLocalBindUnlink
1845: Specifies whether to remove an existing Unix-domain socket file for local
1846: or remote port forwarding before creating a new one.
1847: If the socket file already exists and
1848: .Cm StreamLocalBindUnlink
1849: is not enabled,
1850: .Nm ssh
1851: will be unable to forward the port to the Unix-domain socket file.
1852: This option is only used for port forwarding to a Unix-domain socket file.
1853: .Pp
1854: The argument must be
1.240 jmc 1855: .Cm yes
1.191 millert 1856: or
1.240 jmc 1857: .Cm no
1858: (the default).
1.1 stevesk 1859: .It Cm StrictHostKeyChecking
1860: If this flag is set to
1.240 jmc 1861: .Cm yes ,
1.84 jmc 1862: .Xr ssh 1
1.1 stevesk 1863: will never automatically add host keys to the
1.50 djm 1864: .Pa ~/.ssh/known_hosts
1.1 stevesk 1865: file, and refuses to connect to hosts whose host key has changed.
1.263 dtucker 1866: This provides maximum protection against man-in-the-middle (MITM) attacks,
1.84 jmc 1867: though it can be annoying when the
1.1 stevesk 1868: .Pa /etc/ssh/ssh_known_hosts
1.84 jmc 1869: file is poorly maintained or when connections to new hosts are
1.1 stevesk 1870: frequently made.
1871: This option forces the user to manually
1872: add all new hosts.
1.255 jmc 1873: .Pp
1.1 stevesk 1874: If this flag is set to
1.364 dtucker 1875: .Cm accept-new
1.360 jmc 1876: then ssh will automatically add new host keys to the user's
1877: .Pa known_hosts
1878: file, but will not permit connections to hosts with
1.254 djm 1879: changed host keys.
1880: If this flag is set to
1.364 dtucker 1881: .Cm no
1.254 djm 1882: or
1.364 dtucker 1883: .Cm off ,
1.255 jmc 1884: ssh will automatically add new host keys to the user known hosts files
1885: and allow connections to hosts with changed hostkeys to proceed,
1886: subject to some restrictions.
1.1 stevesk 1887: If this flag is set to
1.240 jmc 1888: .Cm ask
1889: (the default),
1.1 stevesk 1890: new host keys
1891: will be added to the user known host files only after the user
1892: has confirmed that is what they really want to do, and
1.84 jmc 1893: ssh will refuse to connect to hosts whose host key has changed.
1.1 stevesk 1894: The host keys of
1895: known hosts will be verified automatically in all cases.
1.244 jmc 1896: .It Cm SyslogFacility
1897: Gives the facility code that is used when logging messages from
1898: .Xr ssh 1 .
1899: The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1900: LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1901: The default is USER.
1.26 markus 1902: .It Cm TCPKeepAlive
1903: Specifies whether the system should send TCP keepalive messages to the
1904: other side.
1905: If they are sent, death of the connection or crash of one
1906: of the machines will be properly noticed.
1907: However, this means that
1908: connections will die if the route is down temporarily, and some people
1909: find it annoying.
1910: .Pp
1911: The default is
1.240 jmc 1912: .Cm yes
1.26 markus 1913: (to send TCP keepalive messages), and the client will notice
1914: if the network goes down or the remote host dies.
1915: This is important in scripts, and many users want it too.
1916: .Pp
1917: To disable TCP keepalive messages, the value should be set to
1.240 jmc 1918: .Cm no .
1.265 djm 1919: See also
1920: .Cm ServerAliveInterval
1921: for protocol-level keepalives.
1.382 djm 1922: .It Cm Tag
1923: Specify a configuration tag name that may be later used by a
1924: .Cm Match
1.383 jsg 1925: directive to select a block of configuration.
1.65 reyk 1926: .It Cm Tunnel
1.95 stevesk 1927: Request
1.65 reyk 1928: .Xr tun 4
1.69 jmc 1929: device forwarding between the client and the server.
1.65 reyk 1930: The argument must be
1.240 jmc 1931: .Cm yes ,
1932: .Cm point-to-point
1.95 stevesk 1933: (layer 3),
1.240 jmc 1934: .Cm ethernet
1.95 stevesk 1935: (layer 2),
1.65 reyk 1936: or
1.240 jmc 1937: .Cm no
1938: (the default).
1.95 stevesk 1939: Specifying
1.240 jmc 1940: .Cm yes
1.95 stevesk 1941: requests the default tunnel mode, which is
1.240 jmc 1942: .Cm point-to-point .
1.65 reyk 1943: .It Cm TunnelDevice
1.95 stevesk 1944: Specifies the
1.65 reyk 1945: .Xr tun 4
1.95 stevesk 1946: devices to open on the client
1947: .Pq Ar local_tun
1948: and the server
1949: .Pq Ar remote_tun .
1950: .Pp
1951: The argument must be
1952: .Sm off
1953: .Ar local_tun Op : Ar remote_tun .
1954: .Sm on
1955: The devices may be specified by numerical ID or the keyword
1.240 jmc 1956: .Cm any ,
1.95 stevesk 1957: which uses the next available tunnel device.
1958: If
1959: .Ar remote_tun
1960: is not specified, it defaults to
1.240 jmc 1961: .Cm any .
1.95 stevesk 1962: The default is
1.240 jmc 1963: .Cm any:any .
1.201 djm 1964: .It Cm UpdateHostKeys
1.200 djm 1965: Specifies whether
1966: .Xr ssh 1
1967: should accept notifications of additional hostkeys from the server sent
1968: after authentication has completed and add them to
1969: .Cm UserKnownHostsFile .
1970: The argument must be
1.240 jmc 1971: .Cm yes ,
1972: .Cm no
1.320 djm 1973: or
1.240 jmc 1974: .Cm ask .
1.320 djm 1975: This option allows learning alternate hostkeys for a server
1.201 djm 1976: and supports graceful key rotation by allowing a server to send replacement
1977: public keys before old ones are removed.
1.336 djm 1978: .Pp
1.200 djm 1979: Additional hostkeys are only accepted if the key used to authenticate the
1.336 djm 1980: host was already trusted or explicitly accepted by the user, the host was
1981: authenticated via
1982: .Cm UserKnownHostsFile
1983: (i.e. not
1984: .Cm GlobalKnownHostsFile )
1985: and the host was authenticated using a plain key and not a certificate.
1.320 djm 1986: .Pp
1987: .Cm UpdateHostKeys
1.321 jmc 1988: is enabled by default if the user has not overridden the default
1.320 djm 1989: .Cm UserKnownHostsFile
1.335 djm 1990: setting and has not enabled
1991: .Cm VerifyHostKeyDNS ,
1992: otherwise
1.320 djm 1993: .Cm UpdateHostKeys
1994: will be set to
1.334 djm 1995: .Cm no .
1.320 djm 1996: .Pp
1.204 djm 1997: If
1998: .Cm UpdateHostKeys
1999: is set to
1.240 jmc 2000: .Cm ask ,
1.204 djm 2001: then the user is asked to confirm the modifications to the known_hosts file.
1.205 djm 2002: Confirmation is currently incompatible with
2003: .Cm ControlPersist ,
2004: and will be disabled if it is enabled.
1.200 djm 2005: .Pp
2006: Presently, only
2007: .Xr sshd 8
2008: from OpenSSH 6.8 and greater support the
1.240 jmc 2009: .Qq hostkeys@openssh.com
1.200 djm 2010: protocol extension used to inform the client of all the server's hostkeys.
1.1 stevesk 2011: .It Cm User
2012: Specifies the user to log in as.
2013: This can be useful when a different user name is used on different machines.
2014: This saves the trouble of
2015: having to remember to give the user name on the command line.
2016: .It Cm UserKnownHostsFile
1.151 djm 2017: Specifies one or more files to use for the user
2018: host key database, separated by whitespace.
1.329 dtucker 2019: Each filename may use tilde notation to refer to the user's home directory,
2020: the tokens described in the
2021: .Sx TOKENS
2022: section and environment variables as described in the
2023: .Sx ENVIRONMENT VARIABLES
2024: section.
1.377 dtucker 2025: A value of
2026: .Cm none
2027: causes
2028: .Xr ssh 1
1.378 jmc 2029: to ignore any user-specific known hosts files.
1.151 djm 2030: The default is
2031: .Pa ~/.ssh/known_hosts ,
2032: .Pa ~/.ssh/known_hosts2 .
1.8 jakob 2033: .It Cm VerifyHostKeyDNS
2034: Specifies whether to verify the remote key using DNS and SSHFP resource
2035: records.
1.24 jakob 2036: If this option is set to
1.240 jmc 2037: .Cm yes ,
1.25 jmc 2038: the client will implicitly trust keys that match a secure fingerprint
1.24 jakob 2039: from DNS.
2040: Insecure fingerprints will be handled as if this option was set to
1.240 jmc 2041: .Cm ask .
1.24 jakob 2042: If this option is set to
1.240 jmc 2043: .Cm ask ,
1.24 jakob 2044: information on fingerprint match will be displayed, but the user will still
2045: need to confirm new host keys according to the
2046: .Cm StrictHostKeyChecking
2047: option.
1.8 jakob 2048: The default is
1.240 jmc 2049: .Cm no .
1.84 jmc 2050: .Pp
1.240 jmc 2051: See also
2052: .Sx VERIFYING HOST KEYS
2053: in
1.84 jmc 2054: .Xr ssh 1 .
1.111 grunk 2055: .It Cm VisualHostKey
2056: If this flag is set to
1.240 jmc 2057: .Cm yes ,
1.111 grunk 2058: an ASCII art representation of the remote host key fingerprint is
1.197 djm 2059: printed in addition to the fingerprint string at login and
1.114 stevesk 2060: for unknown host keys.
1.111 grunk 2061: If this flag is set to
1.240 jmc 2062: .Cm no
2063: (the default),
1.114 stevesk 2064: no fingerprint strings are printed at login and
1.197 djm 2065: only the fingerprint string will be printed for unknown host keys.
1.1 stevesk 2066: .It Cm XAuthLocation
1.5 stevesk 2067: Specifies the full pathname of the
1.1 stevesk 2068: .Xr xauth 1
2069: program.
2070: The default is
2071: .Pa /usr/X11R6/bin/xauth .
2072: .El
1.86 jmc 2073: .Sh PATTERNS
2074: A
2075: .Em pattern
2076: consists of zero or more non-whitespace characters,
2077: .Sq *
2078: (a wildcard that matches zero or more characters),
2079: or
2080: .Sq ?\&
2081: (a wildcard that matches exactly one character).
2082: For example, to specify a set of declarations for any host in the
1.240 jmc 2083: .Qq .co.uk
1.86 jmc 2084: set of domains,
2085: the following pattern could be used:
2086: .Pp
2087: .Dl Host *.co.uk
2088: .Pp
2089: The following pattern
2090: would match any host in the 192.168.0.[0-9] network range:
2091: .Pp
2092: .Dl Host 192.168.0.?
2093: .Pp
2094: A
2095: .Em pattern-list
2096: is a comma-separated list of patterns.
2097: Patterns within pattern-lists may be negated
2098: by preceding them with an exclamation mark
2099: .Pq Sq !\& .
2100: For example,
1.174 djm 2101: to allow a key to be used from anywhere within an organization
1.86 jmc 2102: except from the
1.240 jmc 2103: .Qq dialup
1.86 jmc 2104: pool,
2105: the following entry (in authorized_keys) could be used:
2106: .Pp
2107: .Dl from=\&"!*.dialup.example.com,*.example.com\&"
1.258 djm 2108: .Pp
2109: Note that a negated match will never produce a positive result by itself.
2110: For example, attempting to match
2111: .Qq host3
2112: against the following pattern-list will fail:
2113: .Pp
2114: .Dl from=\&"!host1,!host2\&"
2115: .Pp
2116: The solution here is to include a term that will yield a positive match,
2117: such as a wildcard:
2118: .Pp
2119: .Dl from=\&"!host1,!host2,*\&"
1.239 jmc 2120: .Sh TOKENS
2121: Arguments to some keywords can make use of tokens,
2122: which are expanded at runtime:
2123: .Pp
2124: .Bl -tag -width XXXX -offset indent -compact
2125: .It %%
2126: A literal
2127: .Sq % .
2128: .It \&%C
1.257 jmc 2129: Hash of %l%h%p%r.
1.239 jmc 2130: .It %d
2131: Local user's home directory.
1.339 djm 2132: .It %f
2133: The fingerprint of the server's host key.
2134: .It %H
2135: The
2136: .Pa known_hosts
2137: hostname or address that is being searched for.
1.239 jmc 2138: .It %h
2139: The remote hostname.
1.340 jmc 2140: .It \%%I
1.339 djm 2141: A string describing the reason for a
2142: .Cm KnownHostsCommand
1.340 jmc 2143: execution: either
2144: .Cm ADDRESS
1.339 djm 2145: when looking up a host by address (only when
2146: .Cm CheckHostIP
2147: is enabled),
1.340 jmc 2148: .Cm HOSTNAME
2149: when searching by hostname, or
2150: .Cm ORDER
1.339 djm 2151: when preparing the host key algorithm preference list to use for the
2152: destination host.
1.239 jmc 2153: .It %i
2154: The local user ID.
1.339 djm 2155: .It %K
2156: The base64 encoded host key.
1.330 dtucker 2157: .It %k
1.350 jsg 2158: The host key alias if specified, otherwise the original remote hostname given
1.330 dtucker 2159: on the command line.
1.239 jmc 2160: .It %L
2161: The local hostname.
2162: .It %l
2163: The local hostname, including the domain name.
2164: .It %n
2165: The original remote hostname, as given on the command line.
2166: .It %p
2167: The remote port.
2168: .It %r
2169: The remote username.
1.261 djm 2170: .It \&%T
2171: The local
2172: .Xr tun 4
2173: or
2174: .Xr tap 4
2175: network interface assigned if
1.262 jmc 2176: tunnel forwarding was requested, or
2177: .Qq NONE
1.261 djm 2178: otherwise.
1.339 djm 2179: .It %t
2180: The type of the server host key, e.g.
1.360 jmc 2181: .Cm ssh-ed25519 .
1.239 jmc 2182: .It %u
2183: The local username.
2184: .El
2185: .Pp
1.323 dtucker 2186: .Cm CertificateFile ,
2187: .Cm ControlPath ,
2188: .Cm IdentityAgent ,
2189: .Cm IdentityFile ,
1.339 djm 2190: .Cm KnownHostsCommand ,
1.325 jmc 2191: .Cm LocalForward ,
1.324 dtucker 2192: .Cm Match exec ,
2193: .Cm RemoteCommand ,
1.329 dtucker 2194: .Cm RemoteForward ,
1.380 dtucker 2195: .Cm RevokedHostKeys ,
1.323 dtucker 2196: and
1.331 jmc 2197: .Cm UserKnownHostsFile
1.349 dtucker 2198: accept the tokens %%, %C, %d, %h, %i, %k, %L, %l, %n, %p, %r, and %u.
1.239 jmc 2199: .Pp
1.339 djm 2200: .Cm KnownHostsCommand
2201: additionally accepts the tokens %f, %H, %I, %K and %t.
2202: .Pp
1.295 jmc 2203: .Cm Hostname
1.239 jmc 2204: accepts the tokens %% and %h.
2205: .Pp
2206: .Cm LocalCommand
1.323 dtucker 2207: accepts all tokens.
1.239 jmc 2208: .Pp
2209: .Cm ProxyCommand
1.372 dtucker 2210: and
2211: .Cm ProxyJump
2212: accept the tokens %%, %h, %n, %p, and %r.
1.387 djm 2213: .Pp
2214: Note that some of these directives build commands for execution via the shell.
2215: Because
2216: .Xr ssh 1
2217: performs no filtering or escaping of characters that have special meaning in
1.388 jmc 2218: shell commands (e.g. quotes), it is the user's responsibility to ensure that
1.387 djm 2219: the arguments passed to
2220: .Xr ssh 1
2221: do not contain such characters and that tokens are appropriately quoted
2222: when used.
1.326 dtucker 2223: .Sh ENVIRONMENT VARIABLES
2224: Arguments to some keywords can be expanded at runtime from environment
2225: variables on the client by enclosing them in
2226: .Ic ${} ,
2227: for example
2228: .Ic ${HOME}/.ssh
2229: would refer to the user's .ssh directory.
2230: If a specified environment variable does not exist then an error will be
2231: returned and the setting for that keyword will be ignored.
2232: .Pp
2233: The keywords
2234: .Cm CertificateFile ,
2235: .Cm ControlPath ,
1.329 dtucker 2236: .Cm IdentityAgent ,
1.352 jmc 2237: .Cm IdentityFile ,
1.339 djm 2238: .Cm KnownHostsCommand ,
1.326 dtucker 2239: and
1.329 dtucker 2240: .Cm UserKnownHostsFile
1.326 dtucker 2241: support environment variables.
2242: The keywords
2243: .Cm LocalForward
2244: and
2245: .Cm RemoteForward
2246: support environment variables only for Unix domain socket paths.
1.1 stevesk 2247: .Sh FILES
2248: .Bl -tag -width Ds
1.50 djm 2249: .It Pa ~/.ssh/config
1.1 stevesk 2250: This is the per-user configuration file.
2251: The format of this file is described above.
1.84 jmc 2252: This file is used by the SSH client.
1.30 djm 2253: Because of the potential for abuse, this file must have strict permissions:
1.290 jmc 2254: read/write for the user, and not writable by others.
1.1 stevesk 2255: .It Pa /etc/ssh/ssh_config
2256: Systemwide configuration file.
2257: This file provides defaults for those
2258: values that are not specified in the user's configuration file, and
2259: for those users who do not have a configuration file.
2260: This file must be world-readable.
2261: .El
1.13 jmc 2262: .Sh SEE ALSO
2263: .Xr ssh 1
1.1 stevesk 2264: .Sh AUTHORS
1.240 jmc 2265: .An -nosplit
1.1 stevesk 2266: OpenSSH is a derivative of the original and free
1.240 jmc 2267: ssh 1.2.12 release by
2268: .An Tatu Ylonen .
2269: .An Aaron Campbell , Bob Beck , Markus Friedl ,
2270: .An Niels Provos , Theo de Raadt
2271: and
2272: .An Dug Song
1.1 stevesk 2273: removed many bugs, re-added newer features and
2274: created OpenSSH.
1.240 jmc 2275: .An Markus Friedl
2276: contributed the support for SSH protocol versions 1.5 and 2.0.