1SSH_CONFIG(5) BSD File Formats Manual SSH_CONFIG(5)
2
4 ssh_config — OpenSSH client configuration file
5
7 ssh(1) obtains configuration data from the following sources in the fol‐
8 lowing order:
9
10 1. command-line options
11 2. user's configuration file (~/.ssh/config)
12 3. system-wide configuration file (/etc/ssh/ssh_config)
13
14 For each parameter, the first obtained value will be used. The configu‐
15 ration files contain sections separated by Host specifications, and that
16 section is only applied for hosts that match one of the patterns given in
17 the specification. The matched host name is usually the one given on the
18 command line (see the CanonicalizeHostname option for exceptions).
19
20 Since the first obtained value for each parameter is used, more host-spe‐
21 cific declarations should be given near the beginning of the file, and
22 general defaults at the end.
23
24 The file contains keyword-argument pairs, one per line. Lines starting
25 with ‘#’ and empty lines are interpreted as comments. Arguments may op‐
26 tionally be enclosed in double quotes (") in order to represent arguments
27 containing spaces. Configuration options may be separated by whitespace
28 or optional whitespace and exactly one ‘=’; the latter format is useful
29 to avoid the need to quote whitespace when specifying configuration op‐
30 tions using the ssh, scp, and sftp -o option.
31
32 The possible keywords and their meanings are as follows (note that key‐
33 words are case-insensitive and arguments are case-sensitive):
34
35 Host Restricts the following declarations (up to the next Host or
36 Match keyword) to be only for those hosts that match one of the
37 patterns given after the keyword. If more than one pattern is
38 provided, they should be separated by whitespace. A single ‘*’
39 as a pattern can be used to provide global defaults for all
40 hosts. The host is usually the hostname argument given on the
41 command line (see the CanonicalizeHostname keyword for excep‐
42 tions).
43
44 A pattern entry may be negated by prefixing it with an exclama‐
45 tion mark (‘!’). If a negated entry is matched, then the Host
46 entry is ignored, regardless of whether any other patterns on the
47 line match. Negated matches are therefore useful to provide ex‐
48 ceptions for wildcard matches.
49
50 See PATTERNS for more information on patterns.
51
52 Match Restricts the following declarations (up to the next Host or
53 Match keyword) to be used only when the conditions following the
54 Match keyword are satisfied. Match conditions are specified us‐
55 ing one or more criteria or the single token all which always
56 matches. The available criteria keywords are: canonical, final,
57 exec, host, originalhost, user, and localuser. The all criteria
58 must appear alone or immediately after canonical or final. Other
59 criteria may be combined arbitrarily. All criteria but all,
60 canonical, and final require an argument. Criteria may be
61 negated by prepending an exclamation mark (‘!’).
62
63 The canonical keyword matches only when the configuration file is
64 being re-parsed after hostname canonicalization (see the
65 CanonicalizeHostname option). This may be useful to specify con‐
66 ditions that work with canonical host names only.
67
68 The final keyword requests that the configuration be re-parsed
69 (regardless of whether CanonicalizeHostname is enabled), and
70 matches only during this final pass. If CanonicalizeHostname is
71 enabled, then canonical and final match during the same pass.
72
73 The exec keyword executes the specified command under the user's
74 shell. If the command returns a zero exit status then the condi‐
75 tion is considered true. Commands containing whitespace charac‐
76 ters must be quoted. Arguments to exec accept the tokens de‐
77 scribed in the TOKENS section.
78
79 The other keywords' criteria must be single entries or comma-sep‐
80 arated lists and may use the wildcard and negation operators de‐
81 scribed in the PATTERNS section. The criteria for the host key‐
82 word are matched against the target hostname, after any substitu‐
83 tion by the Hostname or CanonicalizeHostname options. The
84 originalhost keyword matches against the hostname as it was spec‐
85 ified on the command-line. The user keyword matches against the
86 target username on the remote host. The localuser keyword
87 matches against the name of the local user running ssh(1) (this
88 keyword may be useful in system-wide ssh_config files).
89
90 AddKeysToAgent
91 Specifies whether keys should be automatically added to a running
92 ssh-agent(1). If this option is set to yes and a key is loaded
93 from a file, the key and its passphrase are added to the agent
94 with the default lifetime, as if by ssh-add(1). If this option
95 is set to ask, ssh(1) will require confirmation using the
96 SSH_ASKPASS program before adding a key (see ssh-add(1) for de‐
97 tails). If this option is set to confirm, each use of the key
98 must be confirmed, as if the -c option was specified to
99 ssh-add(1). If this option is set to no, no keys are added to
100 the agent. Alternately, this option may be specified as a time
101 interval using the format described in the TIME FORMATS section
102 of sshd_config(5) to specify the key's lifetime in ssh-agent(1),
103 after which it will automatically be removed. The argument must
104 be no (the default), yes, confirm (optionally followed by a time
105 interval), ask or a time interval.
106
107 AddressFamily
108 Specifies which address family to use when connecting. Valid ar‐
109 guments are any (the default), inet (use IPv4 only), or inet6
110 (use IPv6 only).
111
112 BatchMode
113 If set to yes, user interaction such as password prompts and host
114 key confirmation requests will be disabled. This option is use‐
115 ful in scripts and other batch jobs where no user is present to
116 interact with ssh(1). The argument must be yes or no (the de‐
117 fault).
118
119 BindAddress
120 Use the specified address on the local machine as the source ad‐
121 dress of the connection. Only useful on systems with more than
122 one address.
123
124 BindInterface
125 Use the address of the specified interface on the local machine
126 as the source address of the connection.
127
128 CanonicalDomains
129 When CanonicalizeHostname is enabled, this option specifies the
130 list of domain suffixes in which to search for the specified des‐
131 tination host.
132
133 CanonicalizeFallbackLocal
134 Specifies whether to fail with an error when hostname canonical‐
135 ization fails. The default, yes, will attempt to look up the un‐
136 qualified hostname using the system resolver's search rules. A
137 value of no will cause ssh(1) to fail instantly if
138 CanonicalizeHostname is enabled and the target hostname cannot be
139 found in any of the domains specified by CanonicalDomains.
140
141 CanonicalizeHostname
142 Controls whether explicit hostname canonicalization is performed.
143 The default, no, is not to perform any name rewriting and let the
144 system resolver handle all hostname lookups. If set to yes then,
145 for connections that do not use a ProxyCommand or ProxyJump,
146 ssh(1) will attempt to canonicalize the hostname specified on the
147 command line using the CanonicalDomains suffixes and
148 CanonicalizePermittedCNAMEs rules. If CanonicalizeHostname is
149 set to always, then canonicalization is applied to proxied con‐
150 nections too.
151
152 If this option is enabled, then the configuration files are pro‐
153 cessed again using the new target name to pick up any new config‐
154 uration in matching Host and Match stanzas. A value of none dis‐
155 ables the use of a ProxyJump host.
156
157 CanonicalizeMaxDots
158 Specifies the maximum number of dot characters in a hostname be‐
159 fore canonicalization is disabled. The default, 1, allows a sin‐
160 gle dot (i.e. hostname.subdomain).
161
162 CanonicalizePermittedCNAMEs
163 Specifies rules to determine whether CNAMEs should be followed
164 when canonicalizing hostnames. The rules consist of one or more
165 arguments of source_domain_list:target_domain_list, where
166 source_domain_list is a pattern-list of domains that may follow
167 CNAMEs in canonicalization, and target_domain_list is a pattern-
168 list of domains that they may resolve to.
169
170 For example, "*.a.example.com:*.b.example.com,*.c.example.com"
171 will allow hostnames matching "*.a.example.com" to be canonical‐
172 ized to names in the "*.b.example.com" or "*.c.example.com" do‐
173 mains.
174
175 A single argument of "none" causes no CNAMEs to be considered for
176 canonicalization. This is the default behaviour.
177
178 CASignatureAlgorithms
179 The default is handled system-wide by crypto-policies(7). Infor‐
180 mation about defaults, how to modify the defaults and how to cus‐
181 tomize existing policies with sub-policies are present in manual
182 page update-crypto-policies(8).
183
184 Specifies which algorithms are allowed for signing of certifi‐
185 cates by certificate authorities (CAs). If the specified list
186 begins with a ‘+’ character, then the specified algorithms will
187 be appended to the default set instead of replacing them. If the
188 specified list begins with a ‘-’ character, then the specified
189 algorithms (including wildcards) will be removed from the default
190 set instead of replacing them.
191
192 ssh(1) will not accept host certificates signed using algorithms
193 other than those specified.
194
195 CertificateFile
196 Specifies a file from which the user's certificate is read. A
197 corresponding private key must be provided separately in order to
198 use this certificate either from an IdentityFile directive or -i
199 flag to ssh(1), via ssh-agent(1), or via a PKCS11Provider or
200 SecurityKeyProvider.
201
202 Arguments to CertificateFile may use the tilde syntax to refer to
203 a user's home directory, the tokens described in the TOKENS sec‐
204 tion and environment variables as described in the ENVIRONMENT
205 VARIABLES section.
206
207 It is possible to have multiple certificate files specified in
208 configuration files; these certificates will be tried in se‐
209 quence. Multiple CertificateFile directives will add to the list
210 of certificates used for authentication.
211
212 CheckHostIP
213 If set to yes [22mssh(1) will additionally check the host IP address
214 in the known_hosts file. This allows it to detect if a host key
215 changed due to DNS spoofing and will add addresses of destination
216 hosts to ~/.ssh/known_hosts in the process, regardless of the
217 setting of StrictHostKeyChecking. If the option is set to no
218 (the default), the check will not be executed.
219
220 Ciphers
221 The default is handled system-wide by crypto-policies(7). Infor‐
222 mation about defaults, how to modify the defaults and how to cus‐
223 tomize existing policies with sub-policies are present in manual
224 page update-crypto-policies(8).
225
226 Specifies the ciphers allowed and their order of preference.
227 Multiple ciphers must be comma-separated. If the specified list
228 begins with a ‘+’ character, then the specified ciphers will be
229 appended to the built-in openssh default set instead of replacing
230 them. If the specified list begins with a ‘-’ character, then
231 the specified ciphers (including wildcards) will be removed from
232 the built-in openssh default set instead of replacing them. If
233 the specified list begins with a ‘^’ character, then the speci‐
234 fied ciphers will be placed at the head of the built-in openssh
235 default set.
236
237 The supported ciphers are:
238
239 3des-cbc
240 aes128-cbc
241 aes192-cbc
242 aes256-cbc
243 aes128-ctr
244 aes192-ctr
245 aes256-ctr
246 aes128-gcm@openssh.com
247 aes256-gcm@openssh.com
248 chacha20-poly1305@openssh.com
249
250 The list of available ciphers may also be obtained using "ssh -Q
251 cipher".
252
253 ClearAllForwardings
254 Specifies that all local, remote, and dynamic port forwardings
255 specified in the configuration files or on the command line be
256 cleared. This option is primarily useful when used from the
257 ssh(1) command line to clear port forwardings set in configura‐
258 tion files, and is automatically set by scp(1) and sftp(1). The
259 argument must be yes or no (the default).
260
261 Compression
262 Specifies whether to use compression. The argument must be yes
263 or no (the default).
264
265 ConnectionAttempts
266 Specifies the number of tries (one per second) to make before ex‐
267 iting. The argument must be an integer. This may be useful in
268 scripts if the connection sometimes fails. The default is 1.
269
270 ConnectTimeout
271 Specifies the timeout (in seconds) used when connecting to the
272 SSH server, instead of using the default system TCP timeout.
273 This timeout is applied both to establishing the connection and
274 to performing the initial SSH protocol handshake and key ex‐
275 change.
276
277 ControlMaster
278 Enables the sharing of multiple sessions over a single network
279 connection. When set to yes, ssh(1) will listen for connections
280 on a control socket specified using the ControlPath argument.
281 Additional sessions can connect to this socket using the same
282 ControlPath with ControlMaster set to no (the default). These
283 sessions will try to reuse the master instance's network connec‐
284 tion rather than initiating new ones, but will fall back to con‐
285 necting normally if the control socket does not exist, or is not
286 listening.
287
288 Setting this to ask will cause ssh(1) to listen for control con‐
289 nections, but require confirmation using ssh-askpass(1). If the
290 ControlPath cannot be opened, ssh(1) will continue without con‐
291 necting to a master instance.
292
293 X11 and ssh-agent(1) forwarding is supported over these multi‐
294 plexed connections, however the display and agent forwarded will
295 be the one belonging to the master connection i.e. it is not pos‐
296 sible to forward multiple displays or agents.
297
298 Two additional options allow for opportunistic multiplexing: try
299 to use a master connection but fall back to creating a new one if
300 one does not already exist. These options are: auto and autoask.
301 The latter requires confirmation like the ask option.
302
303 ControlPath
304 Specify the path to the control socket used for connection shar‐
305 ing as described in the ControlMaster section above or the string
306 none to disable connection sharing. Arguments to ControlPath may
307 use the tilde syntax to refer to a user's home directory, the to‐
308 kens described in the TOKENS section and environment variables as
309 described in the ENVIRONMENT VARIABLES section. It is recom‐
310 mended that any ControlPath used for opportunistic connection
311 sharing include at least %h, %p, and %r (or alternatively %C) and
312 be placed in a directory that is not writable by other users.
313 This ensures that shared connections are uniquely identified.
314
315 ControlPersist
316 When used in conjunction with ControlMaster, specifies that the
317 master connection should remain open in the background (waiting
318 for future client connections) after the initial client connec‐
319 tion has been closed. If set to no (the default), then the mas‐
320 ter connection will not be placed into the background, and will
321 close as soon as the initial client connection is closed. If set
322 to yes or 0, then the master connection will remain in the back‐
323 ground indefinitely (until killed or closed via a mechanism such
324 as the "ssh -O exit"). If set to a time in seconds, or a time in
325 any of the formats documented in sshd_config(5), then the back‐
326 grounded master connection will automatically terminate after it
327 has remained idle (with no client connections) for the specified
328 time.
329
330 DynamicForward
331 Specifies that a TCP port on the local machine be forwarded over
332 the secure channel, and the application protocol is then used to
333 determine where to connect to from the remote machine.
334
335 The argument must be [bind_address:]port. IPv6 addresses can be
336 specified by enclosing addresses in square brackets. By default,
337 the local port is bound in accordance with the GatewayPorts set‐
338 ting. However, an explicit bind_address may be used to bind the
339 connection to a specific address. The bind_address of localhost
340 indicates that the listening port be bound for local use only,
341 while an empty address or ‘*’ indicates that the port should be
342 available from all interfaces.
343
344 Currently the SOCKS4 and SOCKS5 protocols are supported, and
345 ssh(1) will act as a SOCKS server. Multiple forwardings may be
346 specified, and additional forwardings can be given on the command
347 line. Only the superuser can forward privileged ports.
348
349 EnableSSHKeysign
350 Setting this option to yes in the global client configuration
351 file /etc/ssh/ssh_config enables the use of the helper program
352 ssh-keysign(8) during HostbasedAuthentication. The argument must
353 be yes or no (the default). This option should be placed in the
354 non-hostspecific section. See ssh-keysign(8) for more informa‐
355 tion.
356
357 EscapeChar
358 Sets the escape character (default: ‘~’). The escape character
359 can also be set on the command line. The argument should be a
360 single character, ‘^’ followed by a letter, or none to disable
361 the escape character entirely (making the connection transparent
362 for binary data).
363
364 ExitOnForwardFailure
365 Specifies whether ssh(1) should terminate the connection if it
366 cannot set up all requested dynamic, tunnel, local, and remote
367 port forwardings, (e.g. if either end is unable to bind and lis‐
368 ten on a specified port). Note that ExitOnForwardFailure does
369 not apply to connections made over port forwardings and will not,
370 for example, cause ssh(1) to exit if TCP connections to the ulti‐
371 mate forwarding destination fail. The argument must be yes or no
372 (the default).
373
374 FingerprintHash
375 Specifies the hash algorithm used when displaying key finger‐
376 prints. Valid options are: md5 and sha256 (the default).
377
378 ForkAfterAuthentication
379 Requests ssh to go to background just before command execution.
380 This is useful if ssh is going to ask for passwords or
381 passphrases, but the user wants it in the background. This im‐
382 plies the StdinNull configuration option being set to “yes”. The
383 recommended way to start X11 programs at a remote site is with
384 something like ssh -f host xterm, which is the same as ssh host
385 xterm if the ForkAfterAuthentication configuration option is set
386 to “yes”.
387
388 If the ExitOnForwardFailure configuration option is set to “yes”,
389 then a client started with the ForkAfterAuthentication configura‐
390 tion option being set to “yes” will wait for all remote port for‐
391 wards to be successfully established before placing itself in the
392 background. The argument to this keyword must be yes (same as
393 the -f option) or no (the default).
394
395 ForwardAgent
396 Specifies whether the connection to the authentication agent (if
397 any) will be forwarded to the remote machine. The argument may
398 be yes, no (the default), an explicit path to an agent socket or
399 the name of an environment variable (beginning with ‘$’) in which
400 to find the path.
401
402 Agent forwarding should be enabled with caution. Users with the
403 ability to bypass file permissions on the remote host (for the
404 agent's Unix-domain socket) can access the local agent through
405 the forwarded connection. An attacker cannot obtain key material
406 from the agent, however they can perform operations on the keys
407 that enable them to authenticate using the identities loaded into
408 the agent.
409
410 ForwardX11
411 Specifies whether X11 connections will be automatically redi‐
412 rected over the secure channel and DISPLAY set. The argument
413 must be yes or no (the default).
414
415 X11 forwarding should be enabled with caution. Users with the
416 ability to bypass file permissions on the remote host (for the
417 user's X11 authorization database) can access the local X11 dis‐
418 play through the forwarded connection. An attacker may then be
419 able to perform activities such as keystroke monitoring if the
420 ForwardX11Trusted option is also enabled.
421
422 ForwardX11Timeout
423 Specify a timeout for untrusted X11 forwarding using the format
424 described in the TIME FORMATS section of sshd_config(5). X11
425 connections received by ssh(1) after this time will be refused.
426 Setting ForwardX11Timeout to zero will disable the timeout and
427 permit X11 forwarding for the life of the connection. The de‐
428 fault is to disable untrusted X11 forwarding after twenty minutes
429 has elapsed.
430
431 ForwardX11Trusted
432 If this option is set to yes, remote X11 clients will have full
433 access to the original X11 display.
434
435 If this option is set to no (the default), remote X11 clients
436 will be considered untrusted and prevented from stealing or tam‐
437 pering with data belonging to trusted X11 clients. Furthermore,
438 the xauth(1) token used for the session will be set to expire af‐
439 ter 20 minutes. Remote clients will be refused access after this
440 time.
441
442 See the X11 SECURITY extension specification for full details on
443 the restrictions imposed on untrusted clients.
444
445 GatewayPorts
446 Specifies whether remote hosts are allowed to connect to local
447 forwarded ports. By default, ssh(1) binds local port forwardings
448 to the loopback address. This prevents other remote hosts from
449 connecting to forwarded ports. GatewayPorts can be used to spec‐
450 ify that ssh should bind local port forwardings to the wildcard
451 address, thus allowing remote hosts to connect to forwarded
452 ports. The argument must be yes or no (the default).
453
454 GlobalKnownHostsFile
455 Specifies one or more files to use for the global host key data‐
456 base, separated by whitespace. The default is
457 /etc/ssh/ssh_known_hosts, /etc/ssh/ssh_known_hosts2.
458
459 GSSAPIAuthentication
460 Specifies whether user authentication based on GSSAPI is allowed.
461 The default is no.
462
463 GSSAPIClientIdentity
464 If set, specifies the GSSAPI client identity that ssh should use
465 when connecting to the server. The default is unset, which means
466 that the default identity will be used.
467
468 GSSAPIDelegateCredentials
469 Forward (delegate) credentials to the server. The default is no.
470
471 GSSAPIKeyExchange
472 Specifies whether key exchange based on GSSAPI may be used. When
473 using GSSAPI key exchange the server need not have a host key.
474 The default is “no”.
475
476 GSSAPIRenewalForcesRekey
477 If set to “yes” then renewal of the client's GSSAPI credentials
478 will force the rekeying of the ssh connection. With a compatible
479 server, this will delegate the renewed credentials to a session
480 on the server.
481
482 Checks are made to ensure that credentials are only propagated
483 when the new credentials match the old ones on the originating
484 client and where the receiving server still has the old set in
485 its cache.
486
487 The default is “no”.
488
489 For this to work GSSAPIKeyExchange needs to be enabled in the
490 server and also used by the client.
491
492 GSSAPIServerIdentity
493 If set, specifies the GSSAPI server identity that ssh should ex‐
494 pect when connecting to the server. The default is unset, which
495 means that the expected GSSAPI server identity will be determined
496 from the target hostname.
497
498 GSSAPITrustDns
499 Set to “yes” to indicate that the DNS is trusted to securely
500 canonicalize the name of the host being connected to. If “no”,
501 the hostname entered on the command line will be passed untouched
502 to the GSSAPI library. The default is “no”.
503
504 GSSAPIKexAlgorithms
505 The default is handled system-wide by crypto-policies(7). Infor‐
506 mation about defaults, how to modify the defaults and how to cus‐
507 tomize existing policies with sub-policies are present in manual
508 page update-crypto-policies(8).
509
510 The list of key exchange algorithms that are offered for GSSAPI
511 key exchange. Possible values are
512
513 gss-gex-sha1-,
514 gss-group1-sha1-,
515 gss-group14-sha1-,
516 gss-group14-sha256-,
517 gss-group16-sha512-,
518 gss-nistp256-sha256-,
519 gss-curve25519-sha256-
520
521 This option only applies to connections using GSSAPI.
522
523 HashKnownHosts
524 Indicates that ssh(1) should hash host names and addresses when
525 they are added to ~/.ssh/known_hosts. These hashed names may be
526 used normally by ssh(1) and sshd(8), but they do not visually re‐
527 veal identifying information if the file's contents are dis‐
528 closed. The default is no. Note that existing names and ad‐
529 dresses in known hosts files will not be converted automatically,
530 but may be manually hashed using ssh-keygen(1).
531
532 HostbasedAcceptedAlgorithms
533 Specifies the signature algorithms that will be used for host‐
534 based authentication as a comma-separated list of patterns. Al‐
535 ternately if the specified list begins with a ‘+’ character, then
536 the specified signature algorithms will be appended to the de‐
537 fault set instead of replacing them. If the specified list be‐
538 gins with a ‘-’ character, then the specified signature algo‐
539 rithms (including wildcards) will be removed from the default set
540 instead of replacing them. If the specified list begins with a
541 ‘^’ character, then the specified signature algorithms will be
542 placed at the head of the default set. The default for this op‐
543 tion is:
544
545 ssh-ed25519-cert-v01@openssh.com,
546 ecdsa-sha2-nistp256-cert-v01@openssh.com,
547 ecdsa-sha2-nistp384-cert-v01@openssh.com,
548 ecdsa-sha2-nistp521-cert-v01@openssh.com,
549 sk-ssh-ed25519-cert-v01@openssh.com,
550 sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
551 rsa-sha2-512-cert-v01@openssh.com,
552 rsa-sha2-256-cert-v01@openssh.com,
553 ssh-ed25519,
554 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
555 sk-ssh-ed25519@openssh.com,
556 sk-ecdsa-sha2-nistp256@openssh.com,
557 rsa-sha2-512,rsa-sha2-256
558
559 The -Q option of ssh(1) may be used to list supported signature
560 algorithms. This was formerly named HostbasedKeyTypes.
561
562 HostbasedAuthentication
563 Specifies whether to try rhosts based authentication with public
564 key authentication. The argument must be yes or no (the de‐
565 fault).
566
567 HostKeyAlgorithms
568 Specifies the host key signature algorithms that the client wants
569 to use in order of preference. Alternately if the specified list
570 begins with a ‘+’ character, then the specified signature algo‐
571 rithms will be appended to the default set instead of replacing
572 them. If the specified list begins with a ‘-’ character, then
573 the specified signature algorithms (including wildcards) will be
574 removed from the default set instead of replacing them. If the
575 specified list begins with a ‘^’ character, then the specified
576 signature algorithms will be placed at the head of the default
577 set. The default for this option is:
578
579 ssh-ed25519-cert-v01@openssh.com,
580 ecdsa-sha2-nistp256-cert-v01@openssh.com,
581 ecdsa-sha2-nistp384-cert-v01@openssh.com,
582 ecdsa-sha2-nistp521-cert-v01@openssh.com,
583 sk-ssh-ed25519-cert-v01@openssh.com,
584 sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
585 rsa-sha2-512-cert-v01@openssh.com,
586 rsa-sha2-256-cert-v01@openssh.com,
587 ssh-ed25519,
588 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
589 sk-ecdsa-sha2-nistp256@openssh.com,
590 sk-ssh-ed25519@openssh.com,
591 rsa-sha2-512,rsa-sha2-256
592
593 If hostkeys are known for the destination host then this default
594 is modified to prefer their algorithms.
595
596 The list of available signature algorithms may also be obtained
597 using "ssh -Q HostKeyAlgorithms".
598
599 HostKeyAlias
600 Specifies an alias that should be used instead of the real host
601 name when looking up or saving the host key in the host key data‐
602 base files and when validating host certificates. This option is
603 useful for tunneling SSH connections or for multiple servers run‐
604 ning on a single host.
605
606 Hostname
607 Specifies the real host name to log into. This can be used to
608 specify nicknames or abbreviations for hosts. Arguments to
609 Hostname accept the tokens described in the TOKENS section. Nu‐
610 meric IP addresses are also permitted (both on the command line
611 and in Hostname specifications). The default is the name given
612 on the command line.
613
614 IdentitiesOnly
615 Specifies that ssh(1) should only use the configured authentica‐
616 tion identity and certificate files (either the default files, or
617 those explicitly configured in the ssh_config files or passed on
618 the ssh(1) command-line), even if ssh-agent(1) or a
619 PKCS11Provider or SecurityKeyProvider offers more identities.
620 The argument to this keyword must be yes or no (the default).
621 This option is intended for situations where ssh-agent offers
622 many different identities.
623
624 IdentityAgent
625 Specifies the UNIX-domain socket used to communicate with the au‐
626 thentication agent.
627
628 This option overrides the SSH_AUTH_SOCK environment variable and
629 can be used to select a specific agent. Setting the socket name
630 to none disables the use of an authentication agent. If the
631 string "SSH_AUTH_SOCK" is specified, the location of the socket
632 will be read from the SSH_AUTH_SOCK environment variable. Other‐
633 wise if the specified value begins with a ‘$’ character, then it
634 will be treated as an environment variable containing the loca‐
635 tion of the socket.
636
637 Arguments to IdentityAgent may use the tilde syntax to refer to a
638 user's home directory, the tokens described in the TOKENS section
639 and environment variables as described in the ENVIRONMENT
640 VARIABLES section.
641
642 IdentityFile
643 Specifies a file from which the user's DSA, ECDSA, authenticator-
644 hosted ECDSA, Ed25519, authenticator-hosted Ed25519 or RSA au‐
645 thentication identity is read. The default is ~/.ssh/id_dsa,
646 ~/.ssh/id_ecdsa, ~/.ssh/id_ecdsa_sk, ~/.ssh/id_ed25519,
647 ~/.ssh/id_ed25519_sk and ~/.ssh/id_rsa. Additionally, any iden‐
648 tities represented by the authentication agent will be used for
649 authentication unless IdentitiesOnly is set. If no certificates
650 have been explicitly specified by CertificateFile, ssh(1) will
651 try to load certificate information from the filename obtained by
652 appending -cert.pub to the path of a specified IdentityFile.
653
654 Arguments to IdentityFile may use the tilde syntax to refer to a
655 user's home directory or the tokens described in the TOKENS sec‐
656 tion.
657
658 It is possible to have multiple identity files specified in con‐
659 figuration files; all these identities will be tried in sequence.
660 Multiple IdentityFile directives will add to the list of identi‐
661 ties tried (this behaviour differs from that of other configura‐
662 tion directives).
663
664 IdentityFile may be used in conjunction with IdentitiesOnly to
665 select which identities in an agent are offered during authenti‐
666 cation. IdentityFile may also be used in conjunction with
667 CertificateFile in order to provide any certificate also needed
668 for authentication with the identity.
669
670 The authentication identity can be also specified in a form of
671 PKCS#11 URI starting with a string pkcs11:. There is supported a
672 subset of the PKCS#11 URI as defined in RFC 7512 (implemented
673 path arguments id, manufacturer, object, token and query argu‐
674 ments module-path and pin-value ). The URI can not be in quotes.
675
676 IgnoreUnknown
677 Specifies a pattern-list of unknown options to be ignored if they
678 are encountered in configuration parsing. This may be used to
679 suppress errors if ssh_config contains options that are unrecog‐
680 nised by ssh(1). It is recommended that IgnoreUnknown be listed
681 early in the configuration file as it will not be applied to un‐
682 known options that appear before it.
683
684 Include
685 Include the specified configuration file(s). Multiple pathnames
686 may be specified and each pathname may contain glob(7) wildcards
687 and, for user configurations, shell-like ‘~’ references to user
688 home directories. Wildcards will be expanded and processed in
689 lexical order. Files without absolute paths are assumed to be in
690 ~/.ssh if included in a user configuration file or /etc/ssh if
691 included from the system configuration file. Include directive
692 may appear inside a Match or Host block to perform conditional
693 inclusion.
694
695 IPQoS Specifies the IPv4 type-of-service or DSCP class for connections.
696 Accepted values are af11, af12, af13, af21, af22, af23, af31,
697 af32, af33, af41, af42, af43, cs0, cs1, cs2, cs3, cs4, cs5, cs6,
698 cs7, ef, le, lowdelay, throughput, reliability, a numeric value,
699 or none to use the operating system default. This option may
700 take one or two arguments, separated by whitespace. If one argu‐
701 ment is specified, it is used as the packet class uncondition‐
702 ally. If two values are specified, the first is automatically
703 selected for interactive sessions and the second for non-interac‐
704 tive sessions. The default is af21 (Low-Latency Data) for inter‐
705 active sessions and cs1 (Lower Effort) for non-interactive ses‐
706 sions.
707
708 KbdInteractiveAuthentication
709 Specifies whether to use keyboard-interactive authentication.
710 The argument to this keyword must be yes (the default) or no.
711 ChallengeResponseAuthentication is a deprecated alias for this.
712
713 KbdInteractiveDevices
714 Specifies the list of methods to use in keyboard-interactive au‐
715 thentication. Multiple method names must be comma-separated.
716 The default is to use the server specified list. The methods
717 available vary depending on what the server supports. For an
718 OpenSSH server, it may be zero or more of: bsdauth and pam.
719
720 KexAlgorithms
721 The default is handled system-wide by crypto-policies(7). Infor‐
722 mation about defaults, how to modify the defaults and how to cus‐
723 tomize existing policies with sub-policies are present in manual
724 page update-crypto-policies(8).
725
726 Specifies the available KEX (Key Exchange) algorithms. Multiple
727 algorithms must be comma-separated. If the specified list begins
728 with a ‘+’ character, then the specified methods will be appended
729 to the built-in openssh default set instead of replacing them.
730 If the specified list begins with a ‘-’ character, then the spec‐
731 ified algorithms (including wildcards) will be removed from the
732 built-in openssh default set instead of replacing them. If the
733 specified list begins with a ‘^’ character, then the specified
734 algorithms will be placed at the head of the built-in openssh de‐
735 fault set.
736
737 The list of available key exchange algorithms may also be ob‐
738 tained using "ssh -Q kex".
739
740 KnownHostsCommand
741 Specifies a command to use to obtain a list of host keys, in ad‐
742 dition to those listed in UserKnownHostsFile and
743 GlobalKnownHostsFile. This command is executed after the files
744 have been read. It may write host key lines to standard output
745 in identical format to the usual files (described in the
746 VERIFYING HOST KEYS section in ssh(1)). Arguments to
747 KnownHostsCommand accept the tokens described in the TOKENS sec‐
748 tion. The command may be invoked multiple times per connection:
749 once when preparing the preference list of host key algorithms to
750 use, again to obtain the host key for the requested host name
751 and, if CheckHostIP is enabled, one more time to obtain the host
752 key matching the server's address. If the command exits abnor‐
753 mally or returns a non-zero exit status then the connection is
754 terminated.
755
756 LocalCommand
757 Specifies a command to execute on the local machine after suc‐
758 cessfully connecting to the server. The command string extends
759 to the end of the line, and is executed with the user's shell.
760 Arguments to LocalCommand accept the tokens described in the
761 TOKENS section.
762
763 The command is run synchronously and does not have access to the
764 session of the ssh(1) that spawned it. It should not be used for
765 interactive commands.
766
767 This directive is ignored unless PermitLocalCommand has been en‐
768 abled.
769
770 LocalForward
771 Specifies that a TCP port on the local machine be forwarded over
772 the secure channel to the specified host and port from the remote
773 machine. The first argument specifies the listener and may be
774 [bind_address:]port or a Unix domain socket path. The second ar‐
775 gument is the destination and may be host:hostport or a Unix do‐
776 main socket path if the remote host supports it.
777
778 IPv6 addresses can be specified by enclosing addresses in square
779 brackets. Multiple forwardings may be specified, and additional
780 forwardings can be given on the command line. Only the superuser
781 can forward privileged ports. By default, the local port is
782 bound in accordance with the GatewayPorts setting. However, an
783 explicit bind_address may be used to bind the connection to a
784 specific address. The bind_address of localhost indicates that
785 the listening port be bound for local use only, while an empty
786 address or ‘*’ indicates that the port should be available from
787 all interfaces. Unix domain socket paths may use the tokens de‐
788 scribed in the TOKENS section and environment variables as de‐
789 scribed in the ENVIRONMENT VARIABLES section.
790
791 LogLevel
792 Gives the verbosity level that is used when logging messages from
793 ssh(1). The possible values are: QUIET, FATAL, ERROR, INFO, VER‐
794 BOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. The default is INFO.
795 DEBUG and DEBUG1 are equivalent. DEBUG2 and DEBUG3 each specify
796 higher levels of verbose output.
797
798 LogVerbose
799 Specify one or more overrides to LogLevel. An override consists
800 of a pattern lists that matches the source file, function and
801 line number to force detailed logging for. For example, an over‐
802 ride pattern of:
803
804 kex.c:*:1000,*:kex_exchange_identification():*,packet.c:*
805
806 would enable detailed logging for line 1000 of kex.c, everything
807 in the kex_exchange_identification() function, and all code in
808 the packet.c file. This option is intended for debugging and no
809 overrides are enabled by default.
810
811 MACs The default is handled system-wide by crypto-policies(7). Infor‐
812 mation about defaults, how to modify the defaults and how to cus‐
813 tomize existing policies with sub-policies are present in manual
814 page update-crypto-policies(8).
815
816 Specifies the MAC (message authentication code) algorithms in or‐
817 der of preference. The MAC algorithm is used for data integrity
818 protection. Multiple algorithms must be comma-separated. If the
819 specified list begins with a ‘+’ character, then the specified
820 algorithms will be appended to the built-in openssh default set
821 instead of replacing them. If the specified list begins with a
822 ‘-’ character, then the specified algorithms (including wild‐
823 cards) will be removed from the built-in openssh default set in‐
824 stead of replacing them. If the specified list begins with a ‘^’
825 character, then the specified algorithms will be placed at the
826 head of the built-in openssh default set.
827
828 The algorithms that contain "-etm" calculate the MAC after en‐
829 cryption (encrypt-then-mac). These are considered safer and
830 their use recommended.
831
832 The list of available MAC algorithms may also be obtained using
833 "ssh -Q mac".
834
835 NoHostAuthenticationForLocalhost
836 Disable host authentication for localhost (loopback addresses).
837 The argument to this keyword must be yes or no (the default).
838
839 NumberOfPasswordPrompts
840 Specifies the number of password prompts before giving up. The
841 argument to this keyword must be an integer. The default is 3.
842
843 PasswordAuthentication
844 Specifies whether to use password authentication. The argument
845 to this keyword must be yes (the default) or no.
846
847 PermitLocalCommand
848 Allow local command execution via the LocalCommand option or us‐
849 ing the !command escape sequence in ssh(1). The argument must be
850 yes or no (the default).
851
852 PermitRemoteOpen
853 Specifies the destinations to which remote TCP port forwarding is
854 permitted when RemoteForward is used as a SOCKS proxy. The for‐
855 warding specification must be one of the following forms:
856
857 PermitRemoteOpen host:port
858 PermitRemoteOpen IPv4_addr:port
859 PermitRemoteOpen [IPv6_addr]:port
860
861 Multiple forwards may be specified by separating them with white‐
862 space. An argument of any can be used to remove all restrictions
863 and permit any forwarding requests. An argument of none can be
864 used to prohibit all forwarding requests. The wildcard ‘*’ can
865 be used for host or port to allow all hosts or ports respec‐
866 tively. Otherwise, no pattern matching or address lookups are
867 performed on supplied names.
868
869 PKCS11Provider
870 Specifies which PKCS#11 provider to use or none to indicate that
871 no provider should be used (the default). The argument to this
872 keyword is a path to the PKCS#11 shared library ssh(1) should use
873 to communicate with a PKCS#11 token providing keys for user au‐
874 thentication.
875
876 Port Specifies the port number to connect on the remote host. The de‐
877 fault is 22.
878
879 PreferredAuthentications
880 Specifies the order in which the client should try authentication
881 methods. This allows a client to prefer one method (e.g.
882 keyboard-interactive) over another method (e.g. password). The
883 default is:
884
885 gssapi-with-mic,hostbased,publickey,
886 keyboard-interactive,password
887
888 ProxyCommand
889 Specifies the command to use to connect to the server. The com‐
890 mand string extends to the end of the line, and is executed using
891 the user's shell ‘exec’ directive to avoid a lingering shell
892 process.
893
894 Arguments to ProxyCommand accept the tokens described in the
895 TOKENS section. The command can be basically anything, and
896 should read from its standard input and write to its standard
897 output. It should eventually connect an sshd(8) server running
898 on some machine, or execute sshd -i somewhere. Host key manage‐
899 ment will be done using the Hostname of the host being connected
900 (defaulting to the name typed by the user). Setting the command
901 to none disables this option entirely. Note that CheckHostIP is
902 not available for connects with a proxy command.
903
904 This directive is useful in conjunction with nc(1) and its proxy
905 support. For example, the following directive would connect via
906 an HTTP proxy at 192.0.2.0:
907
908 ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p
909
910 ProxyJump
911 Specifies one or more jump proxies as either [user@]host[:port]
912 or an ssh URI. Multiple proxies may be separated by comma char‐
913 acters and will be visited sequentially. Setting this option
914 will cause ssh(1) to connect to the target host by first making a
915 ssh(1) connection to the specified ProxyJump host and then estab‐
916 lishing a TCP forwarding to the ultimate target from there. Set‐
917 ting the host to none disables this option entirely.
918
919 Note that this option will compete with the ProxyCommand option -
920 whichever is specified first will prevent later instances of the
921 other from taking effect.
922
923 Note also that the configuration for the destination host (either
924 supplied via the command-line or the configuration file) is not
925 generally applied to jump hosts. ~/.ssh/config should be used if
926 specific configuration is required for jump hosts.
927
928 ProxyUseFdpass
929 Specifies that ProxyCommand will pass a connected file descriptor
930 back to ssh(1) instead of continuing to execute and pass data.
931 The default is no.
932
933 PubkeyAcceptedAlgorithms
934 The default is handled system-wide by crypto-policies(7). Infor‐
935 mation about defaults, how to modify the defaults and how to cus‐
936 tomize existing policies with sub-policies are present in manual
937 page update-crypto-policies(8).
938
939 Specifies the signature algorithms that will be used for public
940 key authentication as a comma-separated list of patterns. If the
941 specified list begins with a ‘+’ character, then the algorithms
942 after it will be appended to the built-in openssh default instead
943 of replacing it. If the specified list begins with a ‘-’ charac‐
944 ter, then the specified algorithms (including wildcards) will be
945 removed from the built-in openssh default set instead of replac‐
946 ing them. If the specified list begins with a ‘^’ character,
947 then the specified algorithms will be placed at the head of the
948 built-in openssh default set.
949
950 The list of available signature algorithms may also be obtained
951 using "ssh -Q PubkeyAcceptedAlgorithms".
952
953 PubkeyAuthentication
954 Specifies whether to try public key authentication. The argument
955 to this keyword must be yes (the default) or no.
956
957 RekeyLimit
958 Specifies the maximum amount of data that may be transmitted be‐
959 fore the session key is renegotiated, optionally followed by a
960 maximum amount of time that may pass before the session key is
961 renegotiated. The first argument is specified in bytes and may
962 have a suffix of ‘K’, ‘M’, or ‘G’ to indicate Kilobytes,
963 Megabytes, or Gigabytes, respectively. The default is between
964 ‘1G’ and ‘4G’, depending on the cipher. The optional second
965 value is specified in seconds and may use any of the units docu‐
966 mented in the TIME FORMATS section of sshd_config(5). The de‐
967 fault value for RekeyLimit is default none, which means that
968 rekeying is performed after the cipher's default amount of data
969 has been sent or received and no time based rekeying is done.
970
971 RemoteCommand
972 Specifies a command to execute on the remote machine after suc‐
973 cessfully connecting to the server. The command string extends
974 to the end of the line, and is executed with the user's shell.
975 Arguments to RemoteCommand accept the tokens described in the
976 TOKENS section.
977
978 RemoteForward
979 Specifies that a TCP port on the remote machine be forwarded over
980 the secure channel. The remote port may either be forwarded to a
981 specified host and port from the local machine, or may act as a
982 SOCKS 4/5 proxy that allows a remote client to connect to arbi‐
983 trary destinations from the local machine. The first argument is
984 the listening specification and may be [bind_address:]port or, if
985 the remote host supports it, a Unix domain socket path. If for‐
986 warding to a specific destination then the second argument must
987 be host:hostport or a Unix domain socket path, otherwise if no
988 destination argument is specified then the remote forwarding will
989 be established as a SOCKS proxy. When acting as a SOCKS proxy
990 the destination of the connection can be restricted by
991 PermitRemoteOpen.
992
993 IPv6 addresses can be specified by enclosing addresses in square
994 brackets. Multiple forwardings may be specified, and additional
995 forwardings can be given on the command line. Privileged ports
996 can be forwarded only when logging in as root on the remote ma‐
997 chine. Unix domain socket paths may use the tokens described in
998 the TOKENS section and environment variables as described in the
999 ENVIRONMENT VARIABLES section.
1000
1001 If the port argument is 0, the listen port will be dynamically
1002 allocated on the server and reported to the client at run time.
1003
1004 If the bind_address is not specified, the default is to only bind
1005 to loopback addresses. If the bind_address is ‘*’ or an empty
1006 string, then the forwarding is requested to listen on all inter‐
1007 faces. Specifying a remote bind_address will only succeed if the
1008 server's GatewayPorts option is enabled (see sshd_config(5)).
1009
1010 RequestTTY
1011 Specifies whether to request a pseudo-tty for the session. The
1012 argument may be one of: no (never request a TTY), yes (always re‐
1013 quest a TTY when standard input is a TTY), force (always request
1014 a TTY) or auto (request a TTY when opening a login session).
1015 This option mirrors the -t and -T flags for ssh(1).
1016
1017 RequiredRSASize
1018 Specifies the minimum RSA key size (in bits) that ssh(1) will ac‐
1019 cept. User authentication keys smaller than this limit will be
1020 ignored. Servers that present host keys smaller than this limit
1021 will cause the connection to be terminated. The default is 1024
1022 bits. Note that this limit may only be raised from the default.
1023
1024 RevokedHostKeys
1025 Specifies revoked host public keys. Keys listed in this file
1026 will be refused for host authentication. Note that if this file
1027 does not exist or is not readable, then host authentication will
1028 be refused for all hosts. Keys may be specified as a text file,
1029 listing one public key per line, or as an OpenSSH Key Revocation
1030 List (KRL) as generated by ssh-keygen(1). For more information
1031 on KRLs, see the KEY REVOCATION LISTS section in ssh-keygen(1).
1032
1033 SecurityKeyProvider
1034 Specifies a path to a library that will be used when loading any
1035 FIDO authenticator-hosted keys, overriding the default of using
1036 the built-in USB HID support.
1037
1038 If the specified value begins with a ‘$’ character, then it will
1039 be treated as an environment variable containing the path to the
1040 library.
1041
1042 SendEnv
1043 Specifies what variables from the local environ(7) should be sent
1044 to the server. The server must also support it, and the server
1045 must be configured to accept these environment variables. Note
1046 that the TERM environment variable is always sent whenever a
1047 pseudo-terminal is requested as it is required by the protocol.
1048 Refer to AcceptEnv in sshd_config(5) for how to configure the
1049 server. Variables are specified by name, which may contain wild‐
1050 card characters. Multiple environment variables may be separated
1051 by whitespace or spread across multiple SendEnv directives.
1052
1053 See PATTERNS for more information on patterns.
1054
1055 It is possible to clear previously set SendEnv variable names by
1056 prefixing patterns with -. The default is not to send any envi‐
1057 ronment variables.
1058
1059 ServerAliveCountMax
1060 Sets the number of server alive messages (see below) which may be
1061 sent without ssh(1) receiving any messages back from the server.
1062 If this threshold is reached while server alive messages are be‐
1063 ing sent, ssh will disconnect from the server, terminating the
1064 session. It is important to note that the use of server alive
1065 messages is very different from TCPKeepAlive (below). The server
1066 alive messages are sent through the encrypted channel and there‐
1067 fore will not be spoofable. The TCP keepalive option enabled by
1068 TCPKeepAlive is spoofable. The server alive mechanism is valu‐
1069 able when the client or server depend on knowing when a connec‐
1070 tion has become unresponsive.
1071
1072 The default value is 3. If, for example, ServerAliveInterval
1073 (see below) is set to 15 and ServerAliveCountMax is left at the
1074 default, if the server becomes unresponsive, ssh will disconnect
1075 after approximately 45 seconds.
1076
1077 ServerAliveInterval
1078 Sets a timeout interval in seconds after which if no data has
1079 been received from the server, ssh(1) will send a message through
1080 the encrypted channel to request a response from the server. The
1081 default is 0, indicating that these messages will not be sent to
1082 the server.
1083
1084 SessionType
1085 May be used to either request invocation of a subsystem on the
1086 remote system, or to prevent the execution of a remote command at
1087 all. The latter is useful for just forwarding ports. The argu‐
1088 ment to this keyword must be none (same as the -N option),
1089 subsystem (same as the -s option) or default (shell or command
1090 execution).
1091
1092 SetEnv Directly specify one or more environment variables and their con‐
1093 tents to be sent to the server. Similarly to SendEnv, with the
1094 exception of the TERM variable, the server must be prepared to
1095 accept the environment variable.
1096
1097 StdinNull
1098 Redirects stdin from /dev/null (actually, prevents reading from
1099 stdin). Either this or the equivalent -n option must be used
1100 when ssh is run in the background. The argument to this keyword
1101 must be yes (same as the -n option) or no (the default).
1102
1103 StreamLocalBindMask
1104 Sets the octal file creation mode mask (umask) used when creating
1105 a Unix-domain socket file for local or remote port forwarding.
1106 This option is only used for port forwarding to a Unix-domain
1107 socket file.
1108
1109 The default value is 0177, which creates a Unix-domain socket
1110 file that is readable and writable only by the owner. Note that
1111 not all operating systems honor the file mode on Unix-domain
1112 socket files.
1113
1114 StreamLocalBindUnlink
1115 Specifies whether to remove an existing Unix-domain socket file
1116 for local or remote port forwarding before creating a new one.
1117 If the socket file already exists and StreamLocalBindUnlink is
1118 not enabled, ssh will be unable to forward the port to the Unix-
1119 domain socket file. This option is only used for port forwarding
1120 to a Unix-domain socket file.
1121
1122 The argument must be yes or no (the default).
1123
1124 StrictHostKeyChecking
1125 If this flag is set to yes, ssh(1) will never automatically add
1126 host keys to the ~/.ssh/known_hosts file, and refuses to connect
1127 to hosts whose host key has changed. This provides maximum pro‐
1128 tection against man-in-the-middle (MITM) attacks, though it can
1129 be annoying when the /etc/ssh/ssh_known_hosts file is poorly
1130 maintained or when connections to new hosts are frequently made.
1131 This option forces the user to manually add all new hosts.
1132
1133 If this flag is set to accept-new then ssh will automatically add
1134 new host keys to the user's known_hosts file, but will not permit
1135 connections to hosts with changed host keys. If this flag is set
1136 to no or off, ssh will automatically add new host keys to the
1137 user known hosts files and allow connections to hosts with
1138 changed hostkeys to proceed, subject to some restrictions. If
1139 this flag is set to ask (the default), new host keys will be
1140 added to the user known host files only after the user has con‐
1141 firmed that is what they really want to do, and ssh will refuse
1142 to connect to hosts whose host key has changed. The host keys of
1143 known hosts will be verified automatically in all cases.
1144
1145 SyslogFacility
1146 Gives the facility code that is used when logging messages from
1147 ssh(1). The possible values are: DAEMON, USER, AUTH, LOCAL0, LO‐
1148 CAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. The de‐
1149 fault is USER.
1150
1151 TCPKeepAlive
1152 Specifies whether the system should send TCP keepalive messages
1153 to the other side. If they are sent, death of the connection or
1154 crash of one of the machines will be properly noticed. However,
1155 this means that connections will die if the route is down tempo‐
1156 rarily, and some people find it annoying.
1157
1158 The default is yes (to send TCP keepalive messages), and the
1159 client will notice if the network goes down or the remote host
1160 dies. This is important in scripts, and many users want it too.
1161
1162 To disable TCP keepalive messages, the value should be set to no.
1163 See also ServerAliveInterval for protocol-level keepalives.
1164
1165 Tunnel Request tun(4) device forwarding between the client and the
1166 server. The argument must be yes, point-to-point (layer 3),
1167 ethernet (layer 2), or no (the default). Specifying yes requests
1168 the default tunnel mode, which is point-to-point.
1169
1170 TunnelDevice
1171 Specifies the tun(4) devices to open on the client (local_tun)
1172 and the server (remote_tun).
1173
1174 The argument must be local_tun[:remote_tun]. The devices may be
1175 specified by numerical ID or the keyword any, which uses the next
1176 available tunnel device. If remote_tun is not specified, it de‐
1177 faults to any. The default is any:any.
1178
1179 UpdateHostKeys
1180 Specifies whether ssh(1) should accept notifications of addi‐
1181 tional hostkeys from the server sent after authentication has
1182 completed and add them to UserKnownHostsFile. The argument must
1183 be yes, no or ask. This option allows learning alternate
1184 hostkeys for a server and supports graceful key rotation by al‐
1185 lowing a server to send replacement public keys before old ones
1186 are removed.
1187
1188 Additional hostkeys are only accepted if the key used to authen‐
1189 ticate the host was already trusted or explicitly accepted by the
1190 user, the host was authenticated via UserKnownHostsFile (i.e. not
1191 GlobalKnownHostsFile) and the host was authenticated using a
1192 plain key and not a certificate.
1193
1194 UpdateHostKeys is enabled by default if the user has not overrid‐
1195 den the default UserKnownHostsFile setting and has not enabled
1196 VerifyHostKeyDNS, otherwise UpdateHostKeys will be set to no.
1197
1198 If UpdateHostKeys is set to ask, then the user is asked to con‐
1199 firm the modifications to the known_hosts file. Confirmation is
1200 currently incompatible with ControlPersist, and will be disabled
1201 if it is enabled.
1202
1203 Presently, only sshd(8) from OpenSSH 6.8 and greater support the
1204 "hostkeys@openssh.com" protocol extension used to inform the
1205 client of all the server's hostkeys.
1206
1207 User Specifies the user to log in as. This can be useful when a dif‐
1208 ferent user name is used on different machines. This saves the
1209 trouble of having to remember to give the user name on the com‐
1210 mand line.
1211
1212 UserKnownHostsFile
1213 Specifies one or more files to use for the user host key data‐
1214 base, separated by whitespace. Each filename may use tilde nota‐
1215 tion to refer to the user's home directory, the tokens described
1216 in the TOKENS section and environment variables as described in
1217 the ENVIRONMENT VARIABLES section. The default is
1218 ~/.ssh/known_hosts, ~/.ssh/known_hosts2.
1219
1220 VerifyHostKeyDNS
1221 Specifies whether to verify the remote key using DNS and SSHFP
1222 resource records. If this option is set to yes, the client will
1223 implicitly trust keys that match a secure fingerprint from DNS.
1224 Insecure fingerprints will be handled as if this option was set
1225 to ask. If this option is set to ask, information on fingerprint
1226 match will be displayed, but the user will still need to confirm
1227 new host keys according to the StrictHostKeyChecking option. The
1228 default is no.
1229
1230 See also VERIFYING HOST KEYS in ssh(1).
1231
1232 VisualHostKey
1233 If this flag is set to yes, an ASCII art representation of the
1234 remote host key fingerprint is printed in addition to the finger‐
1235 print string at login and for unknown host keys. If this flag is
1236 set to no (the default), no fingerprint strings are printed at
1237 login and only the fingerprint string will be printed for unknown
1238 host keys.
1239
1240 XAuthLocation
1241 Specifies the full pathname of the xauth(1) program. The default
1242 is /usr/bin/xauth.
1243
1245 A pattern consists of zero or more non-whitespace characters, ‘*’ (a
1246 wildcard that matches zero or more characters), or ‘?’ (a wildcard that
1247 matches exactly one character). For example, to specify a set of decla‐
1248 rations for any host in the ".co.uk" set of domains, the following pat‐
1249 tern could be used:
1250
1251 Host *.co.uk
1252
1253 The following pattern would match any host in the 192.168.0.[0-9] network
1254 range:
1255
1256 Host 192.168.0.?
1257
1258 A pattern-list is a comma-separated list of patterns. Patterns within
1259 pattern-lists may be negated by preceding them with an exclamation mark
1260 (‘!’). For example, to allow a key to be used from anywhere within an
1261 organization except from the "dialup" pool, the following entry (in au‐
1262 thorized_keys) could be used:
1263
1264 from="!*.dialup.example.com,*.example.com"
1265
1266 Note that a negated match will never produce a positive result by itself.
1267 For example, attempting to match "host3" against the following pattern-
1268 list will fail:
1269
1270 from="!host1,!host2"
1271
1272 The solution here is to include a term that will yield a positive match,
1273 such as a wildcard:
1274
1275 from="!host1,!host2,*"
1276
1278 Arguments to some keywords can make use of tokens, which are expanded at
1279 runtime:
1280
1281 %% A literal ‘%’.
1282 %C Hash of %l%h%p%r.
1283 %d Local user's home directory.
1284 %f The fingerprint of the server's host key.
1285 %H The known_hosts hostname or address that is being searched
1286 for.
1287 %h The remote hostname.
1288 %I A string describing the reason for a KnownHostsCommand execu‐
1289 tion: either ADDRESS when looking up a host by address (only
1290 when CheckHostIP is enabled), HOSTNAME when searching by
1291 hostname, or ORDER when preparing the host key algorithm
1292 preference list to use for the destination host.
1293 %i The local user ID.
1294 %K The base64 encoded host key.
1295 %k The host key alias if specified, otherwise the original re‐
1296 mote hostname given on the command line.
1297 %L The local hostname.
1298 %l The local hostname, including the domain name.
1299 %n The original remote hostname, as given on the command line.
1300 %p The remote port.
1301 %r The remote username.
1302 %T The local tun(4) or tap(4) network interface assigned if tun‐
1303 nel forwarding was requested, or "NONE" otherwise.
1304 %t The type of the server host key, e.g. ssh-ed25519.
1305 %u The local username.
1306
1307 CertificateFile, ControlPath, IdentityAgent, IdentityFile,
1308 KnownHostsCommand, LocalForward, Match exec, RemoteCommand,
1309 RemoteForward, and UserKnownHostsFile accept the tokens %%, %C, %d, %h,
1310 %i, %k, %L, %l, %n, %p, %r, and %u.
1311
1312 KnownHostsCommand additionally accepts the tokens %f, %H, %I, %K and %t.
1313
1314 Hostname accepts the tokens %% and %h.
1315
1316 LocalCommand accepts all tokens.
1317
1318 ProxyCommand accepts the tokens %%, %h, %n, %p, and %r.
1319
1321 Arguments to some keywords can be expanded at runtime from environment
1322 variables on the client by enclosing them in ${}, for example
1323 ${HOME}/.ssh would refer to the user's .ssh directory. If a specified
1324 environment variable does not exist then an error will be returned and
1325 the setting for that keyword will be ignored.
1326
1327 The keywords CertificateFile, ControlPath, IdentityAgent, IdentityFile,
1328 KnownHostsCommand, and UserKnownHostsFile support environment variables.
1329 The keywords LocalForward and RemoteForward support environment variables
1330 only for Unix domain socket paths.
1331
1333 ~/.ssh/config
1334 This is the per-user configuration file. The format of this file
1335 is described above. This file is used by the SSH client. Be‐
1336 cause of the potential for abuse, this file must have strict per‐
1337 missions: read/write for the user, and not writable by others.
1338
1339 /etc/ssh/ssh_config
1340 Systemwide configuration file. This file provides defaults for
1341 those values that are not specified in the user's configuration
1342 file, and for those users who do not have a configuration file.
1343 This file must be world-readable.
1344
1346 ssh(1)
1347
1349 OpenSSH is a derivative of the original and free ssh 1.2.12 release by
1350 Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo
1351 de Raadt and Dug Song removed many bugs, re-added newer features and cre‐
1352 ated OpenSSH. Markus Friedl contributed the support for SSH protocol
1353 versions 1.5 and 2.0.
1354
1355BSD September 25, 2021 BSD