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