Annotation of src/usr.bin/ssh/ssh_config.5, Revision 1.388
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.388 ! jmc 36: .\" $OpenBSD: ssh_config.5,v 1.387 2023/10/04 04:03:50 djm Exp $
! 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.90 djm 1073: .Pp
1.67 jmc 1074: It is possible to have
1075: multiple identity files specified in configuration files; all these
1076: identities will be tried in sequence.
1.152 djm 1077: Multiple
1078: .Cm IdentityFile
1079: directives will add to the list of identities tried (this behaviour
1080: differs from that of other configuration directives).
1.165 djm 1081: .Pp
1082: .Cm IdentityFile
1083: may be used in conjunction with
1084: .Cm IdentitiesOnly
1085: to select which identities in an agent are offered during authentication.
1.221 djm 1086: .Cm IdentityFile
1087: may also be used in conjunction with
1088: .Cm CertificateFile
1089: in order to provide any certificate also needed for authentication with
1090: the identity.
1.164 jmc 1091: .It Cm IgnoreUnknown
1092: Specifies a pattern-list of unknown options to be ignored if they are
1093: encountered in configuration parsing.
1094: This may be used to suppress errors if
1095: .Nm
1096: contains options that are unrecognised by
1097: .Xr ssh 1 .
1098: It is recommended that
1099: .Cm IgnoreUnknown
1100: be listed early in the configuration file as it will not be applied
1101: to unknown options that appear before it.
1.229 djm 1102: .It Cm Include
1103: Include the specified configuration file(s).
1.230 jmc 1104: Multiple pathnames may be specified and each pathname may contain
1.281 kn 1105: .Xr glob 7
1.229 djm 1106: wildcards and, for user configurations, shell-like
1.240 jmc 1107: .Sq ~
1.229 djm 1108: references to user home directories.
1.327 djm 1109: Wildcards will be expanded and processed in lexical order.
1.229 djm 1110: Files without absolute paths are assumed to be in
1111: .Pa ~/.ssh
1.230 jmc 1112: if included in a user configuration file or
1.229 djm 1113: .Pa /etc/ssh
1114: if included from the system configuration file.
1115: .Cm Include
1116: directive may appear inside a
1117: .Cm Match
1118: or
1119: .Cm Host
1120: block
1121: to perform conditional inclusion.
1.143 djm 1122: .It Cm IPQoS
1123: Specifies the IPv4 type-of-service or DSCP class for connections.
1124: Accepted values are
1.240 jmc 1125: .Cm af11 ,
1126: .Cm af12 ,
1127: .Cm af13 ,
1128: .Cm af21 ,
1129: .Cm af22 ,
1130: .Cm af23 ,
1131: .Cm af31 ,
1132: .Cm af32 ,
1133: .Cm af33 ,
1134: .Cm af41 ,
1135: .Cm af42 ,
1136: .Cm af43 ,
1137: .Cm cs0 ,
1138: .Cm cs1 ,
1139: .Cm cs2 ,
1140: .Cm cs3 ,
1141: .Cm cs4 ,
1142: .Cm cs5 ,
1143: .Cm cs6 ,
1144: .Cm cs7 ,
1145: .Cm ef ,
1.319 djm 1146: .Cm le ,
1.240 jmc 1147: .Cm lowdelay ,
1148: .Cm throughput ,
1149: .Cm reliability ,
1.253 djm 1150: a numeric value, or
1151: .Cm none
1152: to use the operating system default.
1.146 djm 1153: This option may take one or two arguments, separated by whitespace.
1.143 djm 1154: If one argument is specified, it is used as the packet class unconditionally.
1155: If two values are specified, the first is automatically selected for
1156: interactive sessions and the second for non-interactive sessions.
1157: The default is
1.269 job 1158: .Cm af21
1.272 jmc 1159: (Low-Latency Data)
1.143 djm 1160: for interactive sessions and
1.269 job 1161: .Cm cs1
1.272 jmc 1162: (Lower Effort)
1.143 djm 1163: for non-interactive sessions.
1.103 djm 1164: .It Cm KbdInteractiveAuthentication
1165: Specifies whether to use keyboard-interactive authentication.
1166: The argument to this keyword must be
1.240 jmc 1167: .Cm yes
1168: (the default)
1.103 djm 1169: or
1.240 jmc 1170: .Cm no .
1.355 dtucker 1171: .Cm ChallengeResponseAuthentication
1172: is a deprecated alias for this.
1.39 djm 1173: .It Cm KbdInteractiveDevices
1174: Specifies the list of methods to use in keyboard-interactive authentication.
1175: Multiple method names must be comma-separated.
1176: The default is to use the server specified list.
1.85 jmc 1177: The methods available vary depending on what the server supports.
1178: For an OpenSSH server,
1179: it may be zero or more of:
1.240 jmc 1180: .Cm bsdauth ,
1181: .Cm pam ,
1.85 jmc 1182: and
1.240 jmc 1183: .Cm skey .
1.140 djm 1184: .It Cm KexAlgorithms
1185: Specifies the available KEX (Key Exchange) algorithms.
1186: Multiple algorithms must be comma-separated.
1.299 kn 1187: If the specified list begins with a
1.214 djm 1188: .Sq +
1.363 dtucker 1189: character, then the specified algorithms will be appended to the default set
1.214 djm 1190: instead of replacing them.
1.299 kn 1191: If the specified list begins with a
1.241 djm 1192: .Sq -
1.363 dtucker 1193: character, then the specified algorithms (including wildcards) will be removed
1.241 djm 1194: from the default set instead of replacing them.
1.301 naddy 1195: If the specified list begins with a
1196: .Sq ^
1.363 dtucker 1197: character, then the specified algorithms will be placed at the head of the
1.301 naddy 1198: default set.
1.141 jmc 1199: The default is:
1200: .Bd -literal -offset indent
1.371 naddy 1201: sntrup761x25519-sha512@openssh.com,
1.238 djm 1202: curve25519-sha256,curve25519-sha256@libssh.org,
1.141 jmc 1203: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
1204: diffie-hellman-group-exchange-sha256,
1.266 djm 1205: diffie-hellman-group16-sha512,
1206: diffie-hellman-group18-sha512,
1.317 tedu 1207: diffie-hellman-group14-sha256
1.141 jmc 1208: .Ed
1.198 djm 1209: .Pp
1.240 jmc 1210: The list of available key exchange algorithms may also be obtained using
1211: .Qq ssh -Q kex .
1.339 djm 1212: .It Cm KnownHostsCommand
1.340 jmc 1213: Specifies a command to use to obtain a list of host keys, in addition to
1.339 djm 1214: those listed in
1215: .Cm UserKnownHostsFile
1216: and
1217: .Cm GlobalKnownHostsFile .
1218: This command is executed after the files have been read.
1.340 jmc 1219: It may write host key lines to standard output in identical format to the
1.339 djm 1220: usual files (described in the
1221: .Sx VERIFYING HOST KEYS
1222: section in
1223: .Xr ssh 1 ) .
1224: Arguments to
1225: .Cm KnownHostsCommand
1226: accept the tokens described in the
1227: .Sx TOKENS
1228: section.
1.340 jmc 1229: The command may be invoked multiple times per connection: once when preparing
1.339 djm 1230: the preference list of host key algorithms to use, again to obtain the
1231: host key for the requested host name and, if
1232: .Cm CheckHostIP
1233: is enabled, one more time to obtain the host key matching the server's
1234: address.
1235: If the command exits abnormally or returns a non-zero exit status then the
1236: connection is terminated.
1.65 reyk 1237: .It Cm LocalCommand
1238: Specifies a command to execute on the local machine after successfully
1239: connecting to the server.
1240: The command string extends to the end of the line, and is executed with
1.105 jmc 1241: the user's shell.
1.239 jmc 1242: Arguments to
1243: .Cm LocalCommand
1244: accept the tokens described in the
1245: .Sx TOKENS
1246: section.
1.123 djm 1247: .Pp
1248: The command is run synchronously and does not have access to the
1249: session of the
1250: .Xr ssh 1
1251: that spawned it.
1252: It should not be used for interactive commands.
1253: .Pp
1.65 reyk 1254: This directive is ignored unless
1255: .Cm PermitLocalCommand
1256: has been enabled.
1.1 stevesk 1257: .It Cm LocalForward
1.74 jmc 1258: Specifies that a TCP port on the local machine be forwarded over
1.1 stevesk 1259: the secure channel to the specified host and port from the remote machine.
1.324 dtucker 1260: The first argument specifies the listener and may be
1.43 djm 1261: .Sm off
1.49 jmc 1262: .Oo Ar bind_address : Oc Ar port
1.43 djm 1263: .Sm on
1.324 dtucker 1264: or a Unix domain socket path.
1265: The second argument is the destination and may be
1266: .Ar host : Ns Ar hostport
1267: or a Unix domain socket path if the remote host supports it.
1268: .Pp
1.138 djm 1269: IPv6 addresses can be specified by enclosing addresses in square brackets.
1.46 jmc 1270: Multiple forwardings may be specified, and additional forwardings can be
1.43 djm 1271: given on the command line.
1.1 stevesk 1272: Only the superuser can forward privileged ports.
1.43 djm 1273: By default, the local port is bound in accordance with the
1274: .Cm GatewayPorts
1275: setting.
1276: However, an explicit
1277: .Ar bind_address
1278: may be used to bind the connection to a specific address.
1279: The
1280: .Ar bind_address
1281: of
1.240 jmc 1282: .Cm localhost
1.46 jmc 1283: indicates that the listening port be bound for local use only, while an
1284: empty address or
1285: .Sq *
1.43 djm 1286: indicates that the port should be available from all interfaces.
1.326 dtucker 1287: Unix domain socket paths may use the tokens described in the
1.324 dtucker 1288: .Sx TOKENS
1.326 dtucker 1289: section and environment variables as described in the
1290: .Sx ENVIRONMENT VARIABLES
1.324 dtucker 1291: section.
1.1 stevesk 1292: .It Cm LogLevel
1293: Gives the verbosity level that is used when logging messages from
1.84 jmc 1294: .Xr ssh 1 .
1.1 stevesk 1295: The possible values are:
1.84 jmc 1296: QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
1.7 jmc 1297: The default is INFO.
1298: DEBUG and DEBUG1 are equivalent.
1299: DEBUG2 and DEBUG3 each specify higher levels of verbose output.
1.337 djm 1300: .It Cm LogVerbose
1301: Specify one or more overrides to LogLevel.
1302: An override consists of a pattern lists that matches the source file, function
1303: and line number to force detailed logging for.
1304: For example, an override pattern of:
1305: .Bd -literal -offset indent
1306: kex.c:*:1000,*:kex_exchange_identification():*,packet.c:*
1307: .Ed
1308: .Pp
1309: would enable detailed logging for line 1000 of
1.338 jmc 1310: .Pa kex.c ,
1.337 djm 1311: everything in the
1312: .Fn kex_exchange_identification
1313: function, and all code in the
1314: .Pa packet.c
1315: file.
1316: This option is intended for debugging and no overrides are enabled by default.
1.1 stevesk 1317: .It Cm MACs
1318: Specifies the MAC (message authentication code) algorithms
1319: in order of preference.
1.226 jmc 1320: The MAC algorithm is used for data integrity protection.
1.1 stevesk 1321: Multiple algorithms must be comma-separated.
1.299 kn 1322: If the specified list begins with a
1.214 djm 1323: .Sq +
1324: character, then the specified algorithms will be appended to the default set
1325: instead of replacing them.
1.299 kn 1326: If the specified list begins with a
1.241 djm 1327: .Sq -
1328: character, then the specified algorithms (including wildcards) will be removed
1329: from the default set instead of replacing them.
1.301 naddy 1330: If the specified list begins with a
1331: .Sq ^
1332: character, then the specified algorithms will be placed at the head of the
1333: default set.
1.214 djm 1334: .Pp
1.160 markus 1335: The algorithms that contain
1.240 jmc 1336: .Qq -etm
1.160 markus 1337: calculate the MAC after encryption (encrypt-then-mac).
1338: These are considered safer and their use recommended.
1.214 djm 1339: .Pp
1.84 jmc 1340: The default is:
1.101 jmc 1341: .Bd -literal -offset indent
1.160 markus 1342: umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1343: hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
1.224 djm 1344: hmac-sha1-etm@openssh.com,
1.186 naddy 1345: umac-64@openssh.com,umac-128@openssh.com,
1.224 djm 1346: hmac-sha2-256,hmac-sha2-512,hmac-sha1
1.101 jmc 1347: .Ed
1.198 djm 1348: .Pp
1.240 jmc 1349: The list of available MAC algorithms may also be obtained using
1350: .Qq ssh -Q mac .
1.1 stevesk 1351: .It Cm NoHostAuthenticationForLocalhost
1.264 djm 1352: Disable host authentication for localhost (loopback addresses).
1.1 stevesk 1353: The argument to this keyword must be
1.240 jmc 1354: .Cm yes
1.1 stevesk 1355: or
1.242 jmc 1356: .Cm no
1.240 jmc 1357: (the default).
1.1 stevesk 1358: .It Cm NumberOfPasswordPrompts
1359: Specifies the number of password prompts before giving up.
1360: The argument to this keyword must be an integer.
1.84 jmc 1361: The default is 3.
1.384 djm 1362: .It Cm ObscureKeystrokeTiming
1363: Specifies whether
1364: .Xr ssh 1
1365: should try to obscure inter-keystroke timings from passive observers of
1366: network traffic.
1367: If enabled, then for interactive sessions,
1368: .Xr ssh 1
1369: will send keystrokes at fixed intervals of a few tens of milliseconds
1370: and will send fake keystroke packets for some time after typing ceases.
1371: The argument to this keyword must be
1372: .Cm yes ,
1373: .Cm no
1374: or an interval specifier of the form
1375: .Cm interval:milliseconds
1376: (e.g.\&
1.386 djm 1377: .Cm interval:80
1378: for 80 milliseconds).
1.384 djm 1379: The default is to obscure keystrokes using a 20ms packet interval.
1380: Note that smaller intervals will result in higher fake keystroke packet rates.
1.1 stevesk 1381: .It Cm PasswordAuthentication
1382: Specifies whether to use password authentication.
1383: The argument to this keyword must be
1.240 jmc 1384: .Cm yes
1385: (the default)
1.1 stevesk 1386: or
1.240 jmc 1387: .Cm no .
1.65 reyk 1388: .It Cm PermitLocalCommand
1389: Allow local command execution via the
1390: .Ic LocalCommand
1391: option or using the
1.66 jmc 1392: .Ic !\& Ns Ar command
1.65 reyk 1393: escape sequence in
1394: .Xr ssh 1 .
1395: The argument must be
1.240 jmc 1396: .Cm yes
1.65 reyk 1397: or
1.240 jmc 1398: .Cm no
1399: (the default).
1.347 markus 1400: .It Cm PermitRemoteOpen
1401: Specifies the destinations to which remote TCP port forwarding is permitted when
1402: .Cm RemoteForward
1403: is used as a SOCKS proxy.
1404: The forwarding specification must be one of the following forms:
1405: .Pp
1406: .Bl -item -offset indent -compact
1407: .It
1408: .Cm PermitRemoteOpen
1409: .Sm off
1410: .Ar host : port
1411: .Sm on
1412: .It
1413: .Cm PermitRemoteOpen
1414: .Sm off
1415: .Ar IPv4_addr : port
1416: .Sm on
1417: .It
1418: .Cm PermitRemoteOpen
1419: .Sm off
1420: .Ar \&[ IPv6_addr \&] : port
1421: .Sm on
1422: .El
1423: .Pp
1424: Multiple forwards may be specified by separating them with whitespace.
1425: An argument of
1426: .Cm any
1427: can be used to remove all restrictions and permit any forwarding requests.
1428: An argument of
1429: .Cm none
1430: can be used to prohibit all forwarding requests.
1431: The wildcard
1432: .Sq *
1433: can be used for host or port to allow all hosts or ports respectively.
1434: Otherwise, no pattern matching or address lookups are performed on supplied
1435: names.
1.127 markus 1436: .It Cm PKCS11Provider
1.292 djm 1437: Specifies which PKCS#11 provider to use or
1438: .Cm none
1439: to indicate that no provider should be used (the default).
1440: The argument to this keyword is a path to the PKCS#11 shared library
1.127 markus 1441: .Xr ssh 1
1.292 djm 1442: should use to communicate with a PKCS#11 token providing keys for user
1443: authentication.
1.67 jmc 1444: .It Cm Port
1445: Specifies the port number to connect on the remote host.
1.84 jmc 1446: The default is 22.
1.1 stevesk 1447: .It Cm PreferredAuthentications
1.226 jmc 1448: Specifies the order in which the client should try authentication methods.
1.48 jmc 1449: This allows a client to prefer one method (e.g.\&
1.1 stevesk 1450: .Cm keyboard-interactive )
1.48 jmc 1451: over another method (e.g.\&
1.131 jmc 1452: .Cm password ) .
1453: The default is:
1454: .Bd -literal -offset indent
1455: gssapi-with-mic,hostbased,publickey,
1456: keyboard-interactive,password
1457: .Ed
1.1 stevesk 1458: .It Cm ProxyCommand
1459: Specifies the command to use to connect to the server.
1460: The command
1.190 djm 1461: string extends to the end of the line, and is executed
1462: using the user's shell
1463: .Ql exec
1464: directive to avoid a lingering shell process.
1465: .Pp
1.239 jmc 1466: Arguments to
1467: .Cm ProxyCommand
1468: accept the tokens described in the
1469: .Sx TOKENS
1470: section.
1.1 stevesk 1471: The command can be basically anything,
1472: and should read from its standard input and write to its standard output.
1473: It should eventually connect an
1474: .Xr sshd 8
1475: server running on some machine, or execute
1476: .Ic sshd -i
1477: somewhere.
1478: Host key management will be done using the
1.296 jmc 1479: .Cm Hostname
1480: of the host being connected (defaulting to the name typed by the user).
1.7 jmc 1481: Setting the command to
1.240 jmc 1482: .Cm none
1.6 markus 1483: disables this option entirely.
1.1 stevesk 1484: Note that
1485: .Cm CheckHostIP
1486: is not available for connects with a proxy command.
1.52 djm 1487: .Pp
1488: This directive is useful in conjunction with
1489: .Xr nc 1
1490: and its proxy support.
1.53 jmc 1491: For example, the following directive would connect via an HTTP proxy at
1.52 djm 1492: 192.0.2.0:
1493: .Bd -literal -offset 3n
1494: ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p
1495: .Ed
1.233 djm 1496: .It Cm ProxyJump
1.260 millert 1497: Specifies one or more jump proxies as either
1.233 djm 1498: .Xo
1499: .Sm off
1.234 jmc 1500: .Op Ar user No @
1.233 djm 1501: .Ar host
1.234 jmc 1502: .Op : Ns Ar port
1.233 djm 1503: .Sm on
1.260 millert 1504: or an ssh URI
1.233 djm 1505: .Xc .
1.235 djm 1506: Multiple proxies may be separated by comma characters and will be visited
1.236 djm 1507: sequentially.
1.233 djm 1508: Setting this option will cause
1509: .Xr ssh 1
1510: to connect to the target host by first making a
1511: .Xr ssh 1
1512: connection to the specified
1513: .Cm ProxyJump
1514: host and then establishing a
1.234 jmc 1515: TCP forwarding to the ultimate target from there.
1.346 dlg 1516: Setting the host to
1517: .Cm none
1518: disables this option entirely.
1.233 djm 1519: .Pp
1520: Note that this option will compete with the
1521: .Cm ProxyCommand
1522: option - whichever is specified first will prevent later instances of the
1523: other from taking effect.
1.289 djm 1524: .Pp
1525: Note also that the configuration for the destination host (either supplied
1526: via the command-line or the configuration file) is not generally applied
1527: to jump hosts.
1528: .Pa ~/.ssh/config
1529: should be used if specific configuration is required for jump hosts.
1.167 djm 1530: .It Cm ProxyUseFdpass
1.168 jmc 1531: Specifies that
1.167 djm 1532: .Cm ProxyCommand
1533: will pass a connected file descriptor back to
1.168 jmc 1534: .Xr ssh 1
1.167 djm 1535: instead of continuing to execute and pass data.
1536: The default is
1.240 jmc 1537: .Cm no .
1.343 dtucker 1538: .It Cm PubkeyAcceptedAlgorithms
1539: Specifies the signature algorithms that will be used for public key
1540: authentication as a comma-separated list of patterns.
1.299 kn 1541: If the specified list begins with a
1.214 djm 1542: .Sq +
1.343 dtucker 1543: character, then the algorithms after it will be appended to the default
1.214 djm 1544: instead of replacing it.
1.299 kn 1545: If the specified list begins with a
1.241 djm 1546: .Sq -
1.343 dtucker 1547: character, then the specified algorithms (including wildcards) will be removed
1.241 djm 1548: from the default set instead of replacing them.
1.301 naddy 1549: If the specified list begins with a
1550: .Sq ^
1.343 dtucker 1551: character, then the specified algorithms will be placed at the head of the
1.301 naddy 1552: default set.
1.213 markus 1553: The default for this option is:
1554: .Bd -literal -offset 3n
1.333 djm 1555: ssh-ed25519-cert-v01@openssh.com,
1.213 markus 1556: ecdsa-sha2-nistp256-cert-v01@openssh.com,
1557: ecdsa-sha2-nistp384-cert-v01@openssh.com,
1558: ecdsa-sha2-nistp521-cert-v01@openssh.com,
1.333 djm 1559: sk-ssh-ed25519-cert-v01@openssh.com,
1.311 naddy 1560: sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
1.305 naddy 1561: rsa-sha2-512-cert-v01@openssh.com,
1562: rsa-sha2-256-cert-v01@openssh.com,
1.333 djm 1563: ssh-ed25519,
1.311 naddy 1564: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1.333 djm 1565: sk-ssh-ed25519@openssh.com,
1.305 naddy 1566: sk-ecdsa-sha2-nistp256@openssh.com,
1.366 kn 1567: rsa-sha2-512,rsa-sha2-256
1.213 markus 1568: .Ed
1569: .Pp
1.348 djm 1570: The list of available signature algorithms may also be obtained using
1.343 dtucker 1571: .Qq ssh -Q PubkeyAcceptedAlgorithms .
1.1 stevesk 1572: .It Cm PubkeyAuthentication
1573: Specifies whether to try public key authentication.
1574: The argument to this keyword must be
1.240 jmc 1575: .Cm yes
1.369 djm 1576: (the default),
1577: .Cm no ,
1578: .Cm unbound
1.1 stevesk 1579: or
1.369 djm 1580: .Cm host-bound .
1581: The final two options enable public key authentication while respectively
1582: disabling or enabling the OpenSSH host-bound authentication protocol
1583: extension required for restricted
1584: .Xr ssh-agent 1
1585: forwarding.
1.75 dtucker 1586: .It Cm RekeyLimit
1.373 djm 1587: Specifies the maximum amount of data that may be transmitted or received
1588: before the session key is renegotiated, optionally followed by a maximum
1589: amount of time that may pass before the session key is renegotiated.
1.162 dtucker 1590: The first argument is specified in bytes and may have a suffix of
1.76 jmc 1591: .Sq K ,
1592: .Sq M ,
1.75 dtucker 1593: or
1.76 jmc 1594: .Sq G
1.75 dtucker 1595: to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1596: The default is between
1.84 jmc 1597: .Sq 1G
1.75 dtucker 1598: and
1.84 jmc 1599: .Sq 4G ,
1.75 dtucker 1600: depending on the cipher.
1.162 dtucker 1601: The optional second value is specified in seconds and may use any of the
1.293 schwarze 1602: units documented in the TIME FORMATS section of
1.162 dtucker 1603: .Xr sshd_config 5 .
1604: The default value for
1605: .Cm RekeyLimit
1606: is
1.240 jmc 1607: .Cm default none ,
1.162 dtucker 1608: which means that rekeying is performed after the cipher's default amount
1609: of data has been sent or received and no time based rekeying is done.
1.249 bluhm 1610: .It Cm RemoteCommand
1611: Specifies a command to execute on the remote machine after successfully
1612: connecting to the server.
1613: The command string extends to the end of the line, and is executed with
1614: the user's shell.
1.250 jmc 1615: Arguments to
1616: .Cm RemoteCommand
1617: accept the tokens described in the
1618: .Sx TOKENS
1619: section.
1.1 stevesk 1620: .It Cm RemoteForward
1.74 jmc 1621: Specifies that a TCP port on the remote machine be forwarded over
1.256 markus 1622: the secure channel.
1.273 djm 1623: The remote port may either be forwarded to a specified host and port
1.256 markus 1624: from the local machine, or may act as a SOCKS 4/5 proxy that allows a remote
1625: client to connect to arbitrary destinations from the local machine.
1.324 dtucker 1626: The first argument is the listening specification and may be
1.43 djm 1627: .Sm off
1.49 jmc 1628: .Oo Ar bind_address : Oc Ar port
1.43 djm 1629: .Sm on
1.324 dtucker 1630: or, if the remote host supports it, a Unix domain socket path.
1.256 markus 1631: If forwarding to a specific destination then the second argument must be
1.324 dtucker 1632: .Ar host : Ns Ar hostport
1633: or a Unix domain socket path,
1.256 markus 1634: otherwise if no destination argument is specified then the remote forwarding
1635: will be established as a SOCKS proxy.
1.370 naddy 1636: When acting as a SOCKS proxy, the destination of the connection can be
1.347 markus 1637: restricted by
1638: .Cm PermitRemoteOpen .
1.256 markus 1639: .Pp
1.138 djm 1640: IPv6 addresses can be specified by enclosing addresses in square brackets.
1.1 stevesk 1641: Multiple forwardings may be specified, and additional
1642: forwardings can be given on the command line.
1.113 stevesk 1643: Privileged ports can be forwarded only when
1644: logging in as root on the remote machine.
1.326 dtucker 1645: Unix domain socket paths may use the tokens described in the
1.324 dtucker 1646: .Sx TOKENS
1.326 dtucker 1647: section and environment variables as described in the
1648: .Sx ENVIRONMENT VARIABLES
1.324 dtucker 1649: section.
1.118 jmc 1650: .Pp
1.117 djm 1651: If the
1652: .Ar port
1.240 jmc 1653: argument is 0,
1.117 djm 1654: the listen port will be dynamically allocated on the server and reported
1655: to the client at run time.
1.43 djm 1656: .Pp
1657: If the
1658: .Ar bind_address
1659: is not specified, the default is to only bind to loopback addresses.
1660: If the
1661: .Ar bind_address
1662: is
1663: .Ql *
1664: or an empty string, then the forwarding is requested to listen on all
1665: interfaces.
1666: Specifying a remote
1667: .Ar bind_address
1.46 jmc 1668: will only succeed if the server's
1669: .Cm GatewayPorts
1.43 djm 1670: option is enabled (see
1.46 jmc 1671: .Xr sshd_config 5 ) .
1.149 djm 1672: .It Cm RequestTTY
1673: Specifies whether to request a pseudo-tty for the session.
1674: The argument may be one of:
1.240 jmc 1675: .Cm no
1.149 djm 1676: (never request a TTY),
1.240 jmc 1677: .Cm yes
1.149 djm 1678: (always request a TTY when standard input is a TTY),
1.240 jmc 1679: .Cm force
1.149 djm 1680: (always request a TTY) or
1.240 jmc 1681: .Cm auto
1.149 djm 1682: (request a TTY when opening a login session).
1683: This option mirrors the
1684: .Fl t
1685: and
1686: .Fl T
1687: flags for
1688: .Xr ssh 1 .
1.374 djm 1689: .It Cm RequiredRSASize
1690: Specifies the minimum RSA key size (in bits) that
1691: .Xr ssh 1
1692: will accept.
1693: User authentication keys smaller than this limit will be ignored.
1694: Servers that present host keys smaller than this limit will cause the
1695: connection to be terminated.
1696: The default is
1697: .Cm 1024
1698: bits.
1699: Note that this limit may only be raised from the default.
1.196 djm 1700: .It Cm RevokedHostKeys
1701: Specifies revoked host public keys.
1702: Keys listed in this file will be refused for host authentication.
1703: Note that if this file does not exist or is not readable,
1704: then host authentication will be refused for all hosts.
1705: Keys may be specified as a text file, listing one public key per line, or as
1706: an OpenSSH Key Revocation List (KRL) as generated by
1707: .Xr ssh-keygen 1 .
1708: For more information on KRLs, see the KEY REVOCATION LISTS section in
1709: .Xr ssh-keygen 1 .
1.380 dtucker 1710: Arguments to
1711: .Cm RevokedHostKeys
1712: may use the tilde syntax to refer to a user's home directory,
1713: the tokens described in the
1714: .Sx TOKENS
1715: section and environment variables as described in the
1716: .Sx ENVIRONMENT VARIABLES
1717: section.
1.305 naddy 1718: .It Cm SecurityKeyProvider
1.313 naddy 1719: Specifies a path to a library that will be used when loading any
1720: FIDO authenticator-hosted keys, overriding the default of using
1721: the built-in USB HID support.
1.309 naddy 1722: .Pp
1723: If the specified value begins with a
1724: .Sq $
1725: character, then it will be treated as an environment variable containing
1726: the path to the library.
1.32 djm 1727: .It Cm SendEnv
1728: Specifies what variables from the local
1729: .Xr environ 7
1730: should be sent to the server.
1.84 jmc 1731: The server must also support it, and the server must be configured to
1.33 djm 1732: accept these environment variables.
1.207 dtucker 1733: Note that the
1734: .Ev TERM
1.208 jmc 1735: environment variable is always sent whenever a
1.207 dtucker 1736: pseudo-terminal is requested as it is required by the protocol.
1.32 djm 1737: Refer to
1738: .Cm AcceptEnv
1739: in
1740: .Xr sshd_config 5
1741: for how to configure the server.
1.80 jmc 1742: Variables are specified by name, which may contain wildcard characters.
1.33 djm 1743: Multiple environment variables may be separated by whitespace or spread
1.32 djm 1744: across multiple
1745: .Cm SendEnv
1746: directives.
1.81 jmc 1747: .Pp
1748: See
1749: .Sx PATTERNS
1750: for more information on patterns.
1.271 djm 1751: .Pp
1.272 jmc 1752: It is possible to clear previously set
1.271 djm 1753: .Cm SendEnv
1754: variable names by prefixing patterns with
1755: .Pa - .
1756: The default is not to send any environment variables.
1.28 markus 1757: .It Cm ServerAliveCountMax
1.73 jmc 1758: Sets the number of server alive messages (see below) which may be
1.28 markus 1759: sent without
1.84 jmc 1760: .Xr ssh 1
1.28 markus 1761: receiving any messages back from the server.
1762: If this threshold is reached while server alive messages are being sent,
1.84 jmc 1763: ssh will disconnect from the server, terminating the session.
1.28 markus 1764: It is important to note that the use of server alive messages is very
1765: different from
1766: .Cm TCPKeepAlive
1767: (below).
1768: The server alive messages are sent through the encrypted channel
1769: and therefore will not be spoofable.
1770: The TCP keepalive option enabled by
1771: .Cm TCPKeepAlive
1772: is spoofable.
1773: The server alive mechanism is valuable when the client or
1.298 dtucker 1774: server depend on knowing when a connection has become unresponsive.
1.28 markus 1775: .Pp
1776: The default value is 3.
1777: If, for example,
1778: .Cm ServerAliveInterval
1.84 jmc 1779: (see below) is set to 15 and
1.28 markus 1780: .Cm ServerAliveCountMax
1.84 jmc 1781: is left at the default, if the server becomes unresponsive,
1782: ssh will disconnect after approximately 45 seconds.
1.67 jmc 1783: .It Cm ServerAliveInterval
1784: Sets a timeout interval in seconds after which if no data has been received
1785: from the server,
1.84 jmc 1786: .Xr ssh 1
1.67 jmc 1787: will send a message through the encrypted
1788: channel to request a response from the server.
1789: The default
1790: is 0, indicating that these messages will not be sent to the server.
1.357 jmc 1791: .It Cm SessionType
1792: May be used to either request invocation of a subsystem on the remote system,
1793: or to prevent the execution of a remote command at all.
1794: The latter is useful for just forwarding ports.
1795: The argument to this keyword must be
1796: .Cm none
1797: (same as the
1798: .Fl N
1799: option),
1800: .Cm subsystem
1801: (same as the
1802: .Fl s
1803: option) or
1804: .Cm default
1805: (shell or command execution).
1.277 jmc 1806: .It Cm SetEnv
1807: Directly specify one or more environment variables and their contents to
1808: be sent to the server.
1809: Similarly to
1810: .Cm SendEnv ,
1.354 djm 1811: with the exception of the
1812: .Ev TERM
1813: variable, the server must be prepared to accept the environment variable.
1.358 djm 1814: .It Cm StdinNull
1815: Redirects stdin from
1816: .Pa /dev/null
1817: (actually, prevents reading from stdin).
1818: Either this or the equivalent
1819: .Fl n
1820: option must be used when
1821: .Nm ssh
1822: is run in the background.
1823: The argument to this keyword must be
1824: .Cm yes
1825: (same as the
1826: .Fl n
1827: option) or
1828: .Cm no
1829: (the default).
1.191 millert 1830: .It Cm StreamLocalBindMask
1831: Sets the octal file creation mode mask
1832: .Pq umask
1833: used when creating a Unix-domain socket file for local or remote
1834: port forwarding.
1835: This option is only used for port forwarding to a Unix-domain socket file.
1836: .Pp
1837: The default value is 0177, which creates a Unix-domain socket file that is
1838: readable and writable only by the owner.
1839: Note that not all operating systems honor the file mode on Unix-domain
1840: socket files.
1841: .It Cm StreamLocalBindUnlink
1842: Specifies whether to remove an existing Unix-domain socket file for local
1843: or remote port forwarding before creating a new one.
1844: If the socket file already exists and
1845: .Cm StreamLocalBindUnlink
1846: is not enabled,
1847: .Nm ssh
1848: will be unable to forward the port to the Unix-domain socket file.
1849: This option is only used for port forwarding to a Unix-domain socket file.
1850: .Pp
1851: The argument must be
1.240 jmc 1852: .Cm yes
1.191 millert 1853: or
1.240 jmc 1854: .Cm no
1855: (the default).
1.1 stevesk 1856: .It Cm StrictHostKeyChecking
1857: If this flag is set to
1.240 jmc 1858: .Cm yes ,
1.84 jmc 1859: .Xr ssh 1
1.1 stevesk 1860: will never automatically add host keys to the
1.50 djm 1861: .Pa ~/.ssh/known_hosts
1.1 stevesk 1862: file, and refuses to connect to hosts whose host key has changed.
1.263 dtucker 1863: This provides maximum protection against man-in-the-middle (MITM) attacks,
1.84 jmc 1864: though it can be annoying when the
1.1 stevesk 1865: .Pa /etc/ssh/ssh_known_hosts
1.84 jmc 1866: file is poorly maintained or when connections to new hosts are
1.1 stevesk 1867: frequently made.
1868: This option forces the user to manually
1869: add all new hosts.
1.255 jmc 1870: .Pp
1.1 stevesk 1871: If this flag is set to
1.364 dtucker 1872: .Cm accept-new
1.360 jmc 1873: then ssh will automatically add new host keys to the user's
1874: .Pa known_hosts
1875: file, but will not permit connections to hosts with
1.254 djm 1876: changed host keys.
1877: If this flag is set to
1.364 dtucker 1878: .Cm no
1.254 djm 1879: or
1.364 dtucker 1880: .Cm off ,
1.255 jmc 1881: ssh will automatically add new host keys to the user known hosts files
1882: and allow connections to hosts with changed hostkeys to proceed,
1883: subject to some restrictions.
1.1 stevesk 1884: If this flag is set to
1.240 jmc 1885: .Cm ask
1886: (the default),
1.1 stevesk 1887: new host keys
1888: will be added to the user known host files only after the user
1889: has confirmed that is what they really want to do, and
1.84 jmc 1890: ssh will refuse to connect to hosts whose host key has changed.
1.1 stevesk 1891: The host keys of
1892: known hosts will be verified automatically in all cases.
1.244 jmc 1893: .It Cm SyslogFacility
1894: Gives the facility code that is used when logging messages from
1895: .Xr ssh 1 .
1896: The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1897: LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1898: The default is USER.
1.26 markus 1899: .It Cm TCPKeepAlive
1900: Specifies whether the system should send TCP keepalive messages to the
1901: other side.
1902: If they are sent, death of the connection or crash of one
1903: of the machines will be properly noticed.
1904: However, this means that
1905: connections will die if the route is down temporarily, and some people
1906: find it annoying.
1907: .Pp
1908: The default is
1.240 jmc 1909: .Cm yes
1.26 markus 1910: (to send TCP keepalive messages), and the client will notice
1911: if the network goes down or the remote host dies.
1912: This is important in scripts, and many users want it too.
1913: .Pp
1914: To disable TCP keepalive messages, the value should be set to
1.240 jmc 1915: .Cm no .
1.265 djm 1916: See also
1917: .Cm ServerAliveInterval
1918: for protocol-level keepalives.
1.382 djm 1919: .It Cm Tag
1920: Specify a configuration tag name that may be later used by a
1921: .Cm Match
1.383 jsg 1922: directive to select a block of configuration.
1.65 reyk 1923: .It Cm Tunnel
1.95 stevesk 1924: Request
1.65 reyk 1925: .Xr tun 4
1.69 jmc 1926: device forwarding between the client and the server.
1.65 reyk 1927: The argument must be
1.240 jmc 1928: .Cm yes ,
1929: .Cm point-to-point
1.95 stevesk 1930: (layer 3),
1.240 jmc 1931: .Cm ethernet
1.95 stevesk 1932: (layer 2),
1.65 reyk 1933: or
1.240 jmc 1934: .Cm no
1935: (the default).
1.95 stevesk 1936: Specifying
1.240 jmc 1937: .Cm yes
1.95 stevesk 1938: requests the default tunnel mode, which is
1.240 jmc 1939: .Cm point-to-point .
1.65 reyk 1940: .It Cm TunnelDevice
1.95 stevesk 1941: Specifies the
1.65 reyk 1942: .Xr tun 4
1.95 stevesk 1943: devices to open on the client
1944: .Pq Ar local_tun
1945: and the server
1946: .Pq Ar remote_tun .
1947: .Pp
1948: The argument must be
1949: .Sm off
1950: .Ar local_tun Op : Ar remote_tun .
1951: .Sm on
1952: The devices may be specified by numerical ID or the keyword
1.240 jmc 1953: .Cm any ,
1.95 stevesk 1954: which uses the next available tunnel device.
1955: If
1956: .Ar remote_tun
1957: is not specified, it defaults to
1.240 jmc 1958: .Cm any .
1.95 stevesk 1959: The default is
1.240 jmc 1960: .Cm any:any .
1.201 djm 1961: .It Cm UpdateHostKeys
1.200 djm 1962: Specifies whether
1963: .Xr ssh 1
1964: should accept notifications of additional hostkeys from the server sent
1965: after authentication has completed and add them to
1966: .Cm UserKnownHostsFile .
1967: The argument must be
1.240 jmc 1968: .Cm yes ,
1969: .Cm no
1.320 djm 1970: or
1.240 jmc 1971: .Cm ask .
1.320 djm 1972: This option allows learning alternate hostkeys for a server
1.201 djm 1973: and supports graceful key rotation by allowing a server to send replacement
1974: public keys before old ones are removed.
1.336 djm 1975: .Pp
1.200 djm 1976: Additional hostkeys are only accepted if the key used to authenticate the
1.336 djm 1977: host was already trusted or explicitly accepted by the user, the host was
1978: authenticated via
1979: .Cm UserKnownHostsFile
1980: (i.e. not
1981: .Cm GlobalKnownHostsFile )
1982: and the host was authenticated using a plain key and not a certificate.
1.320 djm 1983: .Pp
1984: .Cm UpdateHostKeys
1.321 jmc 1985: is enabled by default if the user has not overridden the default
1.320 djm 1986: .Cm UserKnownHostsFile
1.335 djm 1987: setting and has not enabled
1988: .Cm VerifyHostKeyDNS ,
1989: otherwise
1.320 djm 1990: .Cm UpdateHostKeys
1991: will be set to
1.334 djm 1992: .Cm no .
1.320 djm 1993: .Pp
1.204 djm 1994: If
1995: .Cm UpdateHostKeys
1996: is set to
1.240 jmc 1997: .Cm ask ,
1.204 djm 1998: then the user is asked to confirm the modifications to the known_hosts file.
1.205 djm 1999: Confirmation is currently incompatible with
2000: .Cm ControlPersist ,
2001: and will be disabled if it is enabled.
1.200 djm 2002: .Pp
2003: Presently, only
2004: .Xr sshd 8
2005: from OpenSSH 6.8 and greater support the
1.240 jmc 2006: .Qq hostkeys@openssh.com
1.200 djm 2007: protocol extension used to inform the client of all the server's hostkeys.
1.1 stevesk 2008: .It Cm User
2009: Specifies the user to log in as.
2010: This can be useful when a different user name is used on different machines.
2011: This saves the trouble of
2012: having to remember to give the user name on the command line.
2013: .It Cm UserKnownHostsFile
1.151 djm 2014: Specifies one or more files to use for the user
2015: host key database, separated by whitespace.
1.329 dtucker 2016: Each filename may use tilde notation to refer to the user's home directory,
2017: the tokens described in the
2018: .Sx TOKENS
2019: section and environment variables as described in the
2020: .Sx ENVIRONMENT VARIABLES
2021: section.
1.377 dtucker 2022: A value of
2023: .Cm none
2024: causes
2025: .Xr ssh 1
1.378 jmc 2026: to ignore any user-specific known hosts files.
1.151 djm 2027: The default is
2028: .Pa ~/.ssh/known_hosts ,
2029: .Pa ~/.ssh/known_hosts2 .
1.8 jakob 2030: .It Cm VerifyHostKeyDNS
2031: Specifies whether to verify the remote key using DNS and SSHFP resource
2032: records.
1.24 jakob 2033: If this option is set to
1.240 jmc 2034: .Cm yes ,
1.25 jmc 2035: the client will implicitly trust keys that match a secure fingerprint
1.24 jakob 2036: from DNS.
2037: Insecure fingerprints will be handled as if this option was set to
1.240 jmc 2038: .Cm ask .
1.24 jakob 2039: If this option is set to
1.240 jmc 2040: .Cm ask ,
1.24 jakob 2041: information on fingerprint match will be displayed, but the user will still
2042: need to confirm new host keys according to the
2043: .Cm StrictHostKeyChecking
2044: option.
1.8 jakob 2045: The default is
1.240 jmc 2046: .Cm no .
1.84 jmc 2047: .Pp
1.240 jmc 2048: See also
2049: .Sx VERIFYING HOST KEYS
2050: in
1.84 jmc 2051: .Xr ssh 1 .
1.111 grunk 2052: .It Cm VisualHostKey
2053: If this flag is set to
1.240 jmc 2054: .Cm yes ,
1.111 grunk 2055: an ASCII art representation of the remote host key fingerprint is
1.197 djm 2056: printed in addition to the fingerprint string at login and
1.114 stevesk 2057: for unknown host keys.
1.111 grunk 2058: If this flag is set to
1.240 jmc 2059: .Cm no
2060: (the default),
1.114 stevesk 2061: no fingerprint strings are printed at login and
1.197 djm 2062: only the fingerprint string will be printed for unknown host keys.
1.1 stevesk 2063: .It Cm XAuthLocation
1.5 stevesk 2064: Specifies the full pathname of the
1.1 stevesk 2065: .Xr xauth 1
2066: program.
2067: The default is
2068: .Pa /usr/X11R6/bin/xauth .
2069: .El
1.86 jmc 2070: .Sh PATTERNS
2071: A
2072: .Em pattern
2073: consists of zero or more non-whitespace characters,
2074: .Sq *
2075: (a wildcard that matches zero or more characters),
2076: or
2077: .Sq ?\&
2078: (a wildcard that matches exactly one character).
2079: For example, to specify a set of declarations for any host in the
1.240 jmc 2080: .Qq .co.uk
1.86 jmc 2081: set of domains,
2082: the following pattern could be used:
2083: .Pp
2084: .Dl Host *.co.uk
2085: .Pp
2086: The following pattern
2087: would match any host in the 192.168.0.[0-9] network range:
2088: .Pp
2089: .Dl Host 192.168.0.?
2090: .Pp
2091: A
2092: .Em pattern-list
2093: is a comma-separated list of patterns.
2094: Patterns within pattern-lists may be negated
2095: by preceding them with an exclamation mark
2096: .Pq Sq !\& .
2097: For example,
1.174 djm 2098: to allow a key to be used from anywhere within an organization
1.86 jmc 2099: except from the
1.240 jmc 2100: .Qq dialup
1.86 jmc 2101: pool,
2102: the following entry (in authorized_keys) could be used:
2103: .Pp
2104: .Dl from=\&"!*.dialup.example.com,*.example.com\&"
1.258 djm 2105: .Pp
2106: Note that a negated match will never produce a positive result by itself.
2107: For example, attempting to match
2108: .Qq host3
2109: against the following pattern-list will fail:
2110: .Pp
2111: .Dl from=\&"!host1,!host2\&"
2112: .Pp
2113: The solution here is to include a term that will yield a positive match,
2114: such as a wildcard:
2115: .Pp
2116: .Dl from=\&"!host1,!host2,*\&"
1.239 jmc 2117: .Sh TOKENS
2118: Arguments to some keywords can make use of tokens,
2119: which are expanded at runtime:
2120: .Pp
2121: .Bl -tag -width XXXX -offset indent -compact
2122: .It %%
2123: A literal
2124: .Sq % .
2125: .It \&%C
1.257 jmc 2126: Hash of %l%h%p%r.
1.239 jmc 2127: .It %d
2128: Local user's home directory.
1.339 djm 2129: .It %f
2130: The fingerprint of the server's host key.
2131: .It %H
2132: The
2133: .Pa known_hosts
2134: hostname or address that is being searched for.
1.239 jmc 2135: .It %h
2136: The remote hostname.
1.340 jmc 2137: .It \%%I
1.339 djm 2138: A string describing the reason for a
2139: .Cm KnownHostsCommand
1.340 jmc 2140: execution: either
2141: .Cm ADDRESS
1.339 djm 2142: when looking up a host by address (only when
2143: .Cm CheckHostIP
2144: is enabled),
1.340 jmc 2145: .Cm HOSTNAME
2146: when searching by hostname, or
2147: .Cm ORDER
1.339 djm 2148: when preparing the host key algorithm preference list to use for the
2149: destination host.
1.239 jmc 2150: .It %i
2151: The local user ID.
1.339 djm 2152: .It %K
2153: The base64 encoded host key.
1.330 dtucker 2154: .It %k
1.350 jsg 2155: The host key alias if specified, otherwise the original remote hostname given
1.330 dtucker 2156: on the command line.
1.239 jmc 2157: .It %L
2158: The local hostname.
2159: .It %l
2160: The local hostname, including the domain name.
2161: .It %n
2162: The original remote hostname, as given on the command line.
2163: .It %p
2164: The remote port.
2165: .It %r
2166: The remote username.
1.261 djm 2167: .It \&%T
2168: The local
2169: .Xr tun 4
2170: or
2171: .Xr tap 4
2172: network interface assigned if
1.262 jmc 2173: tunnel forwarding was requested, or
2174: .Qq NONE
1.261 djm 2175: otherwise.
1.339 djm 2176: .It %t
2177: The type of the server host key, e.g.
1.360 jmc 2178: .Cm ssh-ed25519 .
1.239 jmc 2179: .It %u
2180: The local username.
2181: .El
2182: .Pp
1.323 dtucker 2183: .Cm CertificateFile ,
2184: .Cm ControlPath ,
2185: .Cm IdentityAgent ,
2186: .Cm IdentityFile ,
1.339 djm 2187: .Cm KnownHostsCommand ,
1.325 jmc 2188: .Cm LocalForward ,
1.324 dtucker 2189: .Cm Match exec ,
2190: .Cm RemoteCommand ,
1.329 dtucker 2191: .Cm RemoteForward ,
1.380 dtucker 2192: .Cm RevokedHostKeys ,
1.323 dtucker 2193: and
1.331 jmc 2194: .Cm UserKnownHostsFile
1.349 dtucker 2195: accept the tokens %%, %C, %d, %h, %i, %k, %L, %l, %n, %p, %r, and %u.
1.239 jmc 2196: .Pp
1.339 djm 2197: .Cm KnownHostsCommand
2198: additionally accepts the tokens %f, %H, %I, %K and %t.
2199: .Pp
1.295 jmc 2200: .Cm Hostname
1.239 jmc 2201: accepts the tokens %% and %h.
2202: .Pp
2203: .Cm LocalCommand
1.323 dtucker 2204: accepts all tokens.
1.239 jmc 2205: .Pp
2206: .Cm ProxyCommand
1.372 dtucker 2207: and
2208: .Cm ProxyJump
2209: accept the tokens %%, %h, %n, %p, and %r.
1.387 djm 2210: .Pp
2211: Note that some of these directives build commands for execution via the shell.
2212: Because
2213: .Xr ssh 1
2214: performs no filtering or escaping of characters that have special meaning in
1.388 ! jmc 2215: shell commands (e.g. quotes), it is the user's responsibility to ensure that
1.387 djm 2216: the arguments passed to
2217: .Xr ssh 1
2218: do not contain such characters and that tokens are appropriately quoted
2219: when used.
1.326 dtucker 2220: .Sh ENVIRONMENT VARIABLES
2221: Arguments to some keywords can be expanded at runtime from environment
2222: variables on the client by enclosing them in
2223: .Ic ${} ,
2224: for example
2225: .Ic ${HOME}/.ssh
2226: would refer to the user's .ssh directory.
2227: If a specified environment variable does not exist then an error will be
2228: returned and the setting for that keyword will be ignored.
2229: .Pp
2230: The keywords
2231: .Cm CertificateFile ,
2232: .Cm ControlPath ,
1.329 dtucker 2233: .Cm IdentityAgent ,
1.352 jmc 2234: .Cm IdentityFile ,
1.339 djm 2235: .Cm KnownHostsCommand ,
1.326 dtucker 2236: and
1.329 dtucker 2237: .Cm UserKnownHostsFile
1.326 dtucker 2238: support environment variables.
2239: The keywords
2240: .Cm LocalForward
2241: and
2242: .Cm RemoteForward
2243: support environment variables only for Unix domain socket paths.
1.1 stevesk 2244: .Sh FILES
2245: .Bl -tag -width Ds
1.50 djm 2246: .It Pa ~/.ssh/config
1.1 stevesk 2247: This is the per-user configuration file.
2248: The format of this file is described above.
1.84 jmc 2249: This file is used by the SSH client.
1.30 djm 2250: Because of the potential for abuse, this file must have strict permissions:
1.290 jmc 2251: read/write for the user, and not writable by others.
1.1 stevesk 2252: .It Pa /etc/ssh/ssh_config
2253: Systemwide configuration file.
2254: This file provides defaults for those
2255: values that are not specified in the user's configuration file, and
2256: for those users who do not have a configuration file.
2257: This file must be world-readable.
2258: .El
1.13 jmc 2259: .Sh SEE ALSO
2260: .Xr ssh 1
1.1 stevesk 2261: .Sh AUTHORS
1.240 jmc 2262: .An -nosplit
1.1 stevesk 2263: OpenSSH is a derivative of the original and free
1.240 jmc 2264: ssh 1.2.12 release by
2265: .An Tatu Ylonen .
2266: .An Aaron Campbell , Bob Beck , Markus Friedl ,
2267: .An Niels Provos , Theo de Raadt
2268: and
2269: .An Dug Song
1.1 stevesk 2270: removed many bugs, re-added newer features and
2271: created OpenSSH.
1.240 jmc 2272: .An Markus Friedl
2273: contributed the support for SSH protocol versions 1.5 and 2.0.