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