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