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