Debian Codegraph @

upstream/fedora-rawhide/man5/ssh_config.5

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