xref: /freebsd/crypto/openssh/ssh_config.5 (revision 2008043f386721d58158e37e0d7e50df8095942d)
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.387 2023/10/04 04:03:50 djm Exp $
37.Dd $Mdocdate: October 4 2023 $
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 Tag ,
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 CheckHostIP
459If set to
460.Cm yes ,
461.Xr ssh 1
462will additionally check the host IP address in the
463.Pa known_hosts
464file.
465This allows it to detect if a host key changed due to DNS spoofing
466and will add addresses of destination hosts to
467.Pa ~/.ssh/known_hosts
468in the process, regardless of the setting of
469.Cm StrictHostKeyChecking .
470If the option is set to
471.Cm no
472(the default),
473the check will not be executed.
474The default is
475.Cm no .
476.It Cm Ciphers
477Specifies the ciphers allowed and their order of preference.
478Multiple ciphers must be comma-separated.
479If the specified list begins with a
480.Sq +
481character, then the specified ciphers will be appended to the default set
482instead of replacing them.
483If the specified list begins with a
484.Sq -
485character, then the specified ciphers (including wildcards) will be removed
486from the default set instead of replacing them.
487If the specified list begins with a
488.Sq ^
489character, then the specified ciphers will be placed at the head of the
490default set.
491.Pp
492The supported ciphers are:
493.Bd -literal -offset indent
4943des-cbc
495aes128-cbc
496aes192-cbc
497aes256-cbc
498aes128-ctr
499aes192-ctr
500aes256-ctr
501aes128-gcm@openssh.com
502aes256-gcm@openssh.com
503chacha20-poly1305@openssh.com
504.Ed
505.Pp
506The default is:
507.Bd -literal -offset indent
508chacha20-poly1305@openssh.com,
509aes128-ctr,aes192-ctr,aes256-ctr,
510aes128-gcm@openssh.com,aes256-gcm@openssh.com
511.Ed
512.Pp
513The list of available ciphers may also be obtained using
514.Qq ssh -Q cipher .
515.It Cm ClearAllForwardings
516Specifies that all local, remote, and dynamic port forwardings
517specified in the configuration files or on the command line be
518cleared.
519This option is primarily useful when used from the
520.Xr ssh 1
521command line to clear port forwardings set in
522configuration files, and is automatically set by
523.Xr scp 1
524and
525.Xr sftp 1 .
526The argument must be
527.Cm yes
528or
529.Cm no
530(the default).
531.It Cm Compression
532Specifies whether to use compression.
533The argument must be
534.Cm yes
535or
536.Cm no
537(the default).
538.It Cm ConnectionAttempts
539Specifies the number of tries (one per second) to make before exiting.
540The argument must be an integer.
541This may be useful in scripts if the connection sometimes fails.
542The default is 1.
543.It Cm ConnectTimeout
544Specifies the timeout (in seconds) used when connecting to the
545SSH server, instead of using the default system TCP timeout.
546This timeout is applied both to establishing the connection and to performing
547the initial SSH protocol handshake and key exchange.
548.It Cm ControlMaster
549Enables the sharing of multiple sessions over a single network connection.
550When set to
551.Cm yes ,
552.Xr ssh 1
553will listen for connections on a control socket specified using the
554.Cm ControlPath
555argument.
556Additional sessions can connect to this socket using the same
557.Cm ControlPath
558with
559.Cm ControlMaster
560set to
561.Cm no
562(the default).
563These sessions will try to reuse the master instance's network connection
564rather than initiating new ones, but will fall back to connecting normally
565if the control socket does not exist, or is not listening.
566.Pp
567Setting this to
568.Cm ask
569will cause
570.Xr ssh 1
571to listen for control connections, but require confirmation using
572.Xr ssh-askpass 1 .
573If the
574.Cm ControlPath
575cannot be opened,
576.Xr ssh 1
577will continue without connecting to a master instance.
578.Pp
579X11 and
580.Xr ssh-agent 1
581forwarding is supported over these multiplexed connections, however the
582display and agent forwarded will be the one belonging to the master
583connection i.e. it is not possible to forward multiple displays or agents.
584.Pp
585Two additional options allow for opportunistic multiplexing: try to use a
586master connection but fall back to creating a new one if one does not already
587exist.
588These options are:
589.Cm auto
590and
591.Cm autoask .
592The latter requires confirmation like the
593.Cm ask
594option.
595.It Cm ControlPath
596Specify the path to the control socket used for connection sharing as described
597in the
598.Cm ControlMaster
599section above or the string
600.Cm none
601to disable connection sharing.
602Arguments to
603.Cm ControlPath
604may use the tilde syntax to refer to a user's home directory,
605the tokens described in the
606.Sx TOKENS
607section and environment variables as described in the
608.Sx ENVIRONMENT VARIABLES
609section.
610It is recommended that any
611.Cm ControlPath
612used for opportunistic connection sharing include
613at least %h, %p, and %r (or alternatively %C) and be placed in a directory
614that is not writable by other users.
615This ensures that shared connections are uniquely identified.
616.It Cm ControlPersist
617When used in conjunction with
618.Cm ControlMaster ,
619specifies that the master connection should remain open
620in the background (waiting for future client connections)
621after the initial client connection has been closed.
622If set to
623.Cm no
624(the default),
625then the master connection will not be placed into the background,
626and will close as soon as the initial client connection is closed.
627If set to
628.Cm yes
629or 0,
630then the master connection will remain in the background indefinitely
631(until killed or closed via a mechanism such as the
632.Qq ssh -O exit ) .
633If set to a time in seconds, or a time in any of the formats documented in
634.Xr sshd_config 5 ,
635then the backgrounded master connection will automatically terminate
636after it has remained idle (with no client connections) for the
637specified time.
638.It Cm DynamicForward
639Specifies that a TCP port on the local machine be forwarded
640over the secure channel, and the application
641protocol is then used to determine where to connect to from the
642remote machine.
643.Pp
644The argument must be
645.Sm off
646.Oo Ar bind_address : Oc Ar port .
647.Sm on
648IPv6 addresses can be specified by enclosing addresses in square brackets.
649By default, the local port is bound in accordance with the
650.Cm GatewayPorts
651setting.
652However, an explicit
653.Ar bind_address
654may be used to bind the connection to a specific address.
655The
656.Ar bind_address
657of
658.Cm localhost
659indicates that the listening port be bound for local use only, while an
660empty address or
661.Sq *
662indicates that the port should be available from all interfaces.
663.Pp
664Currently the SOCKS4 and SOCKS5 protocols are supported, and
665.Xr ssh 1
666will act as a SOCKS server.
667Multiple forwardings may be specified, and
668additional forwardings can be given on the command line.
669Only the superuser can forward privileged ports.
670.It Cm EnableEscapeCommandline
671Enables the command line option in the
672.Cm EscapeChar
673menu for interactive sessions (default
674.Ql ~C ) .
675By default, the command line is disabled.
676.It Cm EnableSSHKeysign
677Setting this option to
678.Cm yes
679in the global client configuration file
680.Pa /etc/ssh/ssh_config
681enables the use of the helper program
682.Xr ssh-keysign 8
683during
684.Cm HostbasedAuthentication .
685The argument must be
686.Cm yes
687or
688.Cm no
689(the default).
690This option should be placed in the non-hostspecific section.
691See
692.Xr ssh-keysign 8
693for more information.
694.It Cm EscapeChar
695Sets the escape character (default:
696.Ql ~ ) .
697The escape character can also
698be set on the command line.
699The argument should be a single character,
700.Ql ^
701followed by a letter, or
702.Cm none
703to disable the escape
704character entirely (making the connection transparent for binary
705data).
706.It Cm ExitOnForwardFailure
707Specifies whether
708.Xr ssh 1
709should terminate the connection if it cannot set up all requested
710dynamic, tunnel, local, and remote port forwardings, (e.g.\&
711if either end is unable to bind and listen on a specified port).
712Note that
713.Cm ExitOnForwardFailure
714does not apply to connections made over port forwardings and will not,
715for example, cause
716.Xr ssh 1
717to exit if TCP connections to the ultimate forwarding destination fail.
718The argument must be
719.Cm yes
720or
721.Cm no
722(the default).
723.It Cm FingerprintHash
724Specifies the hash algorithm used when displaying key fingerprints.
725Valid options are:
726.Cm md5
727and
728.Cm sha256
729(the default).
730.It Cm ForkAfterAuthentication
731Requests
732.Nm ssh
733to go to background just before command execution.
734This is useful if
735.Nm ssh
736is going to ask for passwords or passphrases, but the user
737wants it in the background.
738This implies the
739.Cm StdinNull
740configuration option being set to
741.Dq yes .
742The recommended way to start X11 programs at a remote site is with
743something like
744.Ic ssh -f host xterm ,
745which is the same as
746.Ic ssh host xterm
747if the
748.Cm ForkAfterAuthentication
749configuration option is set to
750.Dq yes .
751.Pp
752If the
753.Cm ExitOnForwardFailure
754configuration option is set to
755.Dq yes ,
756then a client started with the
757.Cm ForkAfterAuthentication
758configuration option being set to
759.Dq yes
760will wait for all remote port forwards to be successfully established
761before placing itself in the background.
762The argument to this keyword must be
763.Cm yes
764(same as the
765.Fl f
766option) or
767.Cm no
768(the default).
769.It Cm ForwardAgent
770Specifies whether the connection to the authentication agent (if any)
771will be forwarded to the remote machine.
772The argument may be
773.Cm yes ,
774.Cm no
775(the default),
776an explicit path to an agent socket or the name of an environment variable
777(beginning with
778.Sq $ )
779in which to find the path.
780.Pp
781Agent forwarding should be enabled with caution.
782Users with the ability to bypass file permissions on the remote host
783(for the agent's Unix-domain socket)
784can access the local agent through the forwarded connection.
785An attacker cannot obtain key material from the agent,
786however they can perform operations on the keys that enable them to
787authenticate using the identities loaded into the agent.
788.It Cm ForwardX11
789Specifies whether X11 connections will be automatically redirected
790over the secure channel and
791.Ev DISPLAY
792set.
793The argument must be
794.Cm yes
795or
796.Cm no
797(the default).
798.Pp
799X11 forwarding should be enabled with caution.
800Users with the ability to bypass file permissions on the remote host
801(for the user's X11 authorization database)
802can access the local X11 display through the forwarded connection.
803An attacker may then be able to perform activities such as keystroke monitoring
804if the
805.Cm ForwardX11Trusted
806option is also enabled.
807.It Cm ForwardX11Timeout
808Specify a timeout for untrusted X11 forwarding
809using the format described in the
810.Sx TIME FORMATS
811section of
812.Xr sshd_config 5 .
813X11 connections received by
814.Xr ssh 1
815after this time will be refused.
816Setting
817.Cm ForwardX11Timeout
818to zero will disable the timeout and permit X11 forwarding for the life
819of the connection.
820The default is to disable untrusted X11 forwarding after twenty minutes has
821elapsed.
822.It Cm ForwardX11Trusted
823If this option is set to
824.Cm yes ,
825remote X11 clients will have full access to the original X11 display.
826.Pp
827If this option is set to
828.Cm no
829(the default),
830remote X11 clients will be considered untrusted and prevented
831from stealing or tampering with data belonging to trusted X11
832clients.
833Furthermore, the
834.Xr xauth 1
835token used for the session will be set to expire after 20 minutes.
836Remote clients will be refused access after this time.
837.Pp
838See the X11 SECURITY extension specification for full details on
839the restrictions imposed on untrusted clients.
840.It Cm GatewayPorts
841Specifies whether remote hosts are allowed to connect to local
842forwarded ports.
843By default,
844.Xr ssh 1
845binds local port forwardings to the loopback address.
846This prevents other remote hosts from connecting to forwarded ports.
847.Cm GatewayPorts
848can be used to specify that ssh
849should bind local port forwardings to the wildcard address,
850thus allowing remote hosts to connect to forwarded ports.
851The argument must be
852.Cm yes
853or
854.Cm no
855(the default).
856.It Cm GlobalKnownHostsFile
857Specifies one or more files to use for the global
858host key database, separated by whitespace.
859The default is
860.Pa /etc/ssh/ssh_known_hosts ,
861.Pa /etc/ssh/ssh_known_hosts2 .
862.It Cm GSSAPIAuthentication
863Specifies whether user authentication based on GSSAPI is allowed.
864The default is
865.Cm no .
866.It Cm GSSAPIDelegateCredentials
867Forward (delegate) credentials to the server.
868The default is
869.Cm no .
870.It Cm HashKnownHosts
871Indicates that
872.Xr ssh 1
873should hash host names and addresses when they are added to
874.Pa ~/.ssh/known_hosts .
875These hashed names may be used normally by
876.Xr ssh 1
877and
878.Xr sshd 8 ,
879but they do not visually reveal identifying information if the
880file's contents are disclosed.
881The default is
882.Cm no .
883Note that existing names and addresses in known hosts files
884will not be converted automatically,
885but may be manually hashed using
886.Xr ssh-keygen 1 .
887.It Cm HostbasedAcceptedAlgorithms
888Specifies the signature algorithms that will be used for hostbased
889authentication as a comma-separated list of patterns.
890Alternately if the specified list begins with a
891.Sq +
892character, then the specified signature algorithms will be appended
893to the default set instead of replacing them.
894If the specified list begins with a
895.Sq -
896character, then the specified signature algorithms (including wildcards)
897will be removed from the default set instead of replacing them.
898If the specified list begins with a
899.Sq ^
900character, then the specified signature algorithms will be placed
901at the head of the default set.
902The default for this option is:
903.Bd -literal -offset 3n
904ssh-ed25519-cert-v01@openssh.com,
905ecdsa-sha2-nistp256-cert-v01@openssh.com,
906ecdsa-sha2-nistp384-cert-v01@openssh.com,
907ecdsa-sha2-nistp521-cert-v01@openssh.com,
908sk-ssh-ed25519-cert-v01@openssh.com,
909sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
910rsa-sha2-512-cert-v01@openssh.com,
911rsa-sha2-256-cert-v01@openssh.com,
912ssh-ed25519,
913ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
914sk-ssh-ed25519@openssh.com,
915sk-ecdsa-sha2-nistp256@openssh.com,
916rsa-sha2-512,rsa-sha2-256
917.Ed
918.Pp
919The
920.Fl Q
921option of
922.Xr ssh 1
923may be used to list supported signature algorithms.
924This was formerly named HostbasedKeyTypes.
925.It Cm HostbasedAuthentication
926Specifies whether to try rhosts based authentication with public key
927authentication.
928The argument must be
929.Cm yes
930or
931.Cm no
932(the default).
933.It Cm HostKeyAlgorithms
934Specifies the host key signature algorithms
935that the client wants to use in order of preference.
936Alternately if the specified list begins with a
937.Sq +
938character, then the specified signature algorithms will be appended to
939the default set instead of replacing them.
940If the specified list begins with a
941.Sq -
942character, then the specified signature algorithms (including wildcards)
943will be removed from the default set instead of replacing them.
944If the specified list begins with a
945.Sq ^
946character, then the specified signature algorithms will be placed
947at the head of the default set.
948The default for this option is:
949.Bd -literal -offset 3n
950ssh-ed25519-cert-v01@openssh.com,
951ecdsa-sha2-nistp256-cert-v01@openssh.com,
952ecdsa-sha2-nistp384-cert-v01@openssh.com,
953ecdsa-sha2-nistp521-cert-v01@openssh.com,
954sk-ssh-ed25519-cert-v01@openssh.com,
955sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
956rsa-sha2-512-cert-v01@openssh.com,
957rsa-sha2-256-cert-v01@openssh.com,
958ssh-ed25519,
959ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
960sk-ecdsa-sha2-nistp256@openssh.com,
961sk-ssh-ed25519@openssh.com,
962rsa-sha2-512,rsa-sha2-256
963.Ed
964.Pp
965If hostkeys are known for the destination host then this default is modified
966to prefer their algorithms.
967.Pp
968The list of available signature algorithms may also be obtained using
969.Qq ssh -Q HostKeyAlgorithms .
970.It Cm HostKeyAlias
971Specifies an alias that should be used instead of the
972real host name when looking up or saving the host key
973in the host key database files and when validating host certificates.
974This option is useful for tunneling SSH connections
975or for multiple servers running on a single host.
976.It Cm Hostname
977Specifies the real host name to log into.
978This can be used to specify nicknames or abbreviations for hosts.
979Arguments to
980.Cm Hostname
981accept the tokens described in the
982.Sx TOKENS
983section.
984Numeric IP addresses are also permitted (both on the command line and in
985.Cm Hostname
986specifications).
987The default is the name given on the command line.
988.It Cm IdentitiesOnly
989Specifies that
990.Xr ssh 1
991should only use the configured authentication identity and certificate files
992(either the default files, or those explicitly configured in the
993.Nm
994files
995or passed on the
996.Xr ssh 1
997command-line),
998even if
999.Xr ssh-agent 1
1000or a
1001.Cm PKCS11Provider
1002or
1003.Cm SecurityKeyProvider
1004offers more identities.
1005The argument to this keyword must be
1006.Cm yes
1007or
1008.Cm no
1009(the default).
1010This option is intended for situations where ssh-agent
1011offers many different identities.
1012.It Cm IdentityAgent
1013Specifies the
1014.Ux Ns -domain
1015socket used to communicate with the authentication agent.
1016.Pp
1017This option overrides the
1018.Ev SSH_AUTH_SOCK
1019environment variable and can be used to select a specific agent.
1020Setting the socket name to
1021.Cm none
1022disables the use of an authentication agent.
1023If the string
1024.Qq SSH_AUTH_SOCK
1025is specified, the location of the socket will be read from the
1026.Ev SSH_AUTH_SOCK
1027environment variable.
1028Otherwise if the specified value begins with a
1029.Sq $
1030character, then it will be treated as an environment variable containing
1031the location of the socket.
1032.Pp
1033Arguments to
1034.Cm IdentityAgent
1035may use the tilde syntax to refer to a user's home directory,
1036the tokens described in the
1037.Sx TOKENS
1038section and environment variables as described in the
1039.Sx ENVIRONMENT VARIABLES
1040section.
1041.It Cm IdentityFile
1042Specifies a file from which the user's DSA, ECDSA, authenticator-hosted ECDSA,
1043Ed25519, authenticator-hosted Ed25519 or RSA authentication identity is read.
1044You can also specify a public key file to use the corresponding
1045private key that is loaded in
1046.Xr ssh-agent 1
1047when the private key file is not present locally.
1048The default is
1049.Pa ~/.ssh/id_rsa ,
1050.Pa ~/.ssh/id_ecdsa ,
1051.Pa ~/.ssh/id_ecdsa_sk ,
1052.Pa ~/.ssh/id_ed25519 ,
1053.Pa ~/.ssh/id_ed25519_sk
1054and
1055.Pa ~/.ssh/id_dsa .
1056Additionally, any identities represented by the authentication agent
1057will be used for authentication unless
1058.Cm IdentitiesOnly
1059is set.
1060If no certificates have been explicitly specified by
1061.Cm CertificateFile ,
1062.Xr ssh 1
1063will try to load certificate information from the filename obtained by
1064appending
1065.Pa -cert.pub
1066to the path of a specified
1067.Cm IdentityFile .
1068.Pp
1069Arguments to
1070.Cm IdentityFile
1071may use the tilde syntax to refer to a user's home directory
1072or the tokens described in the
1073.Sx TOKENS
1074section.
1075.Pp
1076It is possible to have
1077multiple identity files specified in configuration files; all these
1078identities will be tried in sequence.
1079Multiple
1080.Cm IdentityFile
1081directives will add to the list of identities tried (this behaviour
1082differs from that of other configuration directives).
1083.Pp
1084.Cm IdentityFile
1085may be used in conjunction with
1086.Cm IdentitiesOnly
1087to select which identities in an agent are offered during authentication.
1088.Cm IdentityFile
1089may also be used in conjunction with
1090.Cm CertificateFile
1091in order to provide any certificate also needed for authentication with
1092the identity.
1093.It Cm IgnoreUnknown
1094Specifies a pattern-list of unknown options to be ignored if they are
1095encountered in configuration parsing.
1096This may be used to suppress errors if
1097.Nm
1098contains options that are unrecognised by
1099.Xr ssh 1 .
1100It is recommended that
1101.Cm IgnoreUnknown
1102be listed early in the configuration file as it will not be applied
1103to unknown options that appear before it.
1104.It Cm Include
1105Include the specified configuration file(s).
1106Multiple pathnames may be specified and each pathname may contain
1107.Xr glob 7
1108wildcards and, for user configurations, shell-like
1109.Sq ~
1110references to user home directories.
1111Wildcards will be expanded and processed in lexical order.
1112Files without absolute paths are assumed to be in
1113.Pa ~/.ssh
1114if included in a user configuration file or
1115.Pa /etc/ssh
1116if included from the system configuration file.
1117.Cm Include
1118directive may appear inside a
1119.Cm Match
1120or
1121.Cm Host
1122block
1123to perform conditional inclusion.
1124.It Cm IPQoS
1125Specifies the IPv4 type-of-service or DSCP class for connections.
1126Accepted values are
1127.Cm af11 ,
1128.Cm af12 ,
1129.Cm af13 ,
1130.Cm af21 ,
1131.Cm af22 ,
1132.Cm af23 ,
1133.Cm af31 ,
1134.Cm af32 ,
1135.Cm af33 ,
1136.Cm af41 ,
1137.Cm af42 ,
1138.Cm af43 ,
1139.Cm cs0 ,
1140.Cm cs1 ,
1141.Cm cs2 ,
1142.Cm cs3 ,
1143.Cm cs4 ,
1144.Cm cs5 ,
1145.Cm cs6 ,
1146.Cm cs7 ,
1147.Cm ef ,
1148.Cm le ,
1149.Cm lowdelay ,
1150.Cm throughput ,
1151.Cm reliability ,
1152a numeric value, or
1153.Cm none
1154to use the operating system default.
1155This option may take one or two arguments, separated by whitespace.
1156If one argument is specified, it is used as the packet class unconditionally.
1157If two values are specified, the first is automatically selected for
1158interactive sessions and the second for non-interactive sessions.
1159The default is
1160.Cm af21
1161(Low-Latency Data)
1162for interactive sessions and
1163.Cm cs1
1164(Lower Effort)
1165for non-interactive sessions.
1166.It Cm KbdInteractiveAuthentication
1167Specifies whether to use keyboard-interactive authentication.
1168The argument to this keyword must be
1169.Cm yes
1170(the default)
1171or
1172.Cm no .
1173.Cm ChallengeResponseAuthentication
1174is a deprecated alias for this.
1175.It Cm KbdInteractiveDevices
1176Specifies the list of methods to use in keyboard-interactive authentication.
1177Multiple method names must be comma-separated.
1178The default is to use the server specified list.
1179The methods available vary depending on what the server supports.
1180For an OpenSSH server,
1181it may be zero or more of:
1182.Cm bsdauth
1183and
1184.Cm pam .
1185.It Cm KexAlgorithms
1186Specifies the available KEX (Key Exchange) algorithms.
1187Multiple algorithms must be comma-separated.
1188If the specified list begins with a
1189.Sq +
1190character, then the specified algorithms will be appended to the default set
1191instead of replacing them.
1192If the specified list begins with a
1193.Sq -
1194character, then the specified algorithms (including wildcards) will be removed
1195from the default set instead of replacing them.
1196If the specified list begins with a
1197.Sq ^
1198character, then the specified algorithms will be placed at the head of the
1199default set.
1200The default is:
1201.Bd -literal -offset indent
1202sntrup761x25519-sha512@openssh.com,
1203curve25519-sha256,curve25519-sha256@libssh.org,
1204ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
1205diffie-hellman-group-exchange-sha256,
1206diffie-hellman-group16-sha512,
1207diffie-hellman-group18-sha512,
1208diffie-hellman-group14-sha256
1209.Ed
1210.Pp
1211The list of available key exchange algorithms may also be obtained using
1212.Qq ssh -Q kex .
1213.It Cm KnownHostsCommand
1214Specifies a command to use to obtain a list of host keys, in addition to
1215those listed in
1216.Cm UserKnownHostsFile
1217and
1218.Cm GlobalKnownHostsFile .
1219This command is executed after the files have been read.
1220It may write host key lines to standard output in identical format to the
1221usual files (described in the
1222.Sx VERIFYING HOST KEYS
1223section in
1224.Xr ssh 1 ) .
1225Arguments to
1226.Cm KnownHostsCommand
1227accept the tokens described in the
1228.Sx TOKENS
1229section.
1230The command may be invoked multiple times per connection: once when preparing
1231the preference list of host key algorithms to use, again to obtain the
1232host key for the requested host name and, if
1233.Cm CheckHostIP
1234is enabled, one more time to obtain the host key matching the server's
1235address.
1236If the command exits abnormally or returns a non-zero exit status then the
1237connection is terminated.
1238.It Cm LocalCommand
1239Specifies a command to execute on the local machine after successfully
1240connecting to the server.
1241The command string extends to the end of the line, and is executed with
1242the user's shell.
1243Arguments to
1244.Cm LocalCommand
1245accept the tokens described in the
1246.Sx TOKENS
1247section.
1248.Pp
1249The command is run synchronously and does not have access to the
1250session of the
1251.Xr ssh 1
1252that spawned it.
1253It should not be used for interactive commands.
1254.Pp
1255This directive is ignored unless
1256.Cm PermitLocalCommand
1257has been enabled.
1258.It Cm LocalForward
1259Specifies that a TCP port on the local machine be forwarded over
1260the secure channel to the specified host and port from the remote machine.
1261The first argument specifies the listener and may be
1262.Sm off
1263.Oo Ar bind_address : Oc Ar port
1264.Sm on
1265or a Unix domain socket path.
1266The second argument is the destination and may be
1267.Ar host : Ns Ar hostport
1268or a Unix domain socket path if the remote host supports it.
1269.Pp
1270IPv6 addresses can be specified by enclosing addresses in square brackets.
1271Multiple forwardings may be specified, and additional forwardings can be
1272given on the command line.
1273Only the superuser can forward privileged ports.
1274By default, the local port is bound in accordance with the
1275.Cm GatewayPorts
1276setting.
1277However, an explicit
1278.Ar bind_address
1279may be used to bind the connection to a specific address.
1280The
1281.Ar bind_address
1282of
1283.Cm localhost
1284indicates that the listening port be bound for local use only, while an
1285empty address or
1286.Sq *
1287indicates that the port should be available from all interfaces.
1288Unix domain socket paths may use the tokens described in the
1289.Sx TOKENS
1290section and environment variables as described in the
1291.Sx ENVIRONMENT VARIABLES
1292section.
1293.It Cm LogLevel
1294Gives the verbosity level that is used when logging messages from
1295.Xr ssh 1 .
1296The possible values are:
1297QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
1298The default is INFO.
1299DEBUG and DEBUG1 are equivalent.
1300DEBUG2 and DEBUG3 each specify higher levels of verbose output.
1301.It Cm LogVerbose
1302Specify one or more overrides to LogLevel.
1303An override consists of a pattern lists that matches the source file, function
1304and line number to force detailed logging for.
1305For example, an override pattern of:
1306.Bd -literal -offset indent
1307kex.c:*:1000,*:kex_exchange_identification():*,packet.c:*
1308.Ed
1309.Pp
1310would enable detailed logging for line 1000 of
1311.Pa kex.c ,
1312everything in the
1313.Fn kex_exchange_identification
1314function, and all code in the
1315.Pa packet.c
1316file.
1317This option is intended for debugging and no overrides are enabled by default.
1318.It Cm MACs
1319Specifies the MAC (message authentication code) algorithms
1320in order of preference.
1321The MAC algorithm is used for data integrity protection.
1322Multiple algorithms must be comma-separated.
1323If the specified list begins with a
1324.Sq +
1325character, then the specified algorithms will be appended to the default set
1326instead of replacing them.
1327If the specified list begins with a
1328.Sq -
1329character, then the specified algorithms (including wildcards) will be removed
1330from the default set instead of replacing them.
1331If the specified list begins with a
1332.Sq ^
1333character, then the specified algorithms will be placed at the head of the
1334default set.
1335.Pp
1336The algorithms that contain
1337.Qq -etm
1338calculate the MAC after encryption (encrypt-then-mac).
1339These are considered safer and their use recommended.
1340.Pp
1341The default is:
1342.Bd -literal -offset indent
1343umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1344hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
1345hmac-sha1-etm@openssh.com,
1346umac-64@openssh.com,umac-128@openssh.com,
1347hmac-sha2-256,hmac-sha2-512,hmac-sha1
1348.Ed
1349.Pp
1350The list of available MAC algorithms may also be obtained using
1351.Qq ssh -Q mac .
1352.It Cm NoHostAuthenticationForLocalhost
1353Disable host authentication for localhost (loopback addresses).
1354The argument to this keyword must be
1355.Cm yes
1356or
1357.Cm no
1358(the default).
1359.It Cm NumberOfPasswordPrompts
1360Specifies the number of password prompts before giving up.
1361The argument to this keyword must be an integer.
1362The default is 3.
1363.It Cm ObscureKeystrokeTiming
1364Specifies whether
1365.Xr ssh 1
1366should try to obscure inter-keystroke timings from passive observers of
1367network traffic.
1368If enabled, then for interactive sessions,
1369.Xr ssh 1
1370will send keystrokes at fixed intervals of a few tens of milliseconds
1371and will send fake keystroke packets for some time after typing ceases.
1372The argument to this keyword must be
1373.Cm yes ,
1374.Cm no
1375or an interval specifier of the form
1376.Cm interval:milliseconds
1377(e.g.\&
1378.Cm interval:80
1379for 80 milliseconds).
1380The default is to obscure keystrokes using a 20ms packet interval.
1381Note that smaller intervals will result in higher fake keystroke packet rates.
1382.It Cm PasswordAuthentication
1383Specifies whether to use password authentication.
1384The argument to this keyword must be
1385.Cm yes
1386(the default)
1387or
1388.Cm no .
1389.It Cm PermitLocalCommand
1390Allow local command execution via the
1391.Ic LocalCommand
1392option or using the
1393.Ic !\& Ns Ar command
1394escape sequence in
1395.Xr ssh 1 .
1396The argument must be
1397.Cm yes
1398or
1399.Cm no
1400(the default).
1401.It Cm PermitRemoteOpen
1402Specifies the destinations to which remote TCP port forwarding is permitted when
1403.Cm RemoteForward
1404is used as a SOCKS proxy.
1405The forwarding specification must be one of the following forms:
1406.Pp
1407.Bl -item -offset indent -compact
1408.It
1409.Cm PermitRemoteOpen
1410.Sm off
1411.Ar host : port
1412.Sm on
1413.It
1414.Cm PermitRemoteOpen
1415.Sm off
1416.Ar IPv4_addr : port
1417.Sm on
1418.It
1419.Cm PermitRemoteOpen
1420.Sm off
1421.Ar \&[ IPv6_addr \&] : port
1422.Sm on
1423.El
1424.Pp
1425Multiple forwards may be specified by separating them with whitespace.
1426An argument of
1427.Cm any
1428can be used to remove all restrictions and permit any forwarding requests.
1429An argument of
1430.Cm none
1431can be used to prohibit all forwarding requests.
1432The wildcard
1433.Sq *
1434can be used for host or port to allow all hosts or ports respectively.
1435Otherwise, no pattern matching or address lookups are performed on supplied
1436names.
1437.It Cm PKCS11Provider
1438Specifies which PKCS#11 provider to use or
1439.Cm none
1440to indicate that no provider should be used (the default).
1441The argument to this keyword is a path to the PKCS#11 shared library
1442.Xr ssh 1
1443should use to communicate with a PKCS#11 token providing keys for user
1444authentication.
1445.It Cm Port
1446Specifies the port number to connect on the remote host.
1447The default is 22.
1448.It Cm PreferredAuthentications
1449Specifies the order in which the client should try authentication methods.
1450This allows a client to prefer one method (e.g.\&
1451.Cm keyboard-interactive )
1452over another method (e.g.\&
1453.Cm password ) .
1454The default is:
1455.Bd -literal -offset indent
1456gssapi-with-mic,hostbased,publickey,
1457keyboard-interactive,password
1458.Ed
1459.It Cm ProxyCommand
1460Specifies the command to use to connect to the server.
1461The command
1462string extends to the end of the line, and is executed
1463using the user's shell
1464.Ql exec
1465directive to avoid a lingering shell process.
1466.Pp
1467Arguments to
1468.Cm ProxyCommand
1469accept the tokens described in the
1470.Sx TOKENS
1471section.
1472The command can be basically anything,
1473and should read from its standard input and write to its standard output.
1474It should eventually connect an
1475.Xr sshd 8
1476server running on some machine, or execute
1477.Ic sshd -i
1478somewhere.
1479Host key management will be done using the
1480.Cm Hostname
1481of the host being connected (defaulting to the name typed by the user).
1482Setting the command to
1483.Cm none
1484disables this option entirely.
1485Note that
1486.Cm CheckHostIP
1487is not available for connects with a proxy command.
1488.Pp
1489This directive is useful in conjunction with
1490.Xr nc 1
1491and its proxy support.
1492For example, the following directive would connect via an HTTP proxy at
1493192.0.2.0:
1494.Bd -literal -offset 3n
1495ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p
1496.Ed
1497.It Cm ProxyJump
1498Specifies one or more jump proxies as either
1499.Xo
1500.Sm off
1501.Op Ar user No @
1502.Ar host
1503.Op : Ns Ar port
1504.Sm on
1505or an ssh URI
1506.Xc .
1507Multiple proxies may be separated by comma characters and will be visited
1508sequentially.
1509Setting this option will cause
1510.Xr ssh 1
1511to connect to the target host by first making a
1512.Xr ssh 1
1513connection to the specified
1514.Cm ProxyJump
1515host and then establishing a
1516TCP forwarding to the ultimate target from there.
1517Setting the host to
1518.Cm none
1519disables this option entirely.
1520.Pp
1521Note that this option will compete with the
1522.Cm ProxyCommand
1523option - whichever is specified first will prevent later instances of the
1524other from taking effect.
1525.Pp
1526Note also that the configuration for the destination host (either supplied
1527via the command-line or the configuration file) is not generally applied
1528to jump hosts.
1529.Pa ~/.ssh/config
1530should be used if specific configuration is required for jump hosts.
1531.It Cm ProxyUseFdpass
1532Specifies that
1533.Cm ProxyCommand
1534will pass a connected file descriptor back to
1535.Xr ssh 1
1536instead of continuing to execute and pass data.
1537The default is
1538.Cm no .
1539.It Cm PubkeyAcceptedAlgorithms
1540Specifies the signature algorithms that will be used for public key
1541authentication as a comma-separated list of patterns.
1542If the specified list begins with a
1543.Sq +
1544character, then the algorithms after it will be appended to the default
1545instead of replacing it.
1546If the specified list begins with a
1547.Sq -
1548character, then the specified algorithms (including wildcards) will be removed
1549from the default set instead of replacing them.
1550If the specified list begins with a
1551.Sq ^
1552character, then the specified algorithms will be placed at the head of the
1553default set.
1554The default for this option is:
1555.Bd -literal -offset 3n
1556ssh-ed25519-cert-v01@openssh.com,
1557ecdsa-sha2-nistp256-cert-v01@openssh.com,
1558ecdsa-sha2-nistp384-cert-v01@openssh.com,
1559ecdsa-sha2-nistp521-cert-v01@openssh.com,
1560sk-ssh-ed25519-cert-v01@openssh.com,
1561sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
1562rsa-sha2-512-cert-v01@openssh.com,
1563rsa-sha2-256-cert-v01@openssh.com,
1564ssh-ed25519,
1565ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1566sk-ssh-ed25519@openssh.com,
1567sk-ecdsa-sha2-nistp256@openssh.com,
1568rsa-sha2-512,rsa-sha2-256
1569.Ed
1570.Pp
1571The list of available signature algorithms may also be obtained using
1572.Qq ssh -Q PubkeyAcceptedAlgorithms .
1573.It Cm PubkeyAuthentication
1574Specifies whether to try public key authentication.
1575The argument to this keyword must be
1576.Cm yes
1577(the default),
1578.Cm no ,
1579.Cm unbound
1580or
1581.Cm host-bound .
1582The final two options enable public key authentication while respectively
1583disabling or enabling the OpenSSH host-bound authentication protocol
1584extension required for restricted
1585.Xr ssh-agent 1
1586forwarding.
1587.It Cm RekeyLimit
1588Specifies the maximum amount of data that may be transmitted or received
1589before the session key is renegotiated, optionally followed by a maximum
1590amount of time that may pass before the session key is renegotiated.
1591The first argument is specified in bytes and may have a suffix of
1592.Sq K ,
1593.Sq M ,
1594or
1595.Sq G
1596to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1597The default is between
1598.Sq 1G
1599and
1600.Sq 4G ,
1601depending on the cipher.
1602The optional second value is specified in seconds and may use any of the
1603units documented in the TIME FORMATS section of
1604.Xr sshd_config 5 .
1605The default value for
1606.Cm RekeyLimit
1607is
1608.Cm default none ,
1609which means that rekeying is performed after the cipher's default amount
1610of data has been sent or received and no time based rekeying is done.
1611.It Cm RemoteCommand
1612Specifies a command to execute on the remote machine after successfully
1613connecting to the server.
1614The command string extends to the end of the line, and is executed with
1615the user's shell.
1616Arguments to
1617.Cm RemoteCommand
1618accept the tokens described in the
1619.Sx TOKENS
1620section.
1621.It Cm RemoteForward
1622Specifies that a TCP port on the remote machine be forwarded over
1623the secure channel.
1624The remote port may either be forwarded to a specified host and port
1625from the local machine, or may act as a SOCKS 4/5 proxy that allows a remote
1626client to connect to arbitrary destinations from the local machine.
1627The first argument is the listening specification and may be
1628.Sm off
1629.Oo Ar bind_address : Oc Ar port
1630.Sm on
1631or, if the remote host supports it, a Unix domain socket path.
1632If forwarding to a specific destination then the second argument must be
1633.Ar host : Ns Ar hostport
1634or a Unix domain socket path,
1635otherwise if no destination argument is specified then the remote forwarding
1636will be established as a SOCKS proxy.
1637When acting as a SOCKS proxy, the destination of the connection can be
1638restricted by
1639.Cm PermitRemoteOpen .
1640.Pp
1641IPv6 addresses can be specified by enclosing addresses in square brackets.
1642Multiple forwardings may be specified, and additional
1643forwardings can be given on the command line.
1644Privileged ports can be forwarded only when
1645logging in as root on the remote machine.
1646Unix domain socket paths may use the tokens described in the
1647.Sx TOKENS
1648section and environment variables as described in the
1649.Sx ENVIRONMENT VARIABLES
1650section.
1651.Pp
1652If the
1653.Ar port
1654argument is 0,
1655the listen port will be dynamically allocated on the server and reported
1656to the client at run time.
1657.Pp
1658If the
1659.Ar bind_address
1660is not specified, the default is to only bind to loopback addresses.
1661If the
1662.Ar bind_address
1663is
1664.Ql *
1665or an empty string, then the forwarding is requested to listen on all
1666interfaces.
1667Specifying a remote
1668.Ar bind_address
1669will only succeed if the server's
1670.Cm GatewayPorts
1671option is enabled (see
1672.Xr sshd_config 5 ) .
1673.It Cm RequestTTY
1674Specifies whether to request a pseudo-tty for the session.
1675The argument may be one of:
1676.Cm no
1677(never request a TTY),
1678.Cm yes
1679(always request a TTY when standard input is a TTY),
1680.Cm force
1681(always request a TTY) or
1682.Cm auto
1683(request a TTY when opening a login session).
1684This option mirrors the
1685.Fl t
1686and
1687.Fl T
1688flags for
1689.Xr ssh 1 .
1690.It Cm RequiredRSASize
1691Specifies the minimum RSA key size (in bits) that
1692.Xr ssh 1
1693will accept.
1694User authentication keys smaller than this limit will be ignored.
1695Servers that present host keys smaller than this limit will cause the
1696connection to be terminated.
1697The default is
1698.Cm 1024
1699bits.
1700Note that this limit may only be raised from the default.
1701.It Cm RevokedHostKeys
1702Specifies revoked host public keys.
1703Keys listed in this file will be refused for host authentication.
1704Note that if this file does not exist or is not readable,
1705then host authentication will be refused for all hosts.
1706Keys may be specified as a text file, listing one public key per line, or as
1707an OpenSSH Key Revocation List (KRL) as generated by
1708.Xr ssh-keygen 1 .
1709For more information on KRLs, see the KEY REVOCATION LISTS section in
1710.Xr ssh-keygen 1 .
1711Arguments to
1712.Cm RevokedHostKeys
1713may use the tilde syntax to refer to a user's home directory,
1714the tokens described in the
1715.Sx TOKENS
1716section and environment variables as described in the
1717.Sx ENVIRONMENT VARIABLES
1718section.
1719.It Cm SecurityKeyProvider
1720Specifies a path to a library that will be used when loading any
1721FIDO authenticator-hosted keys, overriding the default of using
1722the built-in USB HID support.
1723.Pp
1724If the specified value begins with a
1725.Sq $
1726character, then it will be treated as an environment variable containing
1727the path to the library.
1728.It Cm SendEnv
1729Specifies what variables from the local
1730.Xr environ 7
1731should be sent to the server.
1732The server must also support it, and the server must be configured to
1733accept these environment variables.
1734Note that the
1735.Ev TERM
1736environment variable is always sent whenever a
1737pseudo-terminal is requested as it is required by the protocol.
1738Refer to
1739.Cm AcceptEnv
1740in
1741.Xr sshd_config 5
1742for how to configure the server.
1743Variables are specified by name, which may contain wildcard characters.
1744Multiple environment variables may be separated by whitespace or spread
1745across multiple
1746.Cm SendEnv
1747directives.
1748.Pp
1749See
1750.Sx PATTERNS
1751for more information on patterns.
1752.Pp
1753It is possible to clear previously set
1754.Cm SendEnv
1755variable names by prefixing patterns with
1756.Pa - .
1757The default is not to send any environment variables.
1758.It Cm ServerAliveCountMax
1759Sets the number of server alive messages (see below) which may be
1760sent without
1761.Xr ssh 1
1762receiving any messages back from the server.
1763If this threshold is reached while server alive messages are being sent,
1764ssh will disconnect from the server, terminating the session.
1765It is important to note that the use of server alive messages is very
1766different from
1767.Cm TCPKeepAlive
1768(below).
1769The server alive messages are sent through the encrypted channel
1770and therefore will not be spoofable.
1771The TCP keepalive option enabled by
1772.Cm TCPKeepAlive
1773is spoofable.
1774The server alive mechanism is valuable when the client or
1775server depend on knowing when a connection has become unresponsive.
1776.Pp
1777The default value is 3.
1778If, for example,
1779.Cm ServerAliveInterval
1780(see below) is set to 15 and
1781.Cm ServerAliveCountMax
1782is left at the default, if the server becomes unresponsive,
1783ssh will disconnect after approximately 45 seconds.
1784.It Cm ServerAliveInterval
1785Sets a timeout interval in seconds after which if no data has been received
1786from the server,
1787.Xr ssh 1
1788will send a message through the encrypted
1789channel to request a response from the server.
1790The default
1791is 0, indicating that these messages will not be sent to the server.
1792.It Cm SessionType
1793May be used to either request invocation of a subsystem on the remote system,
1794or to prevent the execution of a remote command at all.
1795The latter is useful for just forwarding ports.
1796The argument to this keyword must be
1797.Cm none
1798(same as the
1799.Fl N
1800option),
1801.Cm subsystem
1802(same as the
1803.Fl s
1804option) or
1805.Cm default
1806(shell or command execution).
1807.It Cm SetEnv
1808Directly specify one or more environment variables and their contents to
1809be sent to the server.
1810Similarly to
1811.Cm SendEnv ,
1812with the exception of the
1813.Ev TERM
1814variable, the server must be prepared to accept the environment variable.
1815.It Cm StdinNull
1816Redirects stdin from
1817.Pa /dev/null
1818(actually, prevents reading from stdin).
1819Either this or the equivalent
1820.Fl n
1821option must be used when
1822.Nm ssh
1823is run in the background.
1824The argument to this keyword must be
1825.Cm yes
1826(same as the
1827.Fl n
1828option) or
1829.Cm no
1830(the default).
1831.It Cm StreamLocalBindMask
1832Sets the octal file creation mode mask
1833.Pq umask
1834used when creating a Unix-domain socket file for local or remote
1835port forwarding.
1836This option is only used for port forwarding to a Unix-domain socket file.
1837.Pp
1838The default value is 0177, which creates a Unix-domain socket file that is
1839readable and writable only by the owner.
1840Note that not all operating systems honor the file mode on Unix-domain
1841socket files.
1842.It Cm StreamLocalBindUnlink
1843Specifies whether to remove an existing Unix-domain socket file for local
1844or remote port forwarding before creating a new one.
1845If the socket file already exists and
1846.Cm StreamLocalBindUnlink
1847is not enabled,
1848.Nm ssh
1849will be unable to forward the port to the Unix-domain socket file.
1850This option is only used for port forwarding to a Unix-domain socket file.
1851.Pp
1852The argument must be
1853.Cm yes
1854or
1855.Cm no
1856(the default).
1857.It Cm StrictHostKeyChecking
1858If this flag is set to
1859.Cm yes ,
1860.Xr ssh 1
1861will never automatically add host keys to the
1862.Pa ~/.ssh/known_hosts
1863file, and refuses to connect to hosts whose host key has changed.
1864This provides maximum protection against man-in-the-middle (MITM) attacks,
1865though it can be annoying when the
1866.Pa /etc/ssh/ssh_known_hosts
1867file is poorly maintained or when connections to new hosts are
1868frequently made.
1869This option forces the user to manually
1870add all new hosts.
1871.Pp
1872If this flag is set to
1873.Cm accept-new
1874then ssh will automatically add new host keys to the user's
1875.Pa known_hosts
1876file, but will not permit connections to hosts with
1877changed host keys.
1878If this flag is set to
1879.Cm no
1880or
1881.Cm off ,
1882ssh will automatically add new host keys to the user known hosts files
1883and allow connections to hosts with changed hostkeys to proceed,
1884subject to some restrictions.
1885If this flag is set to
1886.Cm ask
1887(the default),
1888new host keys
1889will be added to the user known host files only after the user
1890has confirmed that is what they really want to do, and
1891ssh will refuse to connect to hosts whose host key has changed.
1892The host keys of
1893known hosts will be verified automatically in all cases.
1894.It Cm SyslogFacility
1895Gives the facility code that is used when logging messages from
1896.Xr ssh 1 .
1897The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1898LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1899The default is USER.
1900.It Cm TCPKeepAlive
1901Specifies whether the system should send TCP keepalive messages to the
1902other side.
1903If they are sent, death of the connection or crash of one
1904of the machines will be properly noticed.
1905However, this means that
1906connections will die if the route is down temporarily, and some people
1907find it annoying.
1908.Pp
1909The default is
1910.Cm yes
1911(to send TCP keepalive messages), and the client will notice
1912if the network goes down or the remote host dies.
1913This is important in scripts, and many users want it too.
1914.Pp
1915To disable TCP keepalive messages, the value should be set to
1916.Cm no .
1917See also
1918.Cm ServerAliveInterval
1919for protocol-level keepalives.
1920.It Cm Tag
1921Specify a configuration tag name that may be later used by a
1922.Cm Match
1923directive to select a block of configuration.
1924.It Cm Tunnel
1925Request
1926.Xr tun 4
1927device forwarding between the client and the server.
1928The argument must be
1929.Cm yes ,
1930.Cm point-to-point
1931(layer 3),
1932.Cm ethernet
1933(layer 2),
1934or
1935.Cm no
1936(the default).
1937Specifying
1938.Cm yes
1939requests the default tunnel mode, which is
1940.Cm point-to-point .
1941.It Cm TunnelDevice
1942Specifies the
1943.Xr tun 4
1944devices to open on the client
1945.Pq Ar local_tun
1946and the server
1947.Pq Ar remote_tun .
1948.Pp
1949The argument must be
1950.Sm off
1951.Ar local_tun Op : Ar remote_tun .
1952.Sm on
1953The devices may be specified by numerical ID or the keyword
1954.Cm any ,
1955which uses the next available tunnel device.
1956If
1957.Ar remote_tun
1958is not specified, it defaults to
1959.Cm any .
1960The default is
1961.Cm any:any .
1962.It Cm UpdateHostKeys
1963Specifies whether
1964.Xr ssh 1
1965should accept notifications of additional hostkeys from the server sent
1966after authentication has completed and add them to
1967.Cm UserKnownHostsFile .
1968The argument must be
1969.Cm yes ,
1970.Cm no
1971or
1972.Cm ask .
1973This option allows learning alternate hostkeys for a server
1974and supports graceful key rotation by allowing a server to send replacement
1975public keys before old ones are removed.
1976.Pp
1977Additional hostkeys are only accepted if the key used to authenticate the
1978host was already trusted or explicitly accepted by the user, the host was
1979authenticated via
1980.Cm UserKnownHostsFile
1981(i.e. not
1982.Cm GlobalKnownHostsFile )
1983and the host was authenticated using a plain key and not a certificate.
1984.Pp
1985.Cm UpdateHostKeys
1986is enabled by default if the user has not overridden the default
1987.Cm UserKnownHostsFile
1988setting and has not enabled
1989.Cm VerifyHostKeyDNS ,
1990otherwise
1991.Cm UpdateHostKeys
1992will be set to
1993.Cm no .
1994.Pp
1995If
1996.Cm UpdateHostKeys
1997is set to
1998.Cm ask ,
1999then the user is asked to confirm the modifications to the known_hosts file.
2000Confirmation is currently incompatible with
2001.Cm ControlPersist ,
2002and will be disabled if it is enabled.
2003.Pp
2004Presently, only
2005.Xr sshd 8
2006from OpenSSH 6.8 and greater support the
2007.Qq hostkeys@openssh.com
2008protocol extension used to inform the client of all the server's hostkeys.
2009.It Cm User
2010Specifies the user to log in as.
2011This can be useful when a different user name is used on different machines.
2012This saves the trouble of
2013having to remember to give the user name on the command line.
2014.It Cm UserKnownHostsFile
2015Specifies one or more files to use for the user
2016host key database, separated by whitespace.
2017Each filename may use tilde notation to refer to the user's home directory,
2018the tokens described in the
2019.Sx TOKENS
2020section and environment variables as described in the
2021.Sx ENVIRONMENT VARIABLES
2022section.
2023A value of
2024.Cm none
2025causes
2026.Xr ssh 1
2027to ignore any user-specific known hosts files.
2028The default is
2029.Pa ~/.ssh/known_hosts ,
2030.Pa ~/.ssh/known_hosts2 .
2031.It Cm VerifyHostKeyDNS
2032Specifies whether to verify the remote key using DNS and SSHFP resource
2033records.
2034If this option is set to
2035.Cm yes ,
2036the client will implicitly trust keys that match a secure fingerprint
2037from DNS.
2038Insecure fingerprints will be handled as if this option was set to
2039.Cm ask .
2040If this option is set to
2041.Cm ask ,
2042information on fingerprint match will be displayed, but the user will still
2043need to confirm new host keys according to the
2044.Cm StrictHostKeyChecking
2045option.
2046The default is
2047.Cm no .
2048.Pp
2049See also
2050.Sx VERIFYING HOST KEYS
2051in
2052.Xr ssh 1 .
2053.It Cm VisualHostKey
2054If this flag is set to
2055.Cm yes ,
2056an ASCII art representation of the remote host key fingerprint is
2057printed in addition to the fingerprint string at login and
2058for unknown host keys.
2059If this flag is set to
2060.Cm no
2061(the default),
2062no fingerprint strings are printed at login and
2063only the fingerprint string will be printed for unknown host keys.
2064.It Cm XAuthLocation
2065Specifies the full pathname of the
2066.Xr xauth 1
2067program.
2068The default is
2069.Pa /usr/local/bin/xauth .
2070.El
2071.Sh PATTERNS
2072A
2073.Em pattern
2074consists of zero or more non-whitespace characters,
2075.Sq *
2076(a wildcard that matches zero or more characters),
2077or
2078.Sq ?\&
2079(a wildcard that matches exactly one character).
2080For example, to specify a set of declarations for any host in the
2081.Qq .co.uk
2082set of domains,
2083the following pattern could be used:
2084.Pp
2085.Dl Host *.co.uk
2086.Pp
2087The following pattern
2088would match any host in the 192.168.0.[0-9] network range:
2089.Pp
2090.Dl Host 192.168.0.?
2091.Pp
2092A
2093.Em pattern-list
2094is a comma-separated list of patterns.
2095Patterns within pattern-lists may be negated
2096by preceding them with an exclamation mark
2097.Pq Sq !\& .
2098For example,
2099to allow a key to be used from anywhere within an organization
2100except from the
2101.Qq dialup
2102pool,
2103the following entry (in authorized_keys) could be used:
2104.Pp
2105.Dl from=\&"!*.dialup.example.com,*.example.com\&"
2106.Pp
2107Note that a negated match will never produce a positive result by itself.
2108For example, attempting to match
2109.Qq host3
2110against the following pattern-list will fail:
2111.Pp
2112.Dl from=\&"!host1,!host2\&"
2113.Pp
2114The solution here is to include a term that will yield a positive match,
2115such as a wildcard:
2116.Pp
2117.Dl from=\&"!host1,!host2,*\&"
2118.Sh TOKENS
2119Arguments to some keywords can make use of tokens,
2120which are expanded at runtime:
2121.Pp
2122.Bl -tag -width XXXX -offset indent -compact
2123.It %%
2124A literal
2125.Sq % .
2126.It \&%C
2127Hash of %l%h%p%r.
2128.It %d
2129Local user's home directory.
2130.It %f
2131The fingerprint of the server's host key.
2132.It %H
2133The
2134.Pa known_hosts
2135hostname or address that is being searched for.
2136.It %h
2137The remote hostname.
2138.It \%%I
2139A string describing the reason for a
2140.Cm KnownHostsCommand
2141execution: either
2142.Cm ADDRESS
2143when looking up a host by address (only when
2144.Cm CheckHostIP
2145is enabled),
2146.Cm HOSTNAME
2147when searching by hostname, or
2148.Cm ORDER
2149when preparing the host key algorithm preference list to use for the
2150destination host.
2151.It %i
2152The local user ID.
2153.It %K
2154The base64 encoded host key.
2155.It %k
2156The host key alias if specified, otherwise the original remote hostname given
2157on the command line.
2158.It %L
2159The local hostname.
2160.It %l
2161The local hostname, including the domain name.
2162.It %n
2163The original remote hostname, as given on the command line.
2164.It %p
2165The remote port.
2166.It %r
2167The remote username.
2168.It \&%T
2169The local
2170.Xr tun 4
2171or
2172.Xr tap 4
2173network interface assigned if
2174tunnel forwarding was requested, or
2175.Qq NONE
2176otherwise.
2177.It %t
2178The type of the server host key, e.g.
2179.Cm ssh-ed25519 .
2180.It %u
2181The local username.
2182.El
2183.Pp
2184.Cm CertificateFile ,
2185.Cm ControlPath ,
2186.Cm IdentityAgent ,
2187.Cm IdentityFile ,
2188.Cm KnownHostsCommand ,
2189.Cm LocalForward ,
2190.Cm Match exec ,
2191.Cm RemoteCommand ,
2192.Cm RemoteForward ,
2193.Cm RevokedHostKeys ,
2194and
2195.Cm UserKnownHostsFile
2196accept the tokens %%, %C, %d, %h, %i, %k, %L, %l, %n, %p, %r, and %u.
2197.Pp
2198.Cm KnownHostsCommand
2199additionally accepts the tokens %f, %H, %I, %K and %t.
2200.Pp
2201.Cm Hostname
2202accepts the tokens %% and %h.
2203.Pp
2204.Cm LocalCommand
2205accepts all tokens.
2206.Pp
2207.Cm ProxyCommand
2208and
2209.Cm ProxyJump
2210accept the tokens %%, %h, %n, %p, and %r.
2211.Pp
2212Note that some of these directives build commands for execution via the shell.
2213Because
2214.Xr ssh 1
2215performs no filtering or escaping of characters that have special meaning in
2216shell commands (e.g. quotes), it is the user's reposibility to ensure that
2217the arguments passed to
2218.Xr ssh 1
2219do not contain such characters and that tokens are appropriately quoted
2220when used.
2221.Sh ENVIRONMENT VARIABLES
2222Arguments to some keywords can be expanded at runtime from environment
2223variables on the client by enclosing them in
2224.Ic ${} ,
2225for example
2226.Ic ${HOME}/.ssh
2227would refer to the user's .ssh directory.
2228If a specified environment variable does not exist then an error will be
2229returned and the setting for that keyword will be ignored.
2230.Pp
2231The keywords
2232.Cm CertificateFile ,
2233.Cm ControlPath ,
2234.Cm IdentityAgent ,
2235.Cm IdentityFile ,
2236.Cm KnownHostsCommand ,
2237and
2238.Cm UserKnownHostsFile
2239support environment variables.
2240The keywords
2241.Cm LocalForward
2242and
2243.Cm RemoteForward
2244support environment variables only for Unix domain socket paths.
2245.Sh FILES
2246.Bl -tag -width Ds
2247.It Pa ~/.ssh/config
2248This is the per-user configuration file.
2249The format of this file is described above.
2250This file is used by the SSH client.
2251Because of the potential for abuse, this file must have strict permissions:
2252read/write for the user, and not writable by others.
2253.It Pa /etc/ssh/ssh_config
2254Systemwide configuration file.
2255This file provides defaults for those
2256values that are not specified in the user's configuration file, and
2257for those users who do not have a configuration file.
2258This file must be world-readable.
2259.El
2260.Sh SEE ALSO
2261.Xr ssh 1
2262.Sh AUTHORS
2263.An -nosplit
2264OpenSSH is a derivative of the original and free
2265ssh 1.2.12 release by
2266.An Tatu Ylonen .
2267.An Aaron Campbell , Bob Beck , Markus Friedl ,
2268.An Niels Provos , Theo de Raadt
2269and
2270.An Dug Song
2271removed many bugs, re-added newer features and
2272created OpenSSH.
2273.An Markus Friedl
2274contributed the support for SSH protocol versions 1.5 and 2.0.
2275