Annotation of src/usr.bin/ssh/ssh_config.5, Revision 1.382
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.382 ! djm 36: .\" $OpenBSD: ssh_config.5,v 1.381 2023/07/17 04:04:36 djm Exp $
! 37: .Dd $Mdocdate: July 17 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.1 stevesk 1362: .It Cm PasswordAuthentication
1363: Specifies whether to use password authentication.
1364: The argument to this keyword must be
1.240 jmc 1365: .Cm yes
1366: (the default)
1.1 stevesk 1367: or
1.240 jmc 1368: .Cm no .
1.65 reyk 1369: .It Cm PermitLocalCommand
1370: Allow local command execution via the
1371: .Ic LocalCommand
1372: option or using the
1.66 jmc 1373: .Ic !\& Ns Ar command
1.65 reyk 1374: escape sequence in
1375: .Xr ssh 1 .
1376: The argument must be
1.240 jmc 1377: .Cm yes
1.65 reyk 1378: or
1.240 jmc 1379: .Cm no
1380: (the default).
1.347 markus 1381: .It Cm PermitRemoteOpen
1382: Specifies the destinations to which remote TCP port forwarding is permitted when
1383: .Cm RemoteForward
1384: is used as a SOCKS proxy.
1385: The forwarding specification must be one of the following forms:
1386: .Pp
1387: .Bl -item -offset indent -compact
1388: .It
1389: .Cm PermitRemoteOpen
1390: .Sm off
1391: .Ar host : port
1392: .Sm on
1393: .It
1394: .Cm PermitRemoteOpen
1395: .Sm off
1396: .Ar IPv4_addr : port
1397: .Sm on
1398: .It
1399: .Cm PermitRemoteOpen
1400: .Sm off
1401: .Ar \&[ IPv6_addr \&] : port
1402: .Sm on
1403: .El
1404: .Pp
1405: Multiple forwards may be specified by separating them with whitespace.
1406: An argument of
1407: .Cm any
1408: can be used to remove all restrictions and permit any forwarding requests.
1409: An argument of
1410: .Cm none
1411: can be used to prohibit all forwarding requests.
1412: The wildcard
1413: .Sq *
1414: can be used for host or port to allow all hosts or ports respectively.
1415: Otherwise, no pattern matching or address lookups are performed on supplied
1416: names.
1.127 markus 1417: .It Cm PKCS11Provider
1.292 djm 1418: Specifies which PKCS#11 provider to use or
1419: .Cm none
1420: to indicate that no provider should be used (the default).
1421: The argument to this keyword is a path to the PKCS#11 shared library
1.127 markus 1422: .Xr ssh 1
1.292 djm 1423: should use to communicate with a PKCS#11 token providing keys for user
1424: authentication.
1.67 jmc 1425: .It Cm Port
1426: Specifies the port number to connect on the remote host.
1.84 jmc 1427: The default is 22.
1.1 stevesk 1428: .It Cm PreferredAuthentications
1.226 jmc 1429: Specifies the order in which the client should try authentication methods.
1.48 jmc 1430: This allows a client to prefer one method (e.g.\&
1.1 stevesk 1431: .Cm keyboard-interactive )
1.48 jmc 1432: over another method (e.g.\&
1.131 jmc 1433: .Cm password ) .
1434: The default is:
1435: .Bd -literal -offset indent
1436: gssapi-with-mic,hostbased,publickey,
1437: keyboard-interactive,password
1438: .Ed
1.1 stevesk 1439: .It Cm ProxyCommand
1440: Specifies the command to use to connect to the server.
1441: The command
1.190 djm 1442: string extends to the end of the line, and is executed
1443: using the user's shell
1444: .Ql exec
1445: directive to avoid a lingering shell process.
1446: .Pp
1.239 jmc 1447: Arguments to
1448: .Cm ProxyCommand
1449: accept the tokens described in the
1450: .Sx TOKENS
1451: section.
1.1 stevesk 1452: The command can be basically anything,
1453: and should read from its standard input and write to its standard output.
1454: It should eventually connect an
1455: .Xr sshd 8
1456: server running on some machine, or execute
1457: .Ic sshd -i
1458: somewhere.
1459: Host key management will be done using the
1.296 jmc 1460: .Cm Hostname
1461: of the host being connected (defaulting to the name typed by the user).
1.7 jmc 1462: Setting the command to
1.240 jmc 1463: .Cm none
1.6 markus 1464: disables this option entirely.
1.1 stevesk 1465: Note that
1466: .Cm CheckHostIP
1467: is not available for connects with a proxy command.
1.52 djm 1468: .Pp
1469: This directive is useful in conjunction with
1470: .Xr nc 1
1471: and its proxy support.
1.53 jmc 1472: For example, the following directive would connect via an HTTP proxy at
1.52 djm 1473: 192.0.2.0:
1474: .Bd -literal -offset 3n
1475: ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p
1476: .Ed
1.233 djm 1477: .It Cm ProxyJump
1.260 millert 1478: Specifies one or more jump proxies as either
1.233 djm 1479: .Xo
1480: .Sm off
1.234 jmc 1481: .Op Ar user No @
1.233 djm 1482: .Ar host
1.234 jmc 1483: .Op : Ns Ar port
1.233 djm 1484: .Sm on
1.260 millert 1485: or an ssh URI
1.233 djm 1486: .Xc .
1.235 djm 1487: Multiple proxies may be separated by comma characters and will be visited
1.236 djm 1488: sequentially.
1.233 djm 1489: Setting this option will cause
1490: .Xr ssh 1
1491: to connect to the target host by first making a
1492: .Xr ssh 1
1493: connection to the specified
1494: .Cm ProxyJump
1495: host and then establishing a
1.234 jmc 1496: TCP forwarding to the ultimate target from there.
1.346 dlg 1497: Setting the host to
1498: .Cm none
1499: disables this option entirely.
1.233 djm 1500: .Pp
1501: Note that this option will compete with the
1502: .Cm ProxyCommand
1503: option - whichever is specified first will prevent later instances of the
1504: other from taking effect.
1.289 djm 1505: .Pp
1506: Note also that the configuration for the destination host (either supplied
1507: via the command-line or the configuration file) is not generally applied
1508: to jump hosts.
1509: .Pa ~/.ssh/config
1510: should be used if specific configuration is required for jump hosts.
1.167 djm 1511: .It Cm ProxyUseFdpass
1.168 jmc 1512: Specifies that
1.167 djm 1513: .Cm ProxyCommand
1514: will pass a connected file descriptor back to
1.168 jmc 1515: .Xr ssh 1
1.167 djm 1516: instead of continuing to execute and pass data.
1517: The default is
1.240 jmc 1518: .Cm no .
1.343 dtucker 1519: .It Cm PubkeyAcceptedAlgorithms
1520: Specifies the signature algorithms that will be used for public key
1521: authentication as a comma-separated list of patterns.
1.299 kn 1522: If the specified list begins with a
1.214 djm 1523: .Sq +
1.343 dtucker 1524: character, then the algorithms after it will be appended to the default
1.214 djm 1525: instead of replacing it.
1.299 kn 1526: If the specified list begins with a
1.241 djm 1527: .Sq -
1.343 dtucker 1528: character, then the specified algorithms (including wildcards) will be removed
1.241 djm 1529: from the default set instead of replacing them.
1.301 naddy 1530: If the specified list begins with a
1531: .Sq ^
1.343 dtucker 1532: character, then the specified algorithms will be placed at the head of the
1.301 naddy 1533: default set.
1.213 markus 1534: The default for this option is:
1535: .Bd -literal -offset 3n
1.333 djm 1536: ssh-ed25519-cert-v01@openssh.com,
1.213 markus 1537: ecdsa-sha2-nistp256-cert-v01@openssh.com,
1538: ecdsa-sha2-nistp384-cert-v01@openssh.com,
1539: ecdsa-sha2-nistp521-cert-v01@openssh.com,
1.333 djm 1540: sk-ssh-ed25519-cert-v01@openssh.com,
1.311 naddy 1541: sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
1.305 naddy 1542: rsa-sha2-512-cert-v01@openssh.com,
1543: rsa-sha2-256-cert-v01@openssh.com,
1.333 djm 1544: ssh-ed25519,
1.311 naddy 1545: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1.333 djm 1546: sk-ssh-ed25519@openssh.com,
1.305 naddy 1547: sk-ecdsa-sha2-nistp256@openssh.com,
1.366 kn 1548: rsa-sha2-512,rsa-sha2-256
1.213 markus 1549: .Ed
1550: .Pp
1.348 djm 1551: The list of available signature algorithms may also be obtained using
1.343 dtucker 1552: .Qq ssh -Q PubkeyAcceptedAlgorithms .
1.1 stevesk 1553: .It Cm PubkeyAuthentication
1554: Specifies whether to try public key authentication.
1555: The argument to this keyword must be
1.240 jmc 1556: .Cm yes
1.369 djm 1557: (the default),
1558: .Cm no ,
1559: .Cm unbound
1.1 stevesk 1560: or
1.369 djm 1561: .Cm host-bound .
1562: The final two options enable public key authentication while respectively
1563: disabling or enabling the OpenSSH host-bound authentication protocol
1564: extension required for restricted
1565: .Xr ssh-agent 1
1566: forwarding.
1.75 dtucker 1567: .It Cm RekeyLimit
1.373 djm 1568: Specifies the maximum amount of data that may be transmitted or received
1569: before the session key is renegotiated, optionally followed by a maximum
1570: amount of time that may pass before the session key is renegotiated.
1.162 dtucker 1571: The first argument is specified in bytes and may have a suffix of
1.76 jmc 1572: .Sq K ,
1573: .Sq M ,
1.75 dtucker 1574: or
1.76 jmc 1575: .Sq G
1.75 dtucker 1576: to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1577: The default is between
1.84 jmc 1578: .Sq 1G
1.75 dtucker 1579: and
1.84 jmc 1580: .Sq 4G ,
1.75 dtucker 1581: depending on the cipher.
1.162 dtucker 1582: The optional second value is specified in seconds and may use any of the
1.293 schwarze 1583: units documented in the TIME FORMATS section of
1.162 dtucker 1584: .Xr sshd_config 5 .
1585: The default value for
1586: .Cm RekeyLimit
1587: is
1.240 jmc 1588: .Cm default none ,
1.162 dtucker 1589: which means that rekeying is performed after the cipher's default amount
1590: of data has been sent or received and no time based rekeying is done.
1.249 bluhm 1591: .It Cm RemoteCommand
1592: Specifies a command to execute on the remote machine after successfully
1593: connecting to the server.
1594: The command string extends to the end of the line, and is executed with
1595: the user's shell.
1.250 jmc 1596: Arguments to
1597: .Cm RemoteCommand
1598: accept the tokens described in the
1599: .Sx TOKENS
1600: section.
1.1 stevesk 1601: .It Cm RemoteForward
1.74 jmc 1602: Specifies that a TCP port on the remote machine be forwarded over
1.256 markus 1603: the secure channel.
1.273 djm 1604: The remote port may either be forwarded to a specified host and port
1.256 markus 1605: from the local machine, or may act as a SOCKS 4/5 proxy that allows a remote
1606: client to connect to arbitrary destinations from the local machine.
1.324 dtucker 1607: The first argument is the listening specification and may be
1.43 djm 1608: .Sm off
1.49 jmc 1609: .Oo Ar bind_address : Oc Ar port
1.43 djm 1610: .Sm on
1.324 dtucker 1611: or, if the remote host supports it, a Unix domain socket path.
1.256 markus 1612: If forwarding to a specific destination then the second argument must be
1.324 dtucker 1613: .Ar host : Ns Ar hostport
1614: or a Unix domain socket path,
1.256 markus 1615: otherwise if no destination argument is specified then the remote forwarding
1616: will be established as a SOCKS proxy.
1.370 naddy 1617: When acting as a SOCKS proxy, the destination of the connection can be
1.347 markus 1618: restricted by
1619: .Cm PermitRemoteOpen .
1.256 markus 1620: .Pp
1.138 djm 1621: IPv6 addresses can be specified by enclosing addresses in square brackets.
1.1 stevesk 1622: Multiple forwardings may be specified, and additional
1623: forwardings can be given on the command line.
1.113 stevesk 1624: Privileged ports can be forwarded only when
1625: logging in as root on the remote machine.
1.326 dtucker 1626: Unix domain socket paths may use the tokens described in the
1.324 dtucker 1627: .Sx TOKENS
1.326 dtucker 1628: section and environment variables as described in the
1629: .Sx ENVIRONMENT VARIABLES
1.324 dtucker 1630: section.
1.118 jmc 1631: .Pp
1.117 djm 1632: If the
1633: .Ar port
1.240 jmc 1634: argument is 0,
1.117 djm 1635: the listen port will be dynamically allocated on the server and reported
1636: to the client at run time.
1.43 djm 1637: .Pp
1638: If the
1639: .Ar bind_address
1640: is not specified, the default is to only bind to loopback addresses.
1641: If the
1642: .Ar bind_address
1643: is
1644: .Ql *
1645: or an empty string, then the forwarding is requested to listen on all
1646: interfaces.
1647: Specifying a remote
1648: .Ar bind_address
1.46 jmc 1649: will only succeed if the server's
1650: .Cm GatewayPorts
1.43 djm 1651: option is enabled (see
1.46 jmc 1652: .Xr sshd_config 5 ) .
1.149 djm 1653: .It Cm RequestTTY
1654: Specifies whether to request a pseudo-tty for the session.
1655: The argument may be one of:
1.240 jmc 1656: .Cm no
1.149 djm 1657: (never request a TTY),
1.240 jmc 1658: .Cm yes
1.149 djm 1659: (always request a TTY when standard input is a TTY),
1.240 jmc 1660: .Cm force
1.149 djm 1661: (always request a TTY) or
1.240 jmc 1662: .Cm auto
1.149 djm 1663: (request a TTY when opening a login session).
1664: This option mirrors the
1665: .Fl t
1666: and
1667: .Fl T
1668: flags for
1669: .Xr ssh 1 .
1.374 djm 1670: .It Cm RequiredRSASize
1671: Specifies the minimum RSA key size (in bits) that
1672: .Xr ssh 1
1673: will accept.
1674: User authentication keys smaller than this limit will be ignored.
1675: Servers that present host keys smaller than this limit will cause the
1676: connection to be terminated.
1677: The default is
1678: .Cm 1024
1679: bits.
1680: Note that this limit may only be raised from the default.
1.196 djm 1681: .It Cm RevokedHostKeys
1682: Specifies revoked host public keys.
1683: Keys listed in this file will be refused for host authentication.
1684: Note that if this file does not exist or is not readable,
1685: then host authentication will be refused for all hosts.
1686: Keys may be specified as a text file, listing one public key per line, or as
1687: an OpenSSH Key Revocation List (KRL) as generated by
1688: .Xr ssh-keygen 1 .
1689: For more information on KRLs, see the KEY REVOCATION LISTS section in
1690: .Xr ssh-keygen 1 .
1.380 dtucker 1691: Arguments to
1692: .Cm RevokedHostKeys
1693: may use the tilde syntax to refer to a user's home directory,
1694: the tokens described in the
1695: .Sx TOKENS
1696: section and environment variables as described in the
1697: .Sx ENVIRONMENT VARIABLES
1698: section.
1.305 naddy 1699: .It Cm SecurityKeyProvider
1.313 naddy 1700: Specifies a path to a library that will be used when loading any
1701: FIDO authenticator-hosted keys, overriding the default of using
1702: the built-in USB HID support.
1.309 naddy 1703: .Pp
1704: If the specified value begins with a
1705: .Sq $
1706: character, then it will be treated as an environment variable containing
1707: the path to the library.
1.32 djm 1708: .It Cm SendEnv
1709: Specifies what variables from the local
1710: .Xr environ 7
1711: should be sent to the server.
1.84 jmc 1712: The server must also support it, and the server must be configured to
1.33 djm 1713: accept these environment variables.
1.207 dtucker 1714: Note that the
1715: .Ev TERM
1.208 jmc 1716: environment variable is always sent whenever a
1.207 dtucker 1717: pseudo-terminal is requested as it is required by the protocol.
1.32 djm 1718: Refer to
1719: .Cm AcceptEnv
1720: in
1721: .Xr sshd_config 5
1722: for how to configure the server.
1.80 jmc 1723: Variables are specified by name, which may contain wildcard characters.
1.33 djm 1724: Multiple environment variables may be separated by whitespace or spread
1.32 djm 1725: across multiple
1726: .Cm SendEnv
1727: directives.
1.81 jmc 1728: .Pp
1729: See
1730: .Sx PATTERNS
1731: for more information on patterns.
1.271 djm 1732: .Pp
1.272 jmc 1733: It is possible to clear previously set
1.271 djm 1734: .Cm SendEnv
1735: variable names by prefixing patterns with
1736: .Pa - .
1737: The default is not to send any environment variables.
1.28 markus 1738: .It Cm ServerAliveCountMax
1.73 jmc 1739: Sets the number of server alive messages (see below) which may be
1.28 markus 1740: sent without
1.84 jmc 1741: .Xr ssh 1
1.28 markus 1742: receiving any messages back from the server.
1743: If this threshold is reached while server alive messages are being sent,
1.84 jmc 1744: ssh will disconnect from the server, terminating the session.
1.28 markus 1745: It is important to note that the use of server alive messages is very
1746: different from
1747: .Cm TCPKeepAlive
1748: (below).
1749: The server alive messages are sent through the encrypted channel
1750: and therefore will not be spoofable.
1751: The TCP keepalive option enabled by
1752: .Cm TCPKeepAlive
1753: is spoofable.
1754: The server alive mechanism is valuable when the client or
1.298 dtucker 1755: server depend on knowing when a connection has become unresponsive.
1.28 markus 1756: .Pp
1757: The default value is 3.
1758: If, for example,
1759: .Cm ServerAliveInterval
1.84 jmc 1760: (see below) is set to 15 and
1.28 markus 1761: .Cm ServerAliveCountMax
1.84 jmc 1762: is left at the default, if the server becomes unresponsive,
1763: ssh will disconnect after approximately 45 seconds.
1.67 jmc 1764: .It Cm ServerAliveInterval
1765: Sets a timeout interval in seconds after which if no data has been received
1766: from the server,
1.84 jmc 1767: .Xr ssh 1
1.67 jmc 1768: will send a message through the encrypted
1769: channel to request a response from the server.
1770: The default
1771: is 0, indicating that these messages will not be sent to the server.
1.357 jmc 1772: .It Cm SessionType
1773: May be used to either request invocation of a subsystem on the remote system,
1774: or to prevent the execution of a remote command at all.
1775: The latter is useful for just forwarding ports.
1776: The argument to this keyword must be
1777: .Cm none
1778: (same as the
1779: .Fl N
1780: option),
1781: .Cm subsystem
1782: (same as the
1783: .Fl s
1784: option) or
1785: .Cm default
1786: (shell or command execution).
1.277 jmc 1787: .It Cm SetEnv
1788: Directly specify one or more environment variables and their contents to
1789: be sent to the server.
1790: Similarly to
1791: .Cm SendEnv ,
1.354 djm 1792: with the exception of the
1793: .Ev TERM
1794: variable, the server must be prepared to accept the environment variable.
1.358 djm 1795: .It Cm StdinNull
1796: Redirects stdin from
1797: .Pa /dev/null
1798: (actually, prevents reading from stdin).
1799: Either this or the equivalent
1800: .Fl n
1801: option must be used when
1802: .Nm ssh
1803: is run in the background.
1804: The argument to this keyword must be
1805: .Cm yes
1806: (same as the
1807: .Fl n
1808: option) or
1809: .Cm no
1810: (the default).
1.191 millert 1811: .It Cm StreamLocalBindMask
1812: Sets the octal file creation mode mask
1813: .Pq umask
1814: used when creating a Unix-domain socket file for local or remote
1815: port forwarding.
1816: This option is only used for port forwarding to a Unix-domain socket file.
1817: .Pp
1818: The default value is 0177, which creates a Unix-domain socket file that is
1819: readable and writable only by the owner.
1820: Note that not all operating systems honor the file mode on Unix-domain
1821: socket files.
1822: .It Cm StreamLocalBindUnlink
1823: Specifies whether to remove an existing Unix-domain socket file for local
1824: or remote port forwarding before creating a new one.
1825: If the socket file already exists and
1826: .Cm StreamLocalBindUnlink
1827: is not enabled,
1828: .Nm ssh
1829: will be unable to forward the port to the Unix-domain socket file.
1830: This option is only used for port forwarding to a Unix-domain socket file.
1831: .Pp
1832: The argument must be
1.240 jmc 1833: .Cm yes
1.191 millert 1834: or
1.240 jmc 1835: .Cm no
1836: (the default).
1.1 stevesk 1837: .It Cm StrictHostKeyChecking
1838: If this flag is set to
1.240 jmc 1839: .Cm yes ,
1.84 jmc 1840: .Xr ssh 1
1.1 stevesk 1841: will never automatically add host keys to the
1.50 djm 1842: .Pa ~/.ssh/known_hosts
1.1 stevesk 1843: file, and refuses to connect to hosts whose host key has changed.
1.263 dtucker 1844: This provides maximum protection against man-in-the-middle (MITM) attacks,
1.84 jmc 1845: though it can be annoying when the
1.1 stevesk 1846: .Pa /etc/ssh/ssh_known_hosts
1.84 jmc 1847: file is poorly maintained or when connections to new hosts are
1.1 stevesk 1848: frequently made.
1849: This option forces the user to manually
1850: add all new hosts.
1.255 jmc 1851: .Pp
1.1 stevesk 1852: If this flag is set to
1.364 dtucker 1853: .Cm accept-new
1.360 jmc 1854: then ssh will automatically add new host keys to the user's
1855: .Pa known_hosts
1856: file, but will not permit connections to hosts with
1.254 djm 1857: changed host keys.
1858: If this flag is set to
1.364 dtucker 1859: .Cm no
1.254 djm 1860: or
1.364 dtucker 1861: .Cm off ,
1.255 jmc 1862: ssh will automatically add new host keys to the user known hosts files
1863: and allow connections to hosts with changed hostkeys to proceed,
1864: subject to some restrictions.
1.1 stevesk 1865: If this flag is set to
1.240 jmc 1866: .Cm ask
1867: (the default),
1.1 stevesk 1868: new host keys
1869: will be added to the user known host files only after the user
1870: has confirmed that is what they really want to do, and
1.84 jmc 1871: ssh will refuse to connect to hosts whose host key has changed.
1.1 stevesk 1872: The host keys of
1873: known hosts will be verified automatically in all cases.
1.244 jmc 1874: .It Cm SyslogFacility
1875: Gives the facility code that is used when logging messages from
1876: .Xr ssh 1 .
1877: The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1878: LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1879: The default is USER.
1.26 markus 1880: .It Cm TCPKeepAlive
1881: Specifies whether the system should send TCP keepalive messages to the
1882: other side.
1883: If they are sent, death of the connection or crash of one
1884: of the machines will be properly noticed.
1885: However, this means that
1886: connections will die if the route is down temporarily, and some people
1887: find it annoying.
1888: .Pp
1889: The default is
1.240 jmc 1890: .Cm yes
1.26 markus 1891: (to send TCP keepalive messages), and the client will notice
1892: if the network goes down or the remote host dies.
1893: This is important in scripts, and many users want it too.
1894: .Pp
1895: To disable TCP keepalive messages, the value should be set to
1.240 jmc 1896: .Cm no .
1.265 djm 1897: See also
1898: .Cm ServerAliveInterval
1899: for protocol-level keepalives.
1.382 ! djm 1900: .It Cm Tag
! 1901: Specify a configuration tag name that may be later used by a
! 1902: .Cm Match
! 1903: directive to select a block of configuation.
1.65 reyk 1904: .It Cm Tunnel
1.95 stevesk 1905: Request
1.65 reyk 1906: .Xr tun 4
1.69 jmc 1907: device forwarding between the client and the server.
1.65 reyk 1908: The argument must be
1.240 jmc 1909: .Cm yes ,
1910: .Cm point-to-point
1.95 stevesk 1911: (layer 3),
1.240 jmc 1912: .Cm ethernet
1.95 stevesk 1913: (layer 2),
1.65 reyk 1914: or
1.240 jmc 1915: .Cm no
1916: (the default).
1.95 stevesk 1917: Specifying
1.240 jmc 1918: .Cm yes
1.95 stevesk 1919: requests the default tunnel mode, which is
1.240 jmc 1920: .Cm point-to-point .
1.65 reyk 1921: .It Cm TunnelDevice
1.95 stevesk 1922: Specifies the
1.65 reyk 1923: .Xr tun 4
1.95 stevesk 1924: devices to open on the client
1925: .Pq Ar local_tun
1926: and the server
1927: .Pq Ar remote_tun .
1928: .Pp
1929: The argument must be
1930: .Sm off
1931: .Ar local_tun Op : Ar remote_tun .
1932: .Sm on
1933: The devices may be specified by numerical ID or the keyword
1.240 jmc 1934: .Cm any ,
1.95 stevesk 1935: which uses the next available tunnel device.
1936: If
1937: .Ar remote_tun
1938: is not specified, it defaults to
1.240 jmc 1939: .Cm any .
1.95 stevesk 1940: The default is
1.240 jmc 1941: .Cm any:any .
1.201 djm 1942: .It Cm UpdateHostKeys
1.200 djm 1943: Specifies whether
1944: .Xr ssh 1
1945: should accept notifications of additional hostkeys from the server sent
1946: after authentication has completed and add them to
1947: .Cm UserKnownHostsFile .
1948: The argument must be
1.240 jmc 1949: .Cm yes ,
1950: .Cm no
1.320 djm 1951: or
1.240 jmc 1952: .Cm ask .
1.320 djm 1953: This option allows learning alternate hostkeys for a server
1.201 djm 1954: and supports graceful key rotation by allowing a server to send replacement
1955: public keys before old ones are removed.
1.336 djm 1956: .Pp
1.200 djm 1957: Additional hostkeys are only accepted if the key used to authenticate the
1.336 djm 1958: host was already trusted or explicitly accepted by the user, the host was
1959: authenticated via
1960: .Cm UserKnownHostsFile
1961: (i.e. not
1962: .Cm GlobalKnownHostsFile )
1963: and the host was authenticated using a plain key and not a certificate.
1.320 djm 1964: .Pp
1965: .Cm UpdateHostKeys
1.321 jmc 1966: is enabled by default if the user has not overridden the default
1.320 djm 1967: .Cm UserKnownHostsFile
1.335 djm 1968: setting and has not enabled
1969: .Cm VerifyHostKeyDNS ,
1970: otherwise
1.320 djm 1971: .Cm UpdateHostKeys
1972: will be set to
1.334 djm 1973: .Cm no .
1.320 djm 1974: .Pp
1.204 djm 1975: If
1976: .Cm UpdateHostKeys
1977: is set to
1.240 jmc 1978: .Cm ask ,
1.204 djm 1979: then the user is asked to confirm the modifications to the known_hosts file.
1.205 djm 1980: Confirmation is currently incompatible with
1981: .Cm ControlPersist ,
1982: and will be disabled if it is enabled.
1.200 djm 1983: .Pp
1984: Presently, only
1985: .Xr sshd 8
1986: from OpenSSH 6.8 and greater support the
1.240 jmc 1987: .Qq hostkeys@openssh.com
1.200 djm 1988: protocol extension used to inform the client of all the server's hostkeys.
1.1 stevesk 1989: .It Cm User
1990: Specifies the user to log in as.
1991: This can be useful when a different user name is used on different machines.
1992: This saves the trouble of
1993: having to remember to give the user name on the command line.
1994: .It Cm UserKnownHostsFile
1.151 djm 1995: Specifies one or more files to use for the user
1996: host key database, separated by whitespace.
1.329 dtucker 1997: Each filename may use tilde notation to refer to the user's home directory,
1998: the tokens described in the
1999: .Sx TOKENS
2000: section and environment variables as described in the
2001: .Sx ENVIRONMENT VARIABLES
2002: section.
1.377 dtucker 2003: A value of
2004: .Cm none
2005: causes
2006: .Xr ssh 1
1.378 jmc 2007: to ignore any user-specific known hosts files.
1.151 djm 2008: The default is
2009: .Pa ~/.ssh/known_hosts ,
2010: .Pa ~/.ssh/known_hosts2 .
1.8 jakob 2011: .It Cm VerifyHostKeyDNS
2012: Specifies whether to verify the remote key using DNS and SSHFP resource
2013: records.
1.24 jakob 2014: If this option is set to
1.240 jmc 2015: .Cm yes ,
1.25 jmc 2016: the client will implicitly trust keys that match a secure fingerprint
1.24 jakob 2017: from DNS.
2018: Insecure fingerprints will be handled as if this option was set to
1.240 jmc 2019: .Cm ask .
1.24 jakob 2020: If this option is set to
1.240 jmc 2021: .Cm ask ,
1.24 jakob 2022: information on fingerprint match will be displayed, but the user will still
2023: need to confirm new host keys according to the
2024: .Cm StrictHostKeyChecking
2025: option.
1.8 jakob 2026: The default is
1.240 jmc 2027: .Cm no .
1.84 jmc 2028: .Pp
1.240 jmc 2029: See also
2030: .Sx VERIFYING HOST KEYS
2031: in
1.84 jmc 2032: .Xr ssh 1 .
1.111 grunk 2033: .It Cm VisualHostKey
2034: If this flag is set to
1.240 jmc 2035: .Cm yes ,
1.111 grunk 2036: an ASCII art representation of the remote host key fingerprint is
1.197 djm 2037: printed in addition to the fingerprint string at login and
1.114 stevesk 2038: for unknown host keys.
1.111 grunk 2039: If this flag is set to
1.240 jmc 2040: .Cm no
2041: (the default),
1.114 stevesk 2042: no fingerprint strings are printed at login and
1.197 djm 2043: only the fingerprint string will be printed for unknown host keys.
1.1 stevesk 2044: .It Cm XAuthLocation
1.5 stevesk 2045: Specifies the full pathname of the
1.1 stevesk 2046: .Xr xauth 1
2047: program.
2048: The default is
2049: .Pa /usr/X11R6/bin/xauth .
2050: .El
1.86 jmc 2051: .Sh PATTERNS
2052: A
2053: .Em pattern
2054: consists of zero or more non-whitespace characters,
2055: .Sq *
2056: (a wildcard that matches zero or more characters),
2057: or
2058: .Sq ?\&
2059: (a wildcard that matches exactly one character).
2060: For example, to specify a set of declarations for any host in the
1.240 jmc 2061: .Qq .co.uk
1.86 jmc 2062: set of domains,
2063: the following pattern could be used:
2064: .Pp
2065: .Dl Host *.co.uk
2066: .Pp
2067: The following pattern
2068: would match any host in the 192.168.0.[0-9] network range:
2069: .Pp
2070: .Dl Host 192.168.0.?
2071: .Pp
2072: A
2073: .Em pattern-list
2074: is a comma-separated list of patterns.
2075: Patterns within pattern-lists may be negated
2076: by preceding them with an exclamation mark
2077: .Pq Sq !\& .
2078: For example,
1.174 djm 2079: to allow a key to be used from anywhere within an organization
1.86 jmc 2080: except from the
1.240 jmc 2081: .Qq dialup
1.86 jmc 2082: pool,
2083: the following entry (in authorized_keys) could be used:
2084: .Pp
2085: .Dl from=\&"!*.dialup.example.com,*.example.com\&"
1.258 djm 2086: .Pp
2087: Note that a negated match will never produce a positive result by itself.
2088: For example, attempting to match
2089: .Qq host3
2090: against the following pattern-list will fail:
2091: .Pp
2092: .Dl from=\&"!host1,!host2\&"
2093: .Pp
2094: The solution here is to include a term that will yield a positive match,
2095: such as a wildcard:
2096: .Pp
2097: .Dl from=\&"!host1,!host2,*\&"
1.239 jmc 2098: .Sh TOKENS
2099: Arguments to some keywords can make use of tokens,
2100: which are expanded at runtime:
2101: .Pp
2102: .Bl -tag -width XXXX -offset indent -compact
2103: .It %%
2104: A literal
2105: .Sq % .
2106: .It \&%C
1.257 jmc 2107: Hash of %l%h%p%r.
1.239 jmc 2108: .It %d
2109: Local user's home directory.
1.339 djm 2110: .It %f
2111: The fingerprint of the server's host key.
2112: .It %H
2113: The
2114: .Pa known_hosts
2115: hostname or address that is being searched for.
1.239 jmc 2116: .It %h
2117: The remote hostname.
1.340 jmc 2118: .It \%%I
1.339 djm 2119: A string describing the reason for a
2120: .Cm KnownHostsCommand
1.340 jmc 2121: execution: either
2122: .Cm ADDRESS
1.339 djm 2123: when looking up a host by address (only when
2124: .Cm CheckHostIP
2125: is enabled),
1.340 jmc 2126: .Cm HOSTNAME
2127: when searching by hostname, or
2128: .Cm ORDER
1.339 djm 2129: when preparing the host key algorithm preference list to use for the
2130: destination host.
1.239 jmc 2131: .It %i
2132: The local user ID.
1.339 djm 2133: .It %K
2134: The base64 encoded host key.
1.330 dtucker 2135: .It %k
1.350 jsg 2136: The host key alias if specified, otherwise the original remote hostname given
1.330 dtucker 2137: on the command line.
1.239 jmc 2138: .It %L
2139: The local hostname.
2140: .It %l
2141: The local hostname, including the domain name.
2142: .It %n
2143: The original remote hostname, as given on the command line.
2144: .It %p
2145: The remote port.
2146: .It %r
2147: The remote username.
1.261 djm 2148: .It \&%T
2149: The local
2150: .Xr tun 4
2151: or
2152: .Xr tap 4
2153: network interface assigned if
1.262 jmc 2154: tunnel forwarding was requested, or
2155: .Qq NONE
1.261 djm 2156: otherwise.
1.339 djm 2157: .It %t
2158: The type of the server host key, e.g.
1.360 jmc 2159: .Cm ssh-ed25519 .
1.239 jmc 2160: .It %u
2161: The local username.
2162: .El
2163: .Pp
1.323 dtucker 2164: .Cm CertificateFile ,
2165: .Cm ControlPath ,
2166: .Cm IdentityAgent ,
2167: .Cm IdentityFile ,
1.339 djm 2168: .Cm KnownHostsCommand ,
1.325 jmc 2169: .Cm LocalForward ,
1.324 dtucker 2170: .Cm Match exec ,
2171: .Cm RemoteCommand ,
1.329 dtucker 2172: .Cm RemoteForward ,
1.380 dtucker 2173: .Cm RevokedHostKeys ,
1.323 dtucker 2174: and
1.331 jmc 2175: .Cm UserKnownHostsFile
1.349 dtucker 2176: accept the tokens %%, %C, %d, %h, %i, %k, %L, %l, %n, %p, %r, and %u.
1.239 jmc 2177: .Pp
1.339 djm 2178: .Cm KnownHostsCommand
2179: additionally accepts the tokens %f, %H, %I, %K and %t.
2180: .Pp
1.295 jmc 2181: .Cm Hostname
1.239 jmc 2182: accepts the tokens %% and %h.
2183: .Pp
2184: .Cm LocalCommand
1.323 dtucker 2185: accepts all tokens.
1.239 jmc 2186: .Pp
2187: .Cm ProxyCommand
1.372 dtucker 2188: and
2189: .Cm ProxyJump
2190: accept the tokens %%, %h, %n, %p, and %r.
1.326 dtucker 2191: .Sh ENVIRONMENT VARIABLES
2192: Arguments to some keywords can be expanded at runtime from environment
2193: variables on the client by enclosing them in
2194: .Ic ${} ,
2195: for example
2196: .Ic ${HOME}/.ssh
2197: would refer to the user's .ssh directory.
2198: If a specified environment variable does not exist then an error will be
2199: returned and the setting for that keyword will be ignored.
2200: .Pp
2201: The keywords
2202: .Cm CertificateFile ,
2203: .Cm ControlPath ,
1.329 dtucker 2204: .Cm IdentityAgent ,
1.352 jmc 2205: .Cm IdentityFile ,
1.339 djm 2206: .Cm KnownHostsCommand ,
1.326 dtucker 2207: and
1.329 dtucker 2208: .Cm UserKnownHostsFile
1.326 dtucker 2209: support environment variables.
2210: The keywords
2211: .Cm LocalForward
2212: and
2213: .Cm RemoteForward
2214: support environment variables only for Unix domain socket paths.
1.1 stevesk 2215: .Sh FILES
2216: .Bl -tag -width Ds
1.50 djm 2217: .It Pa ~/.ssh/config
1.1 stevesk 2218: This is the per-user configuration file.
2219: The format of this file is described above.
1.84 jmc 2220: This file is used by the SSH client.
1.30 djm 2221: Because of the potential for abuse, this file must have strict permissions:
1.290 jmc 2222: read/write for the user, and not writable by others.
1.1 stevesk 2223: .It Pa /etc/ssh/ssh_config
2224: Systemwide configuration file.
2225: This file provides defaults for those
2226: values that are not specified in the user's configuration file, and
2227: for those users who do not have a configuration file.
2228: This file must be world-readable.
2229: .El
1.13 jmc 2230: .Sh SEE ALSO
2231: .Xr ssh 1
1.1 stevesk 2232: .Sh AUTHORS
1.240 jmc 2233: .An -nosplit
1.1 stevesk 2234: OpenSSH is a derivative of the original and free
1.240 jmc 2235: ssh 1.2.12 release by
2236: .An Tatu Ylonen .
2237: .An Aaron Campbell , Bob Beck , Markus Friedl ,
2238: .An Niels Provos , Theo de Raadt
2239: and
2240: .An Dug Song
1.1 stevesk 2241: removed many bugs, re-added newer features and
2242: created OpenSSH.
1.240 jmc 2243: .An Markus Friedl
2244: contributed the support for SSH protocol versions 1.5 and 2.0.