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