xref: /freebsd/crypto/openssh/ssh_config.5 (revision 315ee00f)
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.383 2023/07/17 05:36:14 jsg Exp $
37.Dd $Mdocdate: July 17 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 PasswordAuthentication
1364Specifies whether to use password authentication.
1365The argument to this keyword must be
1366.Cm yes
1367(the default)
1368or
1369.Cm no .
1370.It Cm PermitLocalCommand
1371Allow local command execution via the
1372.Ic LocalCommand
1373option or using the
1374.Ic !\& Ns Ar command
1375escape sequence in
1376.Xr ssh 1 .
1377The argument must be
1378.Cm yes
1379or
1380.Cm no
1381(the default).
1382.It Cm PermitRemoteOpen
1383Specifies the destinations to which remote TCP port forwarding is permitted when
1384.Cm RemoteForward
1385is used as a SOCKS proxy.
1386The forwarding specification must be one of the following forms:
1387.Pp
1388.Bl -item -offset indent -compact
1389.It
1390.Cm PermitRemoteOpen
1391.Sm off
1392.Ar host : port
1393.Sm on
1394.It
1395.Cm PermitRemoteOpen
1396.Sm off
1397.Ar IPv4_addr : port
1398.Sm on
1399.It
1400.Cm PermitRemoteOpen
1401.Sm off
1402.Ar \&[ IPv6_addr \&] : port
1403.Sm on
1404.El
1405.Pp
1406Multiple forwards may be specified by separating them with whitespace.
1407An argument of
1408.Cm any
1409can be used to remove all restrictions and permit any forwarding requests.
1410An argument of
1411.Cm none
1412can be used to prohibit all forwarding requests.
1413The wildcard
1414.Sq *
1415can be used for host or port to allow all hosts or ports respectively.
1416Otherwise, no pattern matching or address lookups are performed on supplied
1417names.
1418.It Cm PKCS11Provider
1419Specifies which PKCS#11 provider to use or
1420.Cm none
1421to indicate that no provider should be used (the default).
1422The argument to this keyword is a path to the PKCS#11 shared library
1423.Xr ssh 1
1424should use to communicate with a PKCS#11 token providing keys for user
1425authentication.
1426.It Cm Port
1427Specifies the port number to connect on the remote host.
1428The default is 22.
1429.It Cm PreferredAuthentications
1430Specifies the order in which the client should try authentication methods.
1431This allows a client to prefer one method (e.g.\&
1432.Cm keyboard-interactive )
1433over another method (e.g.\&
1434.Cm password ) .
1435The default is:
1436.Bd -literal -offset indent
1437gssapi-with-mic,hostbased,publickey,
1438keyboard-interactive,password
1439.Ed
1440.It Cm ProxyCommand
1441Specifies the command to use to connect to the server.
1442The command
1443string extends to the end of the line, and is executed
1444using the user's shell
1445.Ql exec
1446directive to avoid a lingering shell process.
1447.Pp
1448Arguments to
1449.Cm ProxyCommand
1450accept the tokens described in the
1451.Sx TOKENS
1452section.
1453The command can be basically anything,
1454and should read from its standard input and write to its standard output.
1455It should eventually connect an
1456.Xr sshd 8
1457server running on some machine, or execute
1458.Ic sshd -i
1459somewhere.
1460Host key management will be done using the
1461.Cm Hostname
1462of the host being connected (defaulting to the name typed by the user).
1463Setting the command to
1464.Cm none
1465disables this option entirely.
1466Note that
1467.Cm CheckHostIP
1468is not available for connects with a proxy command.
1469.Pp
1470This directive is useful in conjunction with
1471.Xr nc 1
1472and its proxy support.
1473For example, the following directive would connect via an HTTP proxy at
1474192.0.2.0:
1475.Bd -literal -offset 3n
1476ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p
1477.Ed
1478.It Cm ProxyJump
1479Specifies one or more jump proxies as either
1480.Xo
1481.Sm off
1482.Op Ar user No @
1483.Ar host
1484.Op : Ns Ar port
1485.Sm on
1486or an ssh URI
1487.Xc .
1488Multiple proxies may be separated by comma characters and will be visited
1489sequentially.
1490Setting this option will cause
1491.Xr ssh 1
1492to connect to the target host by first making a
1493.Xr ssh 1
1494connection to the specified
1495.Cm ProxyJump
1496host and then establishing a
1497TCP forwarding to the ultimate target from there.
1498Setting the host to
1499.Cm none
1500disables this option entirely.
1501.Pp
1502Note that this option will compete with the
1503.Cm ProxyCommand
1504option - whichever is specified first will prevent later instances of the
1505other from taking effect.
1506.Pp
1507Note also that the configuration for the destination host (either supplied
1508via the command-line or the configuration file) is not generally applied
1509to jump hosts.
1510.Pa ~/.ssh/config
1511should be used if specific configuration is required for jump hosts.
1512.It Cm ProxyUseFdpass
1513Specifies that
1514.Cm ProxyCommand
1515will pass a connected file descriptor back to
1516.Xr ssh 1
1517instead of continuing to execute and pass data.
1518The default is
1519.Cm no .
1520.It Cm PubkeyAcceptedAlgorithms
1521Specifies the signature algorithms that will be used for public key
1522authentication as a comma-separated list of patterns.
1523If the specified list begins with a
1524.Sq +
1525character, then the algorithms after it will be appended to the default
1526instead of replacing it.
1527If the specified list begins with a
1528.Sq -
1529character, then the specified algorithms (including wildcards) will be removed
1530from the default set instead of replacing them.
1531If the specified list begins with a
1532.Sq ^
1533character, then the specified algorithms will be placed at the head of the
1534default set.
1535The default for this option is:
1536.Bd -literal -offset 3n
1537ssh-ed25519-cert-v01@openssh.com,
1538ecdsa-sha2-nistp256-cert-v01@openssh.com,
1539ecdsa-sha2-nistp384-cert-v01@openssh.com,
1540ecdsa-sha2-nistp521-cert-v01@openssh.com,
1541sk-ssh-ed25519-cert-v01@openssh.com,
1542sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
1543rsa-sha2-512-cert-v01@openssh.com,
1544rsa-sha2-256-cert-v01@openssh.com,
1545ssh-ed25519,
1546ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1547sk-ssh-ed25519@openssh.com,
1548sk-ecdsa-sha2-nistp256@openssh.com,
1549rsa-sha2-512,rsa-sha2-256
1550.Ed
1551.Pp
1552The list of available signature algorithms may also be obtained using
1553.Qq ssh -Q PubkeyAcceptedAlgorithms .
1554.It Cm PubkeyAuthentication
1555Specifies whether to try public key authentication.
1556The argument to this keyword must be
1557.Cm yes
1558(the default),
1559.Cm no ,
1560.Cm unbound
1561or
1562.Cm host-bound .
1563The final two options enable public key authentication while respectively
1564disabling or enabling the OpenSSH host-bound authentication protocol
1565extension required for restricted
1566.Xr ssh-agent 1
1567forwarding.
1568.It Cm RekeyLimit
1569Specifies the maximum amount of data that may be transmitted or received
1570before the session key is renegotiated, optionally followed by a maximum
1571amount of time that may pass before the session key is renegotiated.
1572The first argument is specified in bytes and may have a suffix of
1573.Sq K ,
1574.Sq M ,
1575or
1576.Sq G
1577to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1578The default is between
1579.Sq 1G
1580and
1581.Sq 4G ,
1582depending on the cipher.
1583The optional second value is specified in seconds and may use any of the
1584units documented in the TIME FORMATS section of
1585.Xr sshd_config 5 .
1586The default value for
1587.Cm RekeyLimit
1588is
1589.Cm default none ,
1590which means that rekeying is performed after the cipher's default amount
1591of data has been sent or received and no time based rekeying is done.
1592.It Cm RemoteCommand
1593Specifies a command to execute on the remote machine after successfully
1594connecting to the server.
1595The command string extends to the end of the line, and is executed with
1596the user's shell.
1597Arguments to
1598.Cm RemoteCommand
1599accept the tokens described in the
1600.Sx TOKENS
1601section.
1602.It Cm RemoteForward
1603Specifies that a TCP port on the remote machine be forwarded over
1604the secure channel.
1605The remote port may either be forwarded to a specified host and port
1606from the local machine, or may act as a SOCKS 4/5 proxy that allows a remote
1607client to connect to arbitrary destinations from the local machine.
1608The first argument is the listening specification and may be
1609.Sm off
1610.Oo Ar bind_address : Oc Ar port
1611.Sm on
1612or, if the remote host supports it, a Unix domain socket path.
1613If forwarding to a specific destination then the second argument must be
1614.Ar host : Ns Ar hostport
1615or a Unix domain socket path,
1616otherwise if no destination argument is specified then the remote forwarding
1617will be established as a SOCKS proxy.
1618When acting as a SOCKS proxy, the destination of the connection can be
1619restricted by
1620.Cm PermitRemoteOpen .
1621.Pp
1622IPv6 addresses can be specified by enclosing addresses in square brackets.
1623Multiple forwardings may be specified, and additional
1624forwardings can be given on the command line.
1625Privileged ports can be forwarded only when
1626logging in as root on the remote machine.
1627Unix domain socket paths may use the tokens described in the
1628.Sx TOKENS
1629section and environment variables as described in the
1630.Sx ENVIRONMENT VARIABLES
1631section.
1632.Pp
1633If the
1634.Ar port
1635argument is 0,
1636the listen port will be dynamically allocated on the server and reported
1637to the client at run time.
1638.Pp
1639If the
1640.Ar bind_address
1641is not specified, the default is to only bind to loopback addresses.
1642If the
1643.Ar bind_address
1644is
1645.Ql *
1646or an empty string, then the forwarding is requested to listen on all
1647interfaces.
1648Specifying a remote
1649.Ar bind_address
1650will only succeed if the server's
1651.Cm GatewayPorts
1652option is enabled (see
1653.Xr sshd_config 5 ) .
1654.It Cm RequestTTY
1655Specifies whether to request a pseudo-tty for the session.
1656The argument may be one of:
1657.Cm no
1658(never request a TTY),
1659.Cm yes
1660(always request a TTY when standard input is a TTY),
1661.Cm force
1662(always request a TTY) or
1663.Cm auto
1664(request a TTY when opening a login session).
1665This option mirrors the
1666.Fl t
1667and
1668.Fl T
1669flags for
1670.Xr ssh 1 .
1671.It Cm RequiredRSASize
1672Specifies the minimum RSA key size (in bits) that
1673.Xr ssh 1
1674will accept.
1675User authentication keys smaller than this limit will be ignored.
1676Servers that present host keys smaller than this limit will cause the
1677connection to be terminated.
1678The default is
1679.Cm 1024
1680bits.
1681Note that this limit may only be raised from the default.
1682.It Cm RevokedHostKeys
1683Specifies revoked host public keys.
1684Keys listed in this file will be refused for host authentication.
1685Note that if this file does not exist or is not readable,
1686then host authentication will be refused for all hosts.
1687Keys may be specified as a text file, listing one public key per line, or as
1688an OpenSSH Key Revocation List (KRL) as generated by
1689.Xr ssh-keygen 1 .
1690For more information on KRLs, see the KEY REVOCATION LISTS section in
1691.Xr ssh-keygen 1 .
1692Arguments to
1693.Cm RevokedHostKeys
1694may use the tilde syntax to refer to a user's home directory,
1695the tokens described in the
1696.Sx TOKENS
1697section and environment variables as described in the
1698.Sx ENVIRONMENT VARIABLES
1699section.
1700.It Cm SecurityKeyProvider
1701Specifies a path to a library that will be used when loading any
1702FIDO authenticator-hosted keys, overriding the default of using
1703the built-in USB HID support.
1704.Pp
1705If the specified value begins with a
1706.Sq $
1707character, then it will be treated as an environment variable containing
1708the path to the library.
1709.It Cm SendEnv
1710Specifies what variables from the local
1711.Xr environ 7
1712should be sent to the server.
1713The server must also support it, and the server must be configured to
1714accept these environment variables.
1715Note that the
1716.Ev TERM
1717environment variable is always sent whenever a
1718pseudo-terminal is requested as it is required by the protocol.
1719Refer to
1720.Cm AcceptEnv
1721in
1722.Xr sshd_config 5
1723for how to configure the server.
1724Variables are specified by name, which may contain wildcard characters.
1725Multiple environment variables may be separated by whitespace or spread
1726across multiple
1727.Cm SendEnv
1728directives.
1729.Pp
1730See
1731.Sx PATTERNS
1732for more information on patterns.
1733.Pp
1734It is possible to clear previously set
1735.Cm SendEnv
1736variable names by prefixing patterns with
1737.Pa - .
1738The default is not to send any environment variables.
1739.It Cm ServerAliveCountMax
1740Sets the number of server alive messages (see below) which may be
1741sent without
1742.Xr ssh 1
1743receiving any messages back from the server.
1744If this threshold is reached while server alive messages are being sent,
1745ssh will disconnect from the server, terminating the session.
1746It is important to note that the use of server alive messages is very
1747different from
1748.Cm TCPKeepAlive
1749(below).
1750The server alive messages are sent through the encrypted channel
1751and therefore will not be spoofable.
1752The TCP keepalive option enabled by
1753.Cm TCPKeepAlive
1754is spoofable.
1755The server alive mechanism is valuable when the client or
1756server depend on knowing when a connection has become unresponsive.
1757.Pp
1758The default value is 3.
1759If, for example,
1760.Cm ServerAliveInterval
1761(see below) is set to 15 and
1762.Cm ServerAliveCountMax
1763is left at the default, if the server becomes unresponsive,
1764ssh will disconnect after approximately 45 seconds.
1765.It Cm ServerAliveInterval
1766Sets a timeout interval in seconds after which if no data has been received
1767from the server,
1768.Xr ssh 1
1769will send a message through the encrypted
1770channel to request a response from the server.
1771The default
1772is 0, indicating that these messages will not be sent to the server.
1773.It Cm SessionType
1774May be used to either request invocation of a subsystem on the remote system,
1775or to prevent the execution of a remote command at all.
1776The latter is useful for just forwarding ports.
1777The argument to this keyword must be
1778.Cm none
1779(same as the
1780.Fl N
1781option),
1782.Cm subsystem
1783(same as the
1784.Fl s
1785option) or
1786.Cm default
1787(shell or command execution).
1788.It Cm SetEnv
1789Directly specify one or more environment variables and their contents to
1790be sent to the server.
1791Similarly to
1792.Cm SendEnv ,
1793with the exception of the
1794.Ev TERM
1795variable, the server must be prepared to accept the environment variable.
1796.It Cm StdinNull
1797Redirects stdin from
1798.Pa /dev/null
1799(actually, prevents reading from stdin).
1800Either this or the equivalent
1801.Fl n
1802option must be used when
1803.Nm ssh
1804is run in the background.
1805The argument to this keyword must be
1806.Cm yes
1807(same as the
1808.Fl n
1809option) or
1810.Cm no
1811(the default).
1812.It Cm StreamLocalBindMask
1813Sets the octal file creation mode mask
1814.Pq umask
1815used when creating a Unix-domain socket file for local or remote
1816port forwarding.
1817This option is only used for port forwarding to a Unix-domain socket file.
1818.Pp
1819The default value is 0177, which creates a Unix-domain socket file that is
1820readable and writable only by the owner.
1821Note that not all operating systems honor the file mode on Unix-domain
1822socket files.
1823.It Cm StreamLocalBindUnlink
1824Specifies whether to remove an existing Unix-domain socket file for local
1825or remote port forwarding before creating a new one.
1826If the socket file already exists and
1827.Cm StreamLocalBindUnlink
1828is not enabled,
1829.Nm ssh
1830will be unable to forward the port to the Unix-domain socket file.
1831This option is only used for port forwarding to a Unix-domain socket file.
1832.Pp
1833The argument must be
1834.Cm yes
1835or
1836.Cm no
1837(the default).
1838.It Cm StrictHostKeyChecking
1839If this flag is set to
1840.Cm yes ,
1841.Xr ssh 1
1842will never automatically add host keys to the
1843.Pa ~/.ssh/known_hosts
1844file, and refuses to connect to hosts whose host key has changed.
1845This provides maximum protection against man-in-the-middle (MITM) attacks,
1846though it can be annoying when the
1847.Pa /etc/ssh/ssh_known_hosts
1848file is poorly maintained or when connections to new hosts are
1849frequently made.
1850This option forces the user to manually
1851add all new hosts.
1852.Pp
1853If this flag is set to
1854.Cm accept-new
1855then ssh will automatically add new host keys to the user's
1856.Pa known_hosts
1857file, but will not permit connections to hosts with
1858changed host keys.
1859If this flag is set to
1860.Cm no
1861or
1862.Cm off ,
1863ssh will automatically add new host keys to the user known hosts files
1864and allow connections to hosts with changed hostkeys to proceed,
1865subject to some restrictions.
1866If this flag is set to
1867.Cm ask
1868(the default),
1869new host keys
1870will be added to the user known host files only after the user
1871has confirmed that is what they really want to do, and
1872ssh will refuse to connect to hosts whose host key has changed.
1873The host keys of
1874known hosts will be verified automatically in all cases.
1875.It Cm SyslogFacility
1876Gives the facility code that is used when logging messages from
1877.Xr ssh 1 .
1878The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1879LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1880The default is USER.
1881.It Cm TCPKeepAlive
1882Specifies whether the system should send TCP keepalive messages to the
1883other side.
1884If they are sent, death of the connection or crash of one
1885of the machines will be properly noticed.
1886However, this means that
1887connections will die if the route is down temporarily, and some people
1888find it annoying.
1889.Pp
1890The default is
1891.Cm yes
1892(to send TCP keepalive messages), and the client will notice
1893if the network goes down or the remote host dies.
1894This is important in scripts, and many users want it too.
1895.Pp
1896To disable TCP keepalive messages, the value should be set to
1897.Cm no .
1898See also
1899.Cm ServerAliveInterval
1900for protocol-level keepalives.
1901.It Cm Tag
1902Specify a configuration tag name that may be later used by a
1903.Cm Match
1904directive to select a block of configuration.
1905.It Cm Tunnel
1906Request
1907.Xr tun 4
1908device forwarding between the client and the server.
1909The argument must be
1910.Cm yes ,
1911.Cm point-to-point
1912(layer 3),
1913.Cm ethernet
1914(layer 2),
1915or
1916.Cm no
1917(the default).
1918Specifying
1919.Cm yes
1920requests the default tunnel mode, which is
1921.Cm point-to-point .
1922.It Cm TunnelDevice
1923Specifies the
1924.Xr tun 4
1925devices to open on the client
1926.Pq Ar local_tun
1927and the server
1928.Pq Ar remote_tun .
1929.Pp
1930The argument must be
1931.Sm off
1932.Ar local_tun Op : Ar remote_tun .
1933.Sm on
1934The devices may be specified by numerical ID or the keyword
1935.Cm any ,
1936which uses the next available tunnel device.
1937If
1938.Ar remote_tun
1939is not specified, it defaults to
1940.Cm any .
1941The default is
1942.Cm any:any .
1943.It Cm UpdateHostKeys
1944Specifies whether
1945.Xr ssh 1
1946should accept notifications of additional hostkeys from the server sent
1947after authentication has completed and add them to
1948.Cm UserKnownHostsFile .
1949The argument must be
1950.Cm yes ,
1951.Cm no
1952or
1953.Cm ask .
1954This option allows learning alternate hostkeys for a server
1955and supports graceful key rotation by allowing a server to send replacement
1956public keys before old ones are removed.
1957.Pp
1958Additional hostkeys are only accepted if the key used to authenticate the
1959host was already trusted or explicitly accepted by the user, the host was
1960authenticated via
1961.Cm UserKnownHostsFile
1962(i.e. not
1963.Cm GlobalKnownHostsFile )
1964and the host was authenticated using a plain key and not a certificate.
1965.Pp
1966.Cm UpdateHostKeys
1967is enabled by default if the user has not overridden the default
1968.Cm UserKnownHostsFile
1969setting and has not enabled
1970.Cm VerifyHostKeyDNS ,
1971otherwise
1972.Cm UpdateHostKeys
1973will be set to
1974.Cm no .
1975.Pp
1976If
1977.Cm UpdateHostKeys
1978is set to
1979.Cm ask ,
1980then the user is asked to confirm the modifications to the known_hosts file.
1981Confirmation is currently incompatible with
1982.Cm ControlPersist ,
1983and will be disabled if it is enabled.
1984.Pp
1985Presently, only
1986.Xr sshd 8
1987from OpenSSH 6.8 and greater support the
1988.Qq hostkeys@openssh.com
1989protocol extension used to inform the client of all the server's hostkeys.
1990.It Cm User
1991Specifies the user to log in as.
1992This can be useful when a different user name is used on different machines.
1993This saves the trouble of
1994having to remember to give the user name on the command line.
1995.It Cm UserKnownHostsFile
1996Specifies one or more files to use for the user
1997host key database, separated by whitespace.
1998Each filename may use tilde notation to refer to the user's home directory,
1999the tokens described in the
2000.Sx TOKENS
2001section and environment variables as described in the
2002.Sx ENVIRONMENT VARIABLES
2003section.
2004A value of
2005.Cm none
2006causes
2007.Xr ssh 1
2008to ignore any user-specific known hosts files.
2009The default is
2010.Pa ~/.ssh/known_hosts ,
2011.Pa ~/.ssh/known_hosts2 .
2012.It Cm VerifyHostKeyDNS
2013Specifies whether to verify the remote key using DNS and SSHFP resource
2014records.
2015If this option is set to
2016.Cm yes ,
2017the client will implicitly trust keys that match a secure fingerprint
2018from DNS.
2019Insecure fingerprints will be handled as if this option was set to
2020.Cm ask .
2021If this option is set to
2022.Cm ask ,
2023information on fingerprint match will be displayed, but the user will still
2024need to confirm new host keys according to the
2025.Cm StrictHostKeyChecking
2026option.
2027The default is
2028.Cm no .
2029.Pp
2030See also
2031.Sx VERIFYING HOST KEYS
2032in
2033.Xr ssh 1 .
2034.It Cm VisualHostKey
2035If this flag is set to
2036.Cm yes ,
2037an ASCII art representation of the remote host key fingerprint is
2038printed in addition to the fingerprint string at login and
2039for unknown host keys.
2040If this flag is set to
2041.Cm no
2042(the default),
2043no fingerprint strings are printed at login and
2044only the fingerprint string will be printed for unknown host keys.
2045.It Cm XAuthLocation
2046Specifies the full pathname of the
2047.Xr xauth 1
2048program.
2049The default is
2050.Pa /usr/local/bin/xauth .
2051.El
2052.Sh PATTERNS
2053A
2054.Em pattern
2055consists of zero or more non-whitespace characters,
2056.Sq *
2057(a wildcard that matches zero or more characters),
2058or
2059.Sq ?\&
2060(a wildcard that matches exactly one character).
2061For example, to specify a set of declarations for any host in the
2062.Qq .co.uk
2063set of domains,
2064the following pattern could be used:
2065.Pp
2066.Dl Host *.co.uk
2067.Pp
2068The following pattern
2069would match any host in the 192.168.0.[0-9] network range:
2070.Pp
2071.Dl Host 192.168.0.?
2072.Pp
2073A
2074.Em pattern-list
2075is a comma-separated list of patterns.
2076Patterns within pattern-lists may be negated
2077by preceding them with an exclamation mark
2078.Pq Sq !\& .
2079For example,
2080to allow a key to be used from anywhere within an organization
2081except from the
2082.Qq dialup
2083pool,
2084the following entry (in authorized_keys) could be used:
2085.Pp
2086.Dl from=\&"!*.dialup.example.com,*.example.com\&"
2087.Pp
2088Note that a negated match will never produce a positive result by itself.
2089For example, attempting to match
2090.Qq host3
2091against the following pattern-list will fail:
2092.Pp
2093.Dl from=\&"!host1,!host2\&"
2094.Pp
2095The solution here is to include a term that will yield a positive match,
2096such as a wildcard:
2097.Pp
2098.Dl from=\&"!host1,!host2,*\&"
2099.Sh TOKENS
2100Arguments to some keywords can make use of tokens,
2101which are expanded at runtime:
2102.Pp
2103.Bl -tag -width XXXX -offset indent -compact
2104.It %%
2105A literal
2106.Sq % .
2107.It \&%C
2108Hash of %l%h%p%r.
2109.It %d
2110Local user's home directory.
2111.It %f
2112The fingerprint of the server's host key.
2113.It %H
2114The
2115.Pa known_hosts
2116hostname or address that is being searched for.
2117.It %h
2118The remote hostname.
2119.It \%%I
2120A string describing the reason for a
2121.Cm KnownHostsCommand
2122execution: either
2123.Cm ADDRESS
2124when looking up a host by address (only when
2125.Cm CheckHostIP
2126is enabled),
2127.Cm HOSTNAME
2128when searching by hostname, or
2129.Cm ORDER
2130when preparing the host key algorithm preference list to use for the
2131destination host.
2132.It %i
2133The local user ID.
2134.It %K
2135The base64 encoded host key.
2136.It %k
2137The host key alias if specified, otherwise the original remote hostname given
2138on the command line.
2139.It %L
2140The local hostname.
2141.It %l
2142The local hostname, including the domain name.
2143.It %n
2144The original remote hostname, as given on the command line.
2145.It %p
2146The remote port.
2147.It %r
2148The remote username.
2149.It \&%T
2150The local
2151.Xr tun 4
2152or
2153.Xr tap 4
2154network interface assigned if
2155tunnel forwarding was requested, or
2156.Qq NONE
2157otherwise.
2158.It %t
2159The type of the server host key, e.g.
2160.Cm ssh-ed25519 .
2161.It %u
2162The local username.
2163.El
2164.Pp
2165.Cm CertificateFile ,
2166.Cm ControlPath ,
2167.Cm IdentityAgent ,
2168.Cm IdentityFile ,
2169.Cm KnownHostsCommand ,
2170.Cm LocalForward ,
2171.Cm Match exec ,
2172.Cm RemoteCommand ,
2173.Cm RemoteForward ,
2174.Cm RevokedHostKeys ,
2175and
2176.Cm UserKnownHostsFile
2177accept the tokens %%, %C, %d, %h, %i, %k, %L, %l, %n, %p, %r, and %u.
2178.Pp
2179.Cm KnownHostsCommand
2180additionally accepts the tokens %f, %H, %I, %K and %t.
2181.Pp
2182.Cm Hostname
2183accepts the tokens %% and %h.
2184.Pp
2185.Cm LocalCommand
2186accepts all tokens.
2187.Pp
2188.Cm ProxyCommand
2189and
2190.Cm ProxyJump
2191accept the tokens %%, %h, %n, %p, and %r.
2192.Sh ENVIRONMENT VARIABLES
2193Arguments to some keywords can be expanded at runtime from environment
2194variables on the client by enclosing them in
2195.Ic ${} ,
2196for example
2197.Ic ${HOME}/.ssh
2198would refer to the user's .ssh directory.
2199If a specified environment variable does not exist then an error will be
2200returned and the setting for that keyword will be ignored.
2201.Pp
2202The keywords
2203.Cm CertificateFile ,
2204.Cm ControlPath ,
2205.Cm IdentityAgent ,
2206.Cm IdentityFile ,
2207.Cm KnownHostsCommand ,
2208and
2209.Cm UserKnownHostsFile
2210support environment variables.
2211The keywords
2212.Cm LocalForward
2213and
2214.Cm RemoteForward
2215support environment variables only for Unix domain socket paths.
2216.Sh FILES
2217.Bl -tag -width Ds
2218.It Pa ~/.ssh/config
2219This is the per-user configuration file.
2220The format of this file is described above.
2221This file is used by the SSH client.
2222Because of the potential for abuse, this file must have strict permissions:
2223read/write for the user, and not writable by others.
2224.It Pa /etc/ssh/ssh_config
2225Systemwide configuration file.
2226This file provides defaults for those
2227values that are not specified in the user's configuration file, and
2228for those users who do not have a configuration file.
2229This file must be world-readable.
2230.El
2231.Sh SEE ALSO
2232.Xr ssh 1
2233.Sh AUTHORS
2234.An -nosplit
2235OpenSSH is a derivative of the original and free
2236ssh 1.2.12 release by
2237.An Tatu Ylonen .
2238.An Aaron Campbell , Bob Beck , Markus Friedl ,
2239.An Niels Provos , Theo de Raadt
2240and
2241.An Dug Song
2242removed many bugs, re-added newer features and
2243created OpenSSH.
2244.An Markus Friedl
2245contributed the support for SSH protocol versions 1.5 and 2.0.
2246