xref: /openbsd-src/usr.bin/ssh/ssh_config.5 (revision 7350f337b9e3eb4461d99580e625c7ef148d107c)
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.296 2019/06/12 11:31:50 jmc Exp $
37.Dd $Mdocdate: June 12 2019 $
38.Dt SSH_CONFIG 5
39.Os
40.Sh NAME
41.Nm ssh_config
42.Nd OpenSSH SSH client configuration files
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
59For 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 host ,
145.Cm originalhost ,
146.Cm user ,
147and
148.Cm localuser .
149The
150.Cm all
151criteria must appear alone or immediately after
152.Cm canonical
153or
154.Cm final .
155Other criteria may be combined arbitrarily.
156All criteria but
157.Cm all ,
158.Cm canonical ,
159and
160.Cm final
161require an argument.
162Criteria may be negated by prepending an exclamation mark
163.Pq Sq !\& .
164.Pp
165The
166.Cm canonical
167keyword matches only when the configuration file is being re-parsed
168after hostname canonicalization (see the
169.Cm CanonicalizeHostname
170option).
171This may be useful to specify conditions that work with canonical host
172names only.
173.Pp
174The
175.Cm final
176keyword requests that the configuration be re-parsed (regardless of whether
177.Cm CanonicalizeHostname
178is enabled), and matches only during this final pass.
179If
180.Cm CanonicalizeHostname
181is enabled, then
182.Cm canonical
183and
184.Cm final
185match during the same pass.
186.Pp
187The
188.Cm exec
189keyword executes the specified command under the user's shell.
190If the command returns a zero exit status then the condition is considered true.
191Commands containing whitespace characters must be quoted.
192Arguments to
193.Cm exec
194accept the tokens described in the
195.Sx TOKENS
196section.
197.Pp
198The other keywords' criteria must be single entries or comma-separated
199lists and may use the wildcard and negation operators described in the
200.Sx PATTERNS
201section.
202The criteria for the
203.Cm host
204keyword are matched against the target hostname, after any substitution
205by the
206.Cm Hostname
207or
208.Cm CanonicalizeHostname
209options.
210The
211.Cm originalhost
212keyword matches against the hostname as it was specified on the command-line.
213The
214.Cm user
215keyword matches against the target username on the remote host.
216The
217.Cm localuser
218keyword matches against the name of the local user running
219.Xr ssh 1
220(this keyword may be useful in system-wide
221.Nm
222files).
223.It Cm AddKeysToAgent
224Specifies whether keys should be automatically added to a running
225.Xr ssh-agent 1 .
226If this option is set to
227.Cm yes
228and a key is loaded from a file, the key and its passphrase are added to
229the agent with the default lifetime, as if by
230.Xr ssh-add 1 .
231If this option is set to
232.Cm ask ,
233.Xr ssh 1
234will require confirmation using the
235.Ev SSH_ASKPASS
236program before adding a key (see
237.Xr ssh-add 1
238for details).
239If this option is set to
240.Cm confirm ,
241each use of the key must be confirmed, as if the
242.Fl c
243option was specified to
244.Xr ssh-add 1 .
245If this option is set to
246.Cm no ,
247no keys are added to the agent.
248The argument must be
249.Cm yes ,
250.Cm confirm ,
251.Cm ask ,
252or
253.Cm no
254(the default).
255.It Cm AddressFamily
256Specifies which address family to use when connecting.
257Valid arguments are
258.Cm any
259(the default),
260.Cm inet
261(use IPv4 only), or
262.Cm inet6
263(use IPv6 only).
264.It Cm BatchMode
265If set to
266.Cm yes ,
267passphrase/password querying will be disabled.
268This option is useful in scripts and other batch jobs where no user
269is present to supply the password.
270The argument must be
271.Cm yes
272or
273.Cm no
274(the default).
275.It Cm BindAddress
276Use the specified address on the local machine as the source address of
277the connection.
278Only useful on systems with more than one address.
279.It Cm BindInterface
280Use the address of the specified interface on the local machine as the
281source address of the connection.
282.It Cm CanonicalDomains
283When
284.Cm CanonicalizeHostname
285is enabled, this option specifies the list of domain suffixes in which to
286search for the specified destination host.
287.It Cm CanonicalizeFallbackLocal
288Specifies whether to fail with an error when hostname canonicalization fails.
289The default,
290.Cm yes ,
291will attempt to look up the unqualified hostname using the system resolver's
292search rules.
293A value of
294.Cm no
295will cause
296.Xr ssh 1
297to fail instantly if
298.Cm CanonicalizeHostname
299is enabled and the target hostname cannot be found in any of the domains
300specified by
301.Cm CanonicalDomains .
302.It Cm CanonicalizeHostname
303Controls whether explicit hostname canonicalization is performed.
304The default,
305.Cm no ,
306is not to perform any name rewriting and let the system resolver handle all
307hostname lookups.
308If set to
309.Cm yes
310then, for connections that do not use a
311.Cm ProxyCommand
312or
313.Cm ProxyJump ,
314.Xr ssh 1
315will attempt to canonicalize the hostname specified on the command line
316using the
317.Cm CanonicalDomains
318suffixes and
319.Cm CanonicalizePermittedCNAMEs
320rules.
321If
322.Cm CanonicalizeHostname
323is set to
324.Cm always ,
325then canonicalization is applied to proxied connections too.
326.Pp
327If this option is enabled, then the configuration files are processed
328again using the new target name to pick up any new configuration in matching
329.Cm Host
330and
331.Cm Match
332stanzas.
333.It Cm CanonicalizeMaxDots
334Specifies the maximum number of dot characters in a hostname before
335canonicalization is disabled.
336The default, 1,
337allows a single dot (i.e. hostname.subdomain).
338.It Cm CanonicalizePermittedCNAMEs
339Specifies rules to determine whether CNAMEs should be followed when
340canonicalizing hostnames.
341The rules consist of one or more arguments of
342.Ar source_domain_list : Ns Ar target_domain_list ,
343where
344.Ar source_domain_list
345is a pattern-list of domains that may follow CNAMEs in canonicalization,
346and
347.Ar target_domain_list
348is a pattern-list of domains that they may resolve to.
349.Pp
350For example,
351.Qq *.a.example.com:*.b.example.com,*.c.example.com
352will allow hostnames matching
353.Qq *.a.example.com
354to be canonicalized to names in the
355.Qq *.b.example.com
356or
357.Qq *.c.example.com
358domains.
359.It Cm CASignatureAlgorithms
360Specifies which algorithms are allowed for signing of certificates
361by certificate authorities (CAs).
362The default is:
363.Bd -literal -offset indent
364ecdsa-sha2-nistp256.ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
365ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
366.Ed
367.Pp
368.Xr ssh 1
369will not accept host certificates signed using algorithms other than those
370specified.
371.It Cm CertificateFile
372Specifies a file from which the user's certificate is read.
373A corresponding private key must be provided separately in order
374to use this certificate either
375from an
376.Cm IdentityFile
377directive or
378.Fl i
379flag to
380.Xr ssh 1 ,
381via
382.Xr ssh-agent 1 ,
383or via a
384.Cm PKCS11Provider .
385.Pp
386Arguments to
387.Cm CertificateFile
388may use the tilde syntax to refer to a user's home directory
389or the tokens described in the
390.Sx TOKENS
391section.
392.Pp
393It is possible to have multiple certificate files specified in
394configuration files; these certificates will be tried in sequence.
395Multiple
396.Cm CertificateFile
397directives will add to the list of certificates used for
398authentication.
399.It Cm ChallengeResponseAuthentication
400Specifies whether to use challenge-response authentication.
401The argument to this keyword must be
402.Cm yes
403(the default)
404or
405.Cm no .
406.It Cm CheckHostIP
407If set to
408.Cm yes
409(the default),
410.Xr ssh 1
411will additionally check the host IP address in the
412.Pa known_hosts
413file.
414This allows it to detect if a host key changed due to DNS spoofing
415and will add addresses of destination hosts to
416.Pa ~/.ssh/known_hosts
417in the process, regardless of the setting of
418.Cm StrictHostKeyChecking .
419If the option is set to
420.Cm no ,
421the check will not be executed.
422.It Cm Ciphers
423Specifies the ciphers allowed and their order of preference.
424Multiple ciphers must be comma-separated.
425If the specified value begins with a
426.Sq +
427character, then the specified ciphers will be appended to the default set
428instead of replacing them.
429If the specified value begins with a
430.Sq -
431character, then the specified ciphers (including wildcards) will be removed
432from the default set instead of replacing them.
433.Pp
434The supported ciphers are:
435.Bd -literal -offset indent
4363des-cbc
437aes128-cbc
438aes192-cbc
439aes256-cbc
440aes128-ctr
441aes192-ctr
442aes256-ctr
443aes128-gcm@openssh.com
444aes256-gcm@openssh.com
445chacha20-poly1305@openssh.com
446.Ed
447.Pp
448The default is:
449.Bd -literal -offset indent
450chacha20-poly1305@openssh.com,
451aes128-ctr,aes192-ctr,aes256-ctr,
452aes128-gcm@openssh.com,aes256-gcm@openssh.com
453.Ed
454.Pp
455The list of available ciphers may also be obtained using
456.Qq ssh -Q cipher .
457.It Cm ClearAllForwardings
458Specifies that all local, remote, and dynamic port forwardings
459specified in the configuration files or on the command line be
460cleared.
461This option is primarily useful when used from the
462.Xr ssh 1
463command line to clear port forwardings set in
464configuration files, and is automatically set by
465.Xr scp 1
466and
467.Xr sftp 1 .
468The argument must be
469.Cm yes
470or
471.Cm no
472(the default).
473.It Cm Compression
474Specifies whether to use compression.
475The argument must be
476.Cm yes
477or
478.Cm no
479(the default).
480.It Cm ConnectionAttempts
481Specifies the number of tries (one per second) to make before exiting.
482The argument must be an integer.
483This may be useful in scripts if the connection sometimes fails.
484The default is 1.
485.It Cm ConnectTimeout
486Specifies the timeout (in seconds) used when connecting to the
487SSH server, instead of using the default system TCP timeout.
488This value is used only when the target is down or really unreachable,
489not when it refuses the connection.
490.It Cm ControlMaster
491Enables the sharing of multiple sessions over a single network connection.
492When set to
493.Cm yes ,
494.Xr ssh 1
495will listen for connections on a control socket specified using the
496.Cm ControlPath
497argument.
498Additional sessions can connect to this socket using the same
499.Cm ControlPath
500with
501.Cm ControlMaster
502set to
503.Cm no
504(the default).
505These sessions will try to reuse the master instance's network connection
506rather than initiating new ones, but will fall back to connecting normally
507if the control socket does not exist, or is not listening.
508.Pp
509Setting this to
510.Cm ask
511will cause
512.Xr ssh 1
513to listen for control connections, but require confirmation using
514.Xr ssh-askpass 1 .
515If the
516.Cm ControlPath
517cannot be opened,
518.Xr ssh 1
519will continue without connecting to a master instance.
520.Pp
521X11 and
522.Xr ssh-agent 1
523forwarding is supported over these multiplexed connections, however the
524display and agent forwarded will be the one belonging to the master
525connection i.e. it is not possible to forward multiple displays or agents.
526.Pp
527Two additional options allow for opportunistic multiplexing: try to use a
528master connection but fall back to creating a new one if one does not already
529exist.
530These options are:
531.Cm auto
532and
533.Cm autoask .
534The latter requires confirmation like the
535.Cm ask
536option.
537.It Cm ControlPath
538Specify the path to the control socket used for connection sharing as described
539in the
540.Cm ControlMaster
541section above or the string
542.Cm none
543to disable connection sharing.
544Arguments to
545.Cm ControlPath
546may use the tilde syntax to refer to a user's home directory
547or the tokens described in the
548.Sx TOKENS
549section.
550It is recommended that any
551.Cm ControlPath
552used for opportunistic connection sharing include
553at least %h, %p, and %r (or alternatively %C) and be placed in a directory
554that is not writable by other users.
555This ensures that shared connections are uniquely identified.
556.It Cm ControlPersist
557When used in conjunction with
558.Cm ControlMaster ,
559specifies that the master connection should remain open
560in the background (waiting for future client connections)
561after the initial client connection has been closed.
562If set to
563.Cm no ,
564then the master connection will not be placed into the background,
565and will close as soon as the initial client connection is closed.
566If set to
567.Cm yes
568or 0,
569then the master connection will remain in the background indefinitely
570(until killed or closed via a mechanism such as the
571.Qq ssh -O exit ) .
572If set to a time in seconds, or a time in any of the formats documented in
573.Xr sshd_config 5 ,
574then the backgrounded master connection will automatically terminate
575after it has remained idle (with no client connections) for the
576specified time.
577.It Cm DynamicForward
578Specifies that a TCP port on the local machine be forwarded
579over the secure channel, and the application
580protocol is then used to determine where to connect to from the
581remote machine.
582.Pp
583The argument must be
584.Sm off
585.Oo Ar bind_address : Oc Ar port .
586.Sm on
587IPv6 addresses can be specified by enclosing addresses in square brackets.
588By default, the local port is bound in accordance with the
589.Cm GatewayPorts
590setting.
591However, an explicit
592.Ar bind_address
593may be used to bind the connection to a specific address.
594The
595.Ar bind_address
596of
597.Cm localhost
598indicates that the listening port be bound for local use only, while an
599empty address or
600.Sq *
601indicates that the port should be available from all interfaces.
602.Pp
603Currently the SOCKS4 and SOCKS5 protocols are supported, and
604.Xr ssh 1
605will act as a SOCKS server.
606Multiple forwardings may be specified, and
607additional forwardings can be given on the command line.
608Only the superuser can forward privileged ports.
609.It Cm EnableSSHKeysign
610Setting this option to
611.Cm yes
612in the global client configuration file
613.Pa /etc/ssh/ssh_config
614enables the use of the helper program
615.Xr ssh-keysign 8
616during
617.Cm HostbasedAuthentication .
618The argument must be
619.Cm yes
620or
621.Cm no
622(the default).
623This option should be placed in the non-hostspecific section.
624See
625.Xr ssh-keysign 8
626for more information.
627.It Cm EscapeChar
628Sets the escape character (default:
629.Ql ~ ) .
630The escape character can also
631be set on the command line.
632The argument should be a single character,
633.Ql ^
634followed by a letter, or
635.Cm none
636to disable the escape
637character entirely (making the connection transparent for binary
638data).
639.It Cm ExitOnForwardFailure
640Specifies whether
641.Xr ssh 1
642should terminate the connection if it cannot set up all requested
643dynamic, tunnel, local, and remote port forwardings, (e.g.\&
644if either end is unable to bind and listen on a specified port).
645Note that
646.Cm ExitOnForwardFailure
647does not apply to connections made over port forwardings and will not,
648for example, cause
649.Xr ssh 1
650to exit if TCP connections to the ultimate forwarding destination fail.
651The argument must be
652.Cm yes
653or
654.Cm no
655(the default).
656.It Cm FingerprintHash
657Specifies the hash algorithm used when displaying key fingerprints.
658Valid options are:
659.Cm md5
660and
661.Cm sha256
662(the default).
663.It Cm ForwardAgent
664Specifies whether the connection to the authentication agent (if any)
665will be forwarded to the remote machine.
666The argument must be
667.Cm yes
668or
669.Cm no
670(the default).
671.Pp
672Agent forwarding should be enabled with caution.
673Users with the ability to bypass file permissions on the remote host
674(for the agent's Unix-domain socket)
675can access the local agent through the forwarded connection.
676An attacker cannot obtain key material from the agent,
677however they can perform operations on the keys that enable them to
678authenticate using the identities loaded into the agent.
679.It Cm ForwardX11
680Specifies whether X11 connections will be automatically redirected
681over the secure channel and
682.Ev DISPLAY
683set.
684The argument must be
685.Cm yes
686or
687.Cm no
688(the default).
689.Pp
690X11 forwarding should be enabled with caution.
691Users with the ability to bypass file permissions on the remote host
692(for the user's X11 authorization database)
693can access the local X11 display through the forwarded connection.
694An attacker may then be able to perform activities such as keystroke monitoring
695if the
696.Cm ForwardX11Trusted
697option is also enabled.
698.It Cm ForwardX11Timeout
699Specify a timeout for untrusted X11 forwarding
700using the format described in the
701.Sx TIME FORMATS
702section of
703.Xr sshd_config 5 .
704X11 connections received by
705.Xr ssh 1
706after this time will be refused.
707Setting
708.Cm ForwardX11Timeout
709to zero will disable the timeout and permit X11 forwarding for the life
710of the connection.
711The default is to disable untrusted X11 forwarding after twenty minutes has
712elapsed.
713.It Cm ForwardX11Trusted
714If this option is set to
715.Cm yes ,
716remote X11 clients will have full access to the original X11 display.
717.Pp
718If this option is set to
719.Cm no
720(the default),
721remote X11 clients will be considered untrusted and prevented
722from stealing or tampering with data belonging to trusted X11
723clients.
724Furthermore, the
725.Xr xauth 1
726token used for the session will be set to expire after 20 minutes.
727Remote clients will be refused access after this time.
728.Pp
729See the X11 SECURITY extension specification for full details on
730the restrictions imposed on untrusted clients.
731.It Cm GatewayPorts
732Specifies whether remote hosts are allowed to connect to local
733forwarded ports.
734By default,
735.Xr ssh 1
736binds local port forwardings to the loopback address.
737This prevents other remote hosts from connecting to forwarded ports.
738.Cm GatewayPorts
739can be used to specify that ssh
740should bind local port forwardings to the wildcard address,
741thus allowing remote hosts to connect to forwarded ports.
742The argument must be
743.Cm yes
744or
745.Cm no
746(the default).
747.It Cm GlobalKnownHostsFile
748Specifies one or more files to use for the global
749host key database, separated by whitespace.
750The default is
751.Pa /etc/ssh/ssh_known_hosts ,
752.Pa /etc/ssh/ssh_known_hosts2 .
753.It Cm GSSAPIAuthentication
754Specifies whether user authentication based on GSSAPI is allowed.
755The default is
756.Cm no .
757.It Cm GSSAPIDelegateCredentials
758Forward (delegate) credentials to the server.
759The default is
760.Cm no .
761.It Cm HashKnownHosts
762Indicates that
763.Xr ssh 1
764should hash host names and addresses when they are added to
765.Pa ~/.ssh/known_hosts .
766These hashed names may be used normally by
767.Xr ssh 1
768and
769.Xr sshd 8 ,
770but they do not reveal identifying information should the file's contents
771be disclosed.
772The default is
773.Cm no .
774Note that existing names and addresses in known hosts files
775will not be converted automatically,
776but may be manually hashed using
777.Xr ssh-keygen 1 .
778.It Cm HostbasedAuthentication
779Specifies whether to try rhosts based authentication with public key
780authentication.
781The argument must be
782.Cm yes
783or
784.Cm no
785(the default).
786.It Cm HostbasedKeyTypes
787Specifies the key types that will be used for hostbased authentication
788as a comma-separated list of patterns.
789Alternately if the specified value begins with a
790.Sq +
791character, then the specified key types will be appended to the default set
792instead of replacing them.
793If the specified value begins with a
794.Sq -
795character, then the specified key types (including wildcards) will be removed
796from the default set instead of replacing them.
797The default for this option is:
798.Bd -literal -offset 3n
799ecdsa-sha2-nistp256-cert-v01@openssh.com,
800ecdsa-sha2-nistp384-cert-v01@openssh.com,
801ecdsa-sha2-nistp521-cert-v01@openssh.com,
802ssh-ed25519-cert-v01@openssh.com,
803rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,
804ssh-rsa-cert-v01@openssh.com,
805ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
806ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
807.Ed
808.Pp
809The
810.Fl Q
811option of
812.Xr ssh 1
813may be used to list supported key types.
814.It Cm HostKeyAlgorithms
815Specifies the host key algorithms
816that the client wants to use in order of preference.
817Alternately if the specified value begins with a
818.Sq +
819character, then the specified key types will be appended to the default set
820instead of replacing them.
821If the specified value begins with a
822.Sq -
823character, then the specified key types (including wildcards) will be removed
824from the default set instead of replacing them.
825The default for this option is:
826.Bd -literal -offset 3n
827ecdsa-sha2-nistp256-cert-v01@openssh.com,
828ecdsa-sha2-nistp384-cert-v01@openssh.com,
829ecdsa-sha2-nistp521-cert-v01@openssh.com,
830ssh-ed25519-cert-v01@openssh.com,
831rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,
832ssh-rsa-cert-v01@openssh.com,
833ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
834ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
835.Ed
836.Pp
837If hostkeys are known for the destination host then this default is modified
838to prefer their algorithms.
839.Pp
840The list of available key types may also be obtained using
841.Qq ssh -Q key .
842.It Cm HostKeyAlias
843Specifies an alias that should be used instead of the
844real host name when looking up or saving the host key
845in the host key database files and when validating host certificates.
846This option is useful for tunneling SSH connections
847or for multiple servers running on a single host.
848.It Cm Hostname
849Specifies the real host name to log into.
850This can be used to specify nicknames or abbreviations for hosts.
851Arguments to
852.Cm Hostname
853accept the tokens described in the
854.Sx TOKENS
855section.
856Numeric IP addresses are also permitted (both on the command line and in
857.Cm Hostname
858specifications).
859The default is the name given on the command line.
860.It Cm IdentitiesOnly
861Specifies that
862.Xr ssh 1
863should only use the authentication identity and certificate files explicitly
864configured in the
865.Nm
866files
867or passed on the
868.Xr ssh 1
869command-line,
870even if
871.Xr ssh-agent 1
872or a
873.Cm PKCS11Provider
874offers more identities.
875The argument to this keyword must be
876.Cm yes
877or
878.Cm no
879(the default).
880This option is intended for situations where ssh-agent
881offers many different identities.
882.It Cm IdentityAgent
883Specifies the
884.Ux Ns -domain
885socket used to communicate with the authentication agent.
886.Pp
887This option overrides the
888.Ev SSH_AUTH_SOCK
889environment variable and can be used to select a specific agent.
890Setting the socket name to
891.Cm none
892disables the use of an authentication agent.
893If the string
894.Qq SSH_AUTH_SOCK
895is specified, the location of the socket will be read from the
896.Ev SSH_AUTH_SOCK
897environment variable.
898Otherwise if the specified value begins with a
899.Sq $
900character, then it will be treated as an environment variable containing
901the location of the socket.
902.Pp
903Arguments to
904.Cm IdentityAgent
905may use the tilde syntax to refer to a user's home directory
906or the tokens described in the
907.Sx TOKENS
908section.
909.It Cm IdentityFile
910Specifies a file from which the user's DSA, ECDSA, Ed25519 or RSA authentication
911identity is read.
912The default is
913.Pa ~/.ssh/id_dsa ,
914.Pa ~/.ssh/id_ecdsa ,
915.Pa ~/.ssh/id_ed25519
916and
917.Pa ~/.ssh/id_rsa .
918Additionally, any identities represented by the authentication agent
919will be used for authentication unless
920.Cm IdentitiesOnly
921is set.
922If no certificates have been explicitly specified by
923.Cm CertificateFile ,
924.Xr ssh 1
925will try to load certificate information from the filename obtained by
926appending
927.Pa -cert.pub
928to the path of a specified
929.Cm IdentityFile .
930.Pp
931Arguments to
932.Cm IdentityFile
933may use the tilde syntax to refer to a user's home directory
934or the tokens described in the
935.Sx TOKENS
936section.
937.Pp
938It is possible to have
939multiple identity files specified in configuration files; all these
940identities will be tried in sequence.
941Multiple
942.Cm IdentityFile
943directives will add to the list of identities tried (this behaviour
944differs from that of other configuration directives).
945.Pp
946.Cm IdentityFile
947may be used in conjunction with
948.Cm IdentitiesOnly
949to select which identities in an agent are offered during authentication.
950.Cm IdentityFile
951may also be used in conjunction with
952.Cm CertificateFile
953in order to provide any certificate also needed for authentication with
954the identity.
955.It Cm IgnoreUnknown
956Specifies a pattern-list of unknown options to be ignored if they are
957encountered in configuration parsing.
958This may be used to suppress errors if
959.Nm
960contains options that are unrecognised by
961.Xr ssh 1 .
962It is recommended that
963.Cm IgnoreUnknown
964be listed early in the configuration file as it will not be applied
965to unknown options that appear before it.
966.It Cm Include
967Include the specified configuration file(s).
968Multiple pathnames may be specified and each pathname may contain
969.Xr glob 7
970wildcards and, for user configurations, shell-like
971.Sq ~
972references to user home directories.
973Files without absolute paths are assumed to be in
974.Pa ~/.ssh
975if included in a user configuration file or
976.Pa /etc/ssh
977if included from the system configuration file.
978.Cm Include
979directive may appear inside a
980.Cm Match
981or
982.Cm Host
983block
984to perform conditional inclusion.
985.It Cm IPQoS
986Specifies the IPv4 type-of-service or DSCP class for connections.
987Accepted values are
988.Cm af11 ,
989.Cm af12 ,
990.Cm af13 ,
991.Cm af21 ,
992.Cm af22 ,
993.Cm af23 ,
994.Cm af31 ,
995.Cm af32 ,
996.Cm af33 ,
997.Cm af41 ,
998.Cm af42 ,
999.Cm af43 ,
1000.Cm cs0 ,
1001.Cm cs1 ,
1002.Cm cs2 ,
1003.Cm cs3 ,
1004.Cm cs4 ,
1005.Cm cs5 ,
1006.Cm cs6 ,
1007.Cm cs7 ,
1008.Cm ef ,
1009.Cm lowdelay ,
1010.Cm throughput ,
1011.Cm reliability ,
1012a numeric value, or
1013.Cm none
1014to use the operating system default.
1015This option may take one or two arguments, separated by whitespace.
1016If one argument is specified, it is used as the packet class unconditionally.
1017If two values are specified, the first is automatically selected for
1018interactive sessions and the second for non-interactive sessions.
1019The default is
1020.Cm af21
1021(Low-Latency Data)
1022for interactive sessions and
1023.Cm cs1
1024(Lower Effort)
1025for non-interactive sessions.
1026.It Cm KbdInteractiveAuthentication
1027Specifies whether to use keyboard-interactive authentication.
1028The argument to this keyword must be
1029.Cm yes
1030(the default)
1031or
1032.Cm no .
1033.It Cm KbdInteractiveDevices
1034Specifies the list of methods to use in keyboard-interactive authentication.
1035Multiple method names must be comma-separated.
1036The default is to use the server specified list.
1037The methods available vary depending on what the server supports.
1038For an OpenSSH server,
1039it may be zero or more of:
1040.Cm bsdauth ,
1041.Cm pam ,
1042and
1043.Cm skey .
1044.It Cm KexAlgorithms
1045Specifies the available KEX (Key Exchange) algorithms.
1046Multiple algorithms must be comma-separated.
1047Alternately if the specified value begins with a
1048.Sq +
1049character, then the specified methods will be appended to the default set
1050instead of replacing them.
1051If the specified value begins with a
1052.Sq -
1053character, then the specified methods (including wildcards) will be removed
1054from the default set instead of replacing them.
1055The default is:
1056.Bd -literal -offset indent
1057curve25519-sha256,curve25519-sha256@libssh.org,
1058ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
1059diffie-hellman-group-exchange-sha256,
1060diffie-hellman-group16-sha512,
1061diffie-hellman-group18-sha512,
1062diffie-hellman-group14-sha256,
1063diffie-hellman-group14-sha1
1064.Ed
1065.Pp
1066The list of available key exchange algorithms may also be obtained using
1067.Qq ssh -Q kex .
1068.It Cm LocalCommand
1069Specifies a command to execute on the local machine after successfully
1070connecting to the server.
1071The command string extends to the end of the line, and is executed with
1072the user's shell.
1073Arguments to
1074.Cm LocalCommand
1075accept the tokens described in the
1076.Sx TOKENS
1077section.
1078.Pp
1079The command is run synchronously and does not have access to the
1080session of the
1081.Xr ssh 1
1082that spawned it.
1083It should not be used for interactive commands.
1084.Pp
1085This directive is ignored unless
1086.Cm PermitLocalCommand
1087has been enabled.
1088.It Cm LocalForward
1089Specifies that a TCP port on the local machine be forwarded over
1090the secure channel to the specified host and port from the remote machine.
1091The first argument must be
1092.Sm off
1093.Oo Ar bind_address : Oc Ar port
1094.Sm on
1095and the second argument must be
1096.Ar host : Ns Ar hostport .
1097IPv6 addresses can be specified by enclosing addresses in square brackets.
1098Multiple forwardings may be specified, and additional forwardings can be
1099given on the command line.
1100Only the superuser can forward privileged ports.
1101By default, the local port is bound in accordance with the
1102.Cm GatewayPorts
1103setting.
1104However, an explicit
1105.Ar bind_address
1106may be used to bind the connection to a specific address.
1107The
1108.Ar bind_address
1109of
1110.Cm localhost
1111indicates that the listening port be bound for local use only, while an
1112empty address or
1113.Sq *
1114indicates that the port should be available from all interfaces.
1115.It Cm LogLevel
1116Gives the verbosity level that is used when logging messages from
1117.Xr ssh 1 .
1118The possible values are:
1119QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
1120The default is INFO.
1121DEBUG and DEBUG1 are equivalent.
1122DEBUG2 and DEBUG3 each specify higher levels of verbose output.
1123.It Cm MACs
1124Specifies the MAC (message authentication code) algorithms
1125in order of preference.
1126The MAC algorithm is used for data integrity protection.
1127Multiple algorithms must be comma-separated.
1128If the specified value begins with a
1129.Sq +
1130character, then the specified algorithms will be appended to the default set
1131instead of replacing them.
1132If the specified value begins with a
1133.Sq -
1134character, then the specified algorithms (including wildcards) will be removed
1135from the default set instead of replacing them.
1136.Pp
1137The algorithms that contain
1138.Qq -etm
1139calculate the MAC after encryption (encrypt-then-mac).
1140These are considered safer and their use recommended.
1141.Pp
1142The default is:
1143.Bd -literal -offset indent
1144umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1145hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
1146hmac-sha1-etm@openssh.com,
1147umac-64@openssh.com,umac-128@openssh.com,
1148hmac-sha2-256,hmac-sha2-512,hmac-sha1
1149.Ed
1150.Pp
1151The list of available MAC algorithms may also be obtained using
1152.Qq ssh -Q mac .
1153.It Cm NoHostAuthenticationForLocalhost
1154Disable host authentication for localhost (loopback addresses).
1155The argument to this keyword must be
1156.Cm yes
1157or
1158.Cm no
1159(the default).
1160.It Cm NumberOfPasswordPrompts
1161Specifies the number of password prompts before giving up.
1162The argument to this keyword must be an integer.
1163The default is 3.
1164.It Cm PasswordAuthentication
1165Specifies whether to use password authentication.
1166The argument to this keyword must be
1167.Cm yes
1168(the default)
1169or
1170.Cm no .
1171.It Cm PermitLocalCommand
1172Allow local command execution via the
1173.Ic LocalCommand
1174option or using the
1175.Ic !\& Ns Ar command
1176escape sequence in
1177.Xr ssh 1 .
1178The argument must be
1179.Cm yes
1180or
1181.Cm no
1182(the default).
1183.It Cm PKCS11Provider
1184Specifies which PKCS#11 provider to use or
1185.Cm none
1186to indicate that no provider should be used (the default).
1187The argument to this keyword is a path to the PKCS#11 shared library
1188.Xr ssh 1
1189should use to communicate with a PKCS#11 token providing keys for user
1190authentication.
1191.It Cm Port
1192Specifies the port number to connect on the remote host.
1193The default is 22.
1194.It Cm PreferredAuthentications
1195Specifies the order in which the client should try authentication methods.
1196This allows a client to prefer one method (e.g.\&
1197.Cm keyboard-interactive )
1198over another method (e.g.\&
1199.Cm password ) .
1200The default is:
1201.Bd -literal -offset indent
1202gssapi-with-mic,hostbased,publickey,
1203keyboard-interactive,password
1204.Ed
1205.It Cm ProxyCommand
1206Specifies the command to use to connect to the server.
1207The command
1208string extends to the end of the line, and is executed
1209using the user's shell
1210.Ql exec
1211directive to avoid a lingering shell process.
1212.Pp
1213Arguments to
1214.Cm ProxyCommand
1215accept the tokens described in the
1216.Sx TOKENS
1217section.
1218The command can be basically anything,
1219and should read from its standard input and write to its standard output.
1220It should eventually connect an
1221.Xr sshd 8
1222server running on some machine, or execute
1223.Ic sshd -i
1224somewhere.
1225Host key management will be done using the
1226.Cm Hostname
1227of the host being connected (defaulting to the name typed by the user).
1228Setting the command to
1229.Cm none
1230disables this option entirely.
1231Note that
1232.Cm CheckHostIP
1233is not available for connects with a proxy command.
1234.Pp
1235This directive is useful in conjunction with
1236.Xr nc 1
1237and its proxy support.
1238For example, the following directive would connect via an HTTP proxy at
1239192.0.2.0:
1240.Bd -literal -offset 3n
1241ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p
1242.Ed
1243.It Cm ProxyJump
1244Specifies one or more jump proxies as either
1245.Xo
1246.Sm off
1247.Op Ar user No @
1248.Ar host
1249.Op : Ns Ar port
1250.Sm on
1251or an ssh URI
1252.Xc .
1253Multiple proxies may be separated by comma characters and will be visited
1254sequentially.
1255Setting this option will cause
1256.Xr ssh 1
1257to connect to the target host by first making a
1258.Xr ssh 1
1259connection to the specified
1260.Cm ProxyJump
1261host and then establishing a
1262TCP forwarding to the ultimate target from there.
1263.Pp
1264Note that this option will compete with the
1265.Cm ProxyCommand
1266option - whichever is specified first will prevent later instances of the
1267other from taking effect.
1268.Pp
1269Note also that the configuration for the destination host (either supplied
1270via the command-line or the configuration file) is not generally applied
1271to jump hosts.
1272.Pa ~/.ssh/config
1273should be used if specific configuration is required for jump hosts.
1274.It Cm ProxyUseFdpass
1275Specifies that
1276.Cm ProxyCommand
1277will pass a connected file descriptor back to
1278.Xr ssh 1
1279instead of continuing to execute and pass data.
1280The default is
1281.Cm no .
1282.It Cm PubkeyAcceptedKeyTypes
1283Specifies the key types that will be used for public key authentication
1284as a comma-separated list of patterns.
1285Alternately if the specified value begins with a
1286.Sq +
1287character, then the key types after it will be appended to the default
1288instead of replacing it.
1289If the specified value begins with a
1290.Sq -
1291character, then the specified key types (including wildcards) will be removed
1292from the default set instead of replacing them.
1293The default for this option is:
1294.Bd -literal -offset 3n
1295ecdsa-sha2-nistp256-cert-v01@openssh.com,
1296ecdsa-sha2-nistp384-cert-v01@openssh.com,
1297ecdsa-sha2-nistp521-cert-v01@openssh.com,
1298ssh-ed25519-cert-v01@openssh.com,
1299rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,
1300ssh-rsa-cert-v01@openssh.com,
1301ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1302ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
1303.Ed
1304.Pp
1305The list of available key types may also be obtained using
1306.Qq ssh -Q key .
1307.It Cm PubkeyAuthentication
1308Specifies whether to try public key authentication.
1309The argument to this keyword must be
1310.Cm yes
1311(the default)
1312or
1313.Cm no .
1314.It Cm RekeyLimit
1315Specifies the maximum amount of data that may be transmitted before the
1316session key is renegotiated, optionally followed a maximum amount of
1317time that may pass before the session key is renegotiated.
1318The first argument is specified in bytes and may have a suffix of
1319.Sq K ,
1320.Sq M ,
1321or
1322.Sq G
1323to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1324The default is between
1325.Sq 1G
1326and
1327.Sq 4G ,
1328depending on the cipher.
1329The optional second value is specified in seconds and may use any of the
1330units documented in the TIME FORMATS section of
1331.Xr sshd_config 5 .
1332The default value for
1333.Cm RekeyLimit
1334is
1335.Cm default none ,
1336which means that rekeying is performed after the cipher's default amount
1337of data has been sent or received and no time based rekeying is done.
1338.It Cm RemoteCommand
1339Specifies a command to execute on the remote machine after successfully
1340connecting to the server.
1341The command string extends to the end of the line, and is executed with
1342the user's shell.
1343Arguments to
1344.Cm RemoteCommand
1345accept the tokens described in the
1346.Sx TOKENS
1347section.
1348.It Cm RemoteForward
1349Specifies that a TCP port on the remote machine be forwarded over
1350the secure channel.
1351The remote port may either be forwarded to a specified host and port
1352from the local machine, or may act as a SOCKS 4/5 proxy that allows a remote
1353client to connect to arbitrary destinations from the local machine.
1354The first argument must be
1355.Sm off
1356.Oo Ar bind_address : Oc Ar port
1357.Sm on
1358If forwarding to a specific destination then the second argument must be
1359.Ar host : Ns Ar hostport ,
1360otherwise if no destination argument is specified then the remote forwarding
1361will be established as a SOCKS proxy.
1362.Pp
1363IPv6 addresses can be specified by enclosing addresses in square brackets.
1364Multiple forwardings may be specified, and additional
1365forwardings can be given on the command line.
1366Privileged ports can be forwarded only when
1367logging in as root on the remote machine.
1368.Pp
1369If the
1370.Ar port
1371argument is 0,
1372the listen port will be dynamically allocated on the server and reported
1373to the client at run time.
1374.Pp
1375If the
1376.Ar bind_address
1377is not specified, the default is to only bind to loopback addresses.
1378If the
1379.Ar bind_address
1380is
1381.Ql *
1382or an empty string, then the forwarding is requested to listen on all
1383interfaces.
1384Specifying a remote
1385.Ar bind_address
1386will only succeed if the server's
1387.Cm GatewayPorts
1388option is enabled (see
1389.Xr sshd_config 5 ) .
1390.It Cm RequestTTY
1391Specifies whether to request a pseudo-tty for the session.
1392The argument may be one of:
1393.Cm no
1394(never request a TTY),
1395.Cm yes
1396(always request a TTY when standard input is a TTY),
1397.Cm force
1398(always request a TTY) or
1399.Cm auto
1400(request a TTY when opening a login session).
1401This option mirrors the
1402.Fl t
1403and
1404.Fl T
1405flags for
1406.Xr ssh 1 .
1407.It Cm RevokedHostKeys
1408Specifies revoked host public keys.
1409Keys listed in this file will be refused for host authentication.
1410Note that if this file does not exist or is not readable,
1411then host authentication will be refused for all hosts.
1412Keys may be specified as a text file, listing one public key per line, or as
1413an OpenSSH Key Revocation List (KRL) as generated by
1414.Xr ssh-keygen 1 .
1415For more information on KRLs, see the KEY REVOCATION LISTS section in
1416.Xr ssh-keygen 1 .
1417.It Cm SendEnv
1418Specifies what variables from the local
1419.Xr environ 7
1420should be sent to the server.
1421The server must also support it, and the server must be configured to
1422accept these environment variables.
1423Note that the
1424.Ev TERM
1425environment variable is always sent whenever a
1426pseudo-terminal is requested as it is required by the protocol.
1427Refer to
1428.Cm AcceptEnv
1429in
1430.Xr sshd_config 5
1431for how to configure the server.
1432Variables are specified by name, which may contain wildcard characters.
1433Multiple environment variables may be separated by whitespace or spread
1434across multiple
1435.Cm SendEnv
1436directives.
1437.Pp
1438See
1439.Sx PATTERNS
1440for more information on patterns.
1441.Pp
1442It is possible to clear previously set
1443.Cm SendEnv
1444variable names by prefixing patterns with
1445.Pa - .
1446The default is not to send any environment variables.
1447.It Cm ServerAliveCountMax
1448Sets the number of server alive messages (see below) which may be
1449sent without
1450.Xr ssh 1
1451receiving any messages back from the server.
1452If this threshold is reached while server alive messages are being sent,
1453ssh will disconnect from the server, terminating the session.
1454It is important to note that the use of server alive messages is very
1455different from
1456.Cm TCPKeepAlive
1457(below).
1458The server alive messages are sent through the encrypted channel
1459and therefore will not be spoofable.
1460The TCP keepalive option enabled by
1461.Cm TCPKeepAlive
1462is spoofable.
1463The server alive mechanism is valuable when the client or
1464server depend on knowing when a connection has become inactive.
1465.Pp
1466The default value is 3.
1467If, for example,
1468.Cm ServerAliveInterval
1469(see below) is set to 15 and
1470.Cm ServerAliveCountMax
1471is left at the default, if the server becomes unresponsive,
1472ssh will disconnect after approximately 45 seconds.
1473.It Cm ServerAliveInterval
1474Sets a timeout interval in seconds after which if no data has been received
1475from the server,
1476.Xr ssh 1
1477will send a message through the encrypted
1478channel to request a response from the server.
1479The default
1480is 0, indicating that these messages will not be sent to the server.
1481.It Cm SetEnv
1482Directly specify one or more environment variables and their contents to
1483be sent to the server.
1484Similarly to
1485.Cm SendEnv ,
1486the server must be prepared to accept the environment variable.
1487.It Cm StreamLocalBindMask
1488Sets the octal file creation mode mask
1489.Pq umask
1490used when creating a Unix-domain socket file for local or remote
1491port forwarding.
1492This option is only used for port forwarding to a Unix-domain socket file.
1493.Pp
1494The default value is 0177, which creates a Unix-domain socket file that is
1495readable and writable only by the owner.
1496Note that not all operating systems honor the file mode on Unix-domain
1497socket files.
1498.It Cm StreamLocalBindUnlink
1499Specifies whether to remove an existing Unix-domain socket file for local
1500or remote port forwarding before creating a new one.
1501If the socket file already exists and
1502.Cm StreamLocalBindUnlink
1503is not enabled,
1504.Nm ssh
1505will be unable to forward the port to the Unix-domain socket file.
1506This option is only used for port forwarding to a Unix-domain socket file.
1507.Pp
1508The argument must be
1509.Cm yes
1510or
1511.Cm no
1512(the default).
1513.It Cm StrictHostKeyChecking
1514If this flag is set to
1515.Cm yes ,
1516.Xr ssh 1
1517will never automatically add host keys to the
1518.Pa ~/.ssh/known_hosts
1519file, and refuses to connect to hosts whose host key has changed.
1520This provides maximum protection against man-in-the-middle (MITM) attacks,
1521though it can be annoying when the
1522.Pa /etc/ssh/ssh_known_hosts
1523file is poorly maintained or when connections to new hosts are
1524frequently made.
1525This option forces the user to manually
1526add all new hosts.
1527.Pp
1528If this flag is set to
1529.Dq accept-new
1530then ssh will automatically add new host keys to the user
1531known hosts files, but will not permit connections to hosts with
1532changed host keys.
1533If this flag is set to
1534.Dq no
1535or
1536.Dq off ,
1537ssh will automatically add new host keys to the user known hosts files
1538and allow connections to hosts with changed hostkeys to proceed,
1539subject to some restrictions.
1540If this flag is set to
1541.Cm ask
1542(the default),
1543new host keys
1544will be added to the user known host files only after the user
1545has confirmed that is what they really want to do, and
1546ssh will refuse to connect to hosts whose host key has changed.
1547The host keys of
1548known hosts will be verified automatically in all cases.
1549.It Cm SyslogFacility
1550Gives the facility code that is used when logging messages from
1551.Xr ssh 1 .
1552The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1553LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1554The default is USER.
1555.It Cm TCPKeepAlive
1556Specifies whether the system should send TCP keepalive messages to the
1557other side.
1558If they are sent, death of the connection or crash of one
1559of the machines will be properly noticed.
1560However, this means that
1561connections will die if the route is down temporarily, and some people
1562find it annoying.
1563.Pp
1564The default is
1565.Cm yes
1566(to send TCP keepalive messages), and the client will notice
1567if the network goes down or the remote host dies.
1568This is important in scripts, and many users want it too.
1569.Pp
1570To disable TCP keepalive messages, the value should be set to
1571.Cm no .
1572See also
1573.Cm ServerAliveInterval
1574for protocol-level keepalives.
1575.It Cm Tunnel
1576Request
1577.Xr tun 4
1578device forwarding between the client and the server.
1579The argument must be
1580.Cm yes ,
1581.Cm point-to-point
1582(layer 3),
1583.Cm ethernet
1584(layer 2),
1585or
1586.Cm no
1587(the default).
1588Specifying
1589.Cm yes
1590requests the default tunnel mode, which is
1591.Cm point-to-point .
1592.It Cm TunnelDevice
1593Specifies the
1594.Xr tun 4
1595devices to open on the client
1596.Pq Ar local_tun
1597and the server
1598.Pq Ar remote_tun .
1599.Pp
1600The argument must be
1601.Sm off
1602.Ar local_tun Op : Ar remote_tun .
1603.Sm on
1604The devices may be specified by numerical ID or the keyword
1605.Cm any ,
1606which uses the next available tunnel device.
1607If
1608.Ar remote_tun
1609is not specified, it defaults to
1610.Cm any .
1611The default is
1612.Cm any:any .
1613.It Cm UpdateHostKeys
1614Specifies whether
1615.Xr ssh 1
1616should accept notifications of additional hostkeys from the server sent
1617after authentication has completed and add them to
1618.Cm UserKnownHostsFile .
1619The argument must be
1620.Cm yes ,
1621.Cm no
1622(the default) or
1623.Cm ask .
1624Enabling this option allows learning alternate hostkeys for a server
1625and supports graceful key rotation by allowing a server to send replacement
1626public keys before old ones are removed.
1627Additional hostkeys are only accepted if the key used to authenticate the
1628host was already trusted or explicitly accepted by the user.
1629If
1630.Cm UpdateHostKeys
1631is set to
1632.Cm ask ,
1633then the user is asked to confirm the modifications to the known_hosts file.
1634Confirmation is currently incompatible with
1635.Cm ControlPersist ,
1636and will be disabled if it is enabled.
1637.Pp
1638Presently, only
1639.Xr sshd 8
1640from OpenSSH 6.8 and greater support the
1641.Qq hostkeys@openssh.com
1642protocol extension used to inform the client of all the server's hostkeys.
1643.It Cm User
1644Specifies the user to log in as.
1645This can be useful when a different user name is used on different machines.
1646This saves the trouble of
1647having to remember to give the user name on the command line.
1648.It Cm UserKnownHostsFile
1649Specifies one or more files to use for the user
1650host key database, separated by whitespace.
1651The default is
1652.Pa ~/.ssh/known_hosts ,
1653.Pa ~/.ssh/known_hosts2 .
1654.It Cm VerifyHostKeyDNS
1655Specifies whether to verify the remote key using DNS and SSHFP resource
1656records.
1657If this option is set to
1658.Cm yes ,
1659the client will implicitly trust keys that match a secure fingerprint
1660from DNS.
1661Insecure fingerprints will be handled as if this option was set to
1662.Cm ask .
1663If this option is set to
1664.Cm ask ,
1665information on fingerprint match will be displayed, but the user will still
1666need to confirm new host keys according to the
1667.Cm StrictHostKeyChecking
1668option.
1669The default is
1670.Cm no .
1671.Pp
1672See also
1673.Sx VERIFYING HOST KEYS
1674in
1675.Xr ssh 1 .
1676.It Cm VisualHostKey
1677If this flag is set to
1678.Cm yes ,
1679an ASCII art representation of the remote host key fingerprint is
1680printed in addition to the fingerprint string at login and
1681for unknown host keys.
1682If this flag is set to
1683.Cm no
1684(the default),
1685no fingerprint strings are printed at login and
1686only the fingerprint string will be printed for unknown host keys.
1687.It Cm XAuthLocation
1688Specifies the full pathname of the
1689.Xr xauth 1
1690program.
1691The default is
1692.Pa /usr/X11R6/bin/xauth .
1693.El
1694.Sh PATTERNS
1695A
1696.Em pattern
1697consists of zero or more non-whitespace characters,
1698.Sq *
1699(a wildcard that matches zero or more characters),
1700or
1701.Sq ?\&
1702(a wildcard that matches exactly one character).
1703For example, to specify a set of declarations for any host in the
1704.Qq .co.uk
1705set of domains,
1706the following pattern could be used:
1707.Pp
1708.Dl Host *.co.uk
1709.Pp
1710The following pattern
1711would match any host in the 192.168.0.[0-9] network range:
1712.Pp
1713.Dl Host 192.168.0.?
1714.Pp
1715A
1716.Em pattern-list
1717is a comma-separated list of patterns.
1718Patterns within pattern-lists may be negated
1719by preceding them with an exclamation mark
1720.Pq Sq !\& .
1721For example,
1722to allow a key to be used from anywhere within an organization
1723except from the
1724.Qq dialup
1725pool,
1726the following entry (in authorized_keys) could be used:
1727.Pp
1728.Dl from=\&"!*.dialup.example.com,*.example.com\&"
1729.Pp
1730Note that a negated match will never produce a positive result by itself.
1731For example, attempting to match
1732.Qq host3
1733against the following pattern-list will fail:
1734.Pp
1735.Dl from=\&"!host1,!host2\&"
1736.Pp
1737The solution here is to include a term that will yield a positive match,
1738such as a wildcard:
1739.Pp
1740.Dl from=\&"!host1,!host2,*\&"
1741.Sh TOKENS
1742Arguments to some keywords can make use of tokens,
1743which are expanded at runtime:
1744.Pp
1745.Bl -tag -width XXXX -offset indent -compact
1746.It %%
1747A literal
1748.Sq % .
1749.It \&%C
1750Hash of %l%h%p%r.
1751.It %d
1752Local user's home directory.
1753.It %h
1754The remote hostname.
1755.It %i
1756The local user ID.
1757.It %L
1758The local hostname.
1759.It %l
1760The local hostname, including the domain name.
1761.It %n
1762The original remote hostname, as given on the command line.
1763.It %p
1764The remote port.
1765.It %r
1766The remote username.
1767.It \&%T
1768The local
1769.Xr tun 4
1770or
1771.Xr tap 4
1772network interface assigned if
1773tunnel forwarding was requested, or
1774.Qq NONE
1775otherwise.
1776.It %u
1777The local username.
1778.El
1779.Pp
1780.Cm Match exec
1781accepts the tokens %%, %h, %i, %L, %l, %n, %p, %r, and %u.
1782.Pp
1783.Cm CertificateFile
1784accepts the tokens %%, %d, %h, %i, %l, %r, and %u.
1785.Pp
1786.Cm ControlPath
1787accepts the tokens %%, %C, %h, %i, %L, %l, %n, %p, %r, and %u.
1788.Pp
1789.Cm Hostname
1790accepts the tokens %% and %h.
1791.Pp
1792.Cm IdentityAgent
1793and
1794.Cm IdentityFile
1795accept the tokens %%, %d, %h, %i, %l, %r, and %u.
1796.Pp
1797.Cm LocalCommand
1798accepts the tokens %%, %C, %d, %h, %i, %l, %n, %p, %r, %T, and %u.
1799.Pp
1800.Cm ProxyCommand
1801accepts the tokens %%, %h, %p, and %r.
1802.Pp
1803.Cm RemoteCommand
1804accepts the tokens %%, %C, %d, %h, %i, %l, %n, %p, %r, and %u.
1805.Sh FILES
1806.Bl -tag -width Ds
1807.It Pa ~/.ssh/config
1808This is the per-user configuration file.
1809The format of this file is described above.
1810This file is used by the SSH client.
1811Because of the potential for abuse, this file must have strict permissions:
1812read/write for the user, and not writable by others.
1813.It Pa /etc/ssh/ssh_config
1814Systemwide configuration file.
1815This file provides defaults for those
1816values that are not specified in the user's configuration file, and
1817for those users who do not have a configuration file.
1818This file must be world-readable.
1819.El
1820.Sh SEE ALSO
1821.Xr ssh 1
1822.Sh AUTHORS
1823.An -nosplit
1824OpenSSH is a derivative of the original and free
1825ssh 1.2.12 release by
1826.An Tatu Ylonen .
1827.An Aaron Campbell , Bob Beck , Markus Friedl ,
1828.An Niels Provos , Theo de Raadt
1829and
1830.An Dug Song
1831removed many bugs, re-added newer features and
1832created OpenSSH.
1833.An Markus Friedl
1834contributed the support for SSH protocol versions 1.5 and 2.0.
1835