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