blob: f499396a37411c909ffbc3543e95922cbbe726ec [file] [log] [blame]
Ben Lindstrom9f049032002-06-21 00:59:05 +00001.\"
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.\"
kn@openbsd.orgddf1b792018-07-23 19:02:49 +000036.\" $OpenBSD: ssh_config.5,v 1.281 2018/07/23 19:02:49 kn Exp $
37.Dd $Mdocdate: July 23 2018 $
Ben Lindstrom9f049032002-06-21 00:59:05 +000038.Dt SSH_CONFIG 5
39.Os
40.Sh NAME
41.Nm ssh_config
42.Nd OpenSSH SSH client configuration files
Ben Lindstrom9f049032002-06-21 00:59:05 +000043.Sh DESCRIPTION
Damien Miller45ee2b92006-03-15 11:56:18 +110044.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +000045obtains configuration data from the following sources in
46the following order:
Damien Miller5c853b52006-03-15 11:37:02 +110047.Pp
Ben Lindstrom479b4762002-08-20 19:04:51 +000048.Bl -enum -offset indent -compact
49.It
50command-line options
51.It
52user's configuration file
Damien Miller167ea5d2005-05-26 12:04:02 +100053.Pq Pa ~/.ssh/config
Ben Lindstrom479b4762002-08-20 19:04:51 +000054.It
55system-wide configuration file
56.Pq Pa /etc/ssh/ssh_config
57.El
Ben Lindstrom9f049032002-06-21 00:59:05 +000058.Pp
59For each parameter, the first obtained value
60will be used.
Darren Tucker43d8e282005-02-09 09:51:08 +110061The configuration files contain sections separated by
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +000062.Cm Host
Ben Lindstrom9f049032002-06-21 00:59:05 +000063specifications, and that section is only applied for hosts that
64match one of the patterns given in the specification.
djm@openbsd.org957fbce2014-10-08 22:20:25 +000065The matched host name is usually the one given on the command line
66(see the
67.Cm CanonicalizeHostname
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +000068option for exceptions).
Ben Lindstrom9f049032002-06-21 00:59:05 +000069.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
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +000074The file contains keyword-argument pairs, one per line.
75Lines starting with
Ben Lindstrom9f049032002-06-21 00:59:05 +000076.Ql #
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +000077and empty lines are interpreted as comments.
78Arguments may optionally be enclosed in double quotes
79.Pq \&"
80in order to represent arguments containing spaces.
Ben Lindstrom9f049032002-06-21 00:59:05 +000081Configuration 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 ,
Damien Miller4aea9742006-03-15 11:59:39 +110087.Nm scp ,
Ben Lindstrom9f049032002-06-21 00:59:05 +000088and
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
Damien Miller194fd902013-10-15 12:13:05 +1100100or
101.Cm Match
Ben Lindstrom9f049032002-06-21 00:59:05 +0000102keyword) to be only for those hosts that match one of the patterns
103given after the keyword.
Damien Millerfa51b162008-11-03 19:17:33 +1100104If more than one pattern is provided, they should be separated by whitespace.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000105A single
Damien Miller208f1ed2006-03-15 11:56:03 +1100106.Ql *
Ben Lindstrom9f049032002-06-21 00:59:05 +0000107as a pattern can be used to provide global
108defaults for all hosts.
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000109The host is usually the
Ben Lindstrom9f049032002-06-21 00:59:05 +0000110.Ar hostname
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000111argument given on the command line
112(see the
113.Cm CanonicalizeHostname
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000114keyword for exceptions).
Damien Millerf54a4b92006-03-15 11:54:36 +1100115.Pp
Damien Millerfe924212011-05-15 08:44:45 +1000116A 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
Damien Millerf54a4b92006-03-15 11:54:36 +1100125See
126.Sx PATTERNS
127for more information on patterns.
Damien Millerd77b81f2013-10-17 11:39:00 +1100128.It Cm Match
Damien Miller194fd902013-10-15 12:13:05 +1100129Restricts 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.
sobrado@openbsd.orge3cbb062015-09-22 08:33:23 +0000136Match conditions are specified using one or more criteria
Damien Millercf31f382013-10-24 21:02:56 +1100137or the single token
138.Cm all
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000139which always matches.
140The available criteria keywords are:
141.Cm canonical ,
Damien Miller8a04be72013-10-23 16:29:40 +1100142.Cm exec ,
Damien Miller194fd902013-10-15 12:13:05 +1100143.Cm host ,
144.Cm originalhost ,
145.Cm user ,
146and
147.Cm localuser .
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000148The
149.Cm all
150criteria must appear alone or immediately after
jmc@openbsd.orgb1ba15f2014-10-09 06:21:31 +0000151.Cm canonical .
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000152Other 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 !\& .
Damien Miller194fd902013-10-15 12:13:05 +1100160.Pp
Damien Miller8e5a67f2013-10-23 16:30:25 +1100161The
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000162.Cm canonical
dtucker@openbsd.orgdd2cfeb2015-05-28 05:09:45 +0000163keyword matches only when the configuration file is being re-parsed
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000164after hostname canonicalization (see the
165.Cm CanonicalizeHostname
166option.)
167This may be useful to specify conditions that work with canonical host
168names only.
169The
Damien Miller8a04be72013-10-23 16:29:40 +1100170.Cm exec
Damien Miller8e5a67f2013-10-23 16:30:25 +1100171keyword executes the specified command under the user's shell.
Damien Miller194fd902013-10-15 12:13:05 +1100172If the command returns a zero exit status then the condition is considered true.
173Commands containing whitespace characters must be quoted.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000174Arguments to
175.Cm exec
176accept the tokens described in the
177.Sx TOKENS
178section.
Damien Miller194fd902013-10-15 12:13:05 +1100179.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
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000189or
190.Cm CanonicalizeHostname
191options.
Damien Miller194fd902013-10-15 12:13:05 +1100192The
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).
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000205.It Cm AddKeysToAgent
206Specifies whether keys should be automatically added to a running
jmc@openbsd.orge41a0712015-11-15 23:58:04 +0000207.Xr ssh-agent 1 .
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000208If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000209.Cm yes
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000210and 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
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000214.Cm ask ,
215.Xr ssh 1
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000216will 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
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000222.Cm confirm ,
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000223each 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
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000228.Cm no ,
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000229no keys are added to the agent.
230The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000231.Cm yes ,
232.Cm confirm ,
233.Cm ask ,
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000234or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000235.Cm no
236(the default).
Damien Miller20a8f972003-05-18 20:50:30 +1000237.It Cm AddressFamily
Damien Millerfbf486b2003-05-23 18:44:23 +1000238Specifies which address family to use when connecting.
239Valid arguments are
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000240.Cm any
241(the default),
242.Cm inet
Damien Miller45ee2b92006-03-15 11:56:18 +1100243(use IPv4 only), or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000244.Cm inet6
Darren Tucker79a7acf2005-02-09 09:48:57 +1100245(use IPv6 only).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000246.It Cm BatchMode
247If set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000248.Cm yes ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000249passphrase/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
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000253.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000254or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000255.Cm no
256(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000257.It Cm BindAddress
Darren Tucker89f4d472005-07-14 17:06:21 +1000258Use the specified address on the local machine as the source address of
Darren Tucker6c71d202005-07-14 17:06:50 +1000259the connection.
260Only useful on systems with more than one address.
jmc@openbsd.org7d330a12018-02-23 07:38:09 +0000261.It Cm BindInterface
262Use the address of the specified interface on the local machine as the
263source address of the connection.
Damien Miller0faf7472013-10-17 11:47:23 +1100264.It Cm CanonicalDomains
Damien Miller607af342013-10-17 11:47:51 +1100265When
Damien Miller38505592013-10-17 11:48:13 +1100266.Cm CanonicalizeHostname
Damien Miller0faf7472013-10-17 11:47:23 +1100267is enabled, this option specifies the list of domain suffixes in which to
268search for the specified destination host.
Damien Miller38505592013-10-17 11:48:13 +1100269.It Cm CanonicalizeFallbackLocal
Damien Miller51682fa2013-10-17 11:48:31 +1100270Specifies whether to fail with an error when hostname canonicalization fails.
Damien Miller607af342013-10-17 11:47:51 +1100271The default,
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000272.Cm yes ,
Damien Miller607af342013-10-17 11:47:51 +1100273will attempt to look up the unqualified hostname using the system resolver's
Damien Miller0faf7472013-10-17 11:47:23 +1100274search rules.
275A value of
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000276.Cm no
Damien Miller0faf7472013-10-17 11:47:23 +1100277will cause
278.Xr ssh 1
279to fail instantly if
Damien Miller38505592013-10-17 11:48:13 +1100280.Cm CanonicalizeHostname
Damien Miller0faf7472013-10-17 11:47:23 +1100281is enabled and the target hostname cannot be found in any of the domains
282specified by
283.Cm CanonicalDomains .
Damien Miller38505592013-10-17 11:48:13 +1100284.It Cm CanonicalizeHostname
Damien Miller51682fa2013-10-17 11:48:31 +1100285Controls whether explicit hostname canonicalization is performed.
Damien Miller607af342013-10-17 11:47:51 +1100286The default,
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000287.Cm no ,
Damien Miller0faf7472013-10-17 11:47:23 +1100288is not to perform any name rewriting and let the system resolver handle all
289hostname lookups.
290If set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000291.Cm yes
Damien Miller0faf7472013-10-17 11:47:23 +1100292then, for connections that do not use a
293.Cm ProxyCommand ,
294.Xr ssh 1
Damien Miller38505592013-10-17 11:48:13 +1100295will attempt to canonicalize the hostname specified on the command line
Damien Miller0faf7472013-10-17 11:47:23 +1100296using the
297.Cm CanonicalDomains
298suffixes and
Damien Miller38505592013-10-17 11:48:13 +1100299.Cm CanonicalizePermittedCNAMEs
Damien Miller0faf7472013-10-17 11:47:23 +1100300rules.
301If
Damien Miller38505592013-10-17 11:48:13 +1100302.Cm CanonicalizeHostname
Damien Miller0faf7472013-10-17 11:47:23 +1100303is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000304.Cm always ,
Damien Miller51682fa2013-10-17 11:48:31 +1100305then canonicalization is applied to proxied connections too.
Damien Miller13f97b22014-02-24 15:57:55 +1100306.Pp
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000307If this option is enabled, then the configuration files are processed
308again using the new target name to pick up any new configuration in matching
Damien Miller13f97b22014-02-24 15:57:55 +1100309.Cm Host
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000310and
311.Cm Match
Damien Miller13f97b22014-02-24 15:57:55 +1100312stanzas.
Damien Miller38505592013-10-17 11:48:13 +1100313.It Cm CanonicalizeMaxDots
Damien Miller607af342013-10-17 11:47:51 +1100314Specifies the maximum number of dot characters in a hostname before
Damien Miller51682fa2013-10-17 11:48:31 +1100315canonicalization is disabled.
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000316The default, 1,
Damien Miller607af342013-10-17 11:47:51 +1100317allows a single dot (i.e. hostname.subdomain).
Damien Miller38505592013-10-17 11:48:13 +1100318.It Cm CanonicalizePermittedCNAMEs
Damien Miller607af342013-10-17 11:47:51 +1100319Specifies rules to determine whether CNAMEs should be followed when
Damien Miller38505592013-10-17 11:48:13 +1100320canonicalizing hostnames.
Damien Miller0faf7472013-10-17 11:47:23 +1100321The rules consist of one or more arguments of
Damien Miller607af342013-10-17 11:47:51 +1100322.Ar source_domain_list : Ns Ar target_domain_list ,
Damien Miller0faf7472013-10-17 11:47:23 +1100323where
324.Ar source_domain_list
Damien Miller51682fa2013-10-17 11:48:31 +1100325is a pattern-list of domains that may follow CNAMEs in canonicalization,
Damien Miller0faf7472013-10-17 11:47:23 +1100326and
327.Ar target_domain_list
Damien Miller607af342013-10-17 11:47:51 +1100328is a pattern-list of domains that they may resolve to.
Damien Miller0faf7472013-10-17 11:47:23 +1100329.Pp
330For example,
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000331.Qq *.a.example.com:*.b.example.com,*.c.example.com
Damien Miller0faf7472013-10-17 11:47:23 +1100332will allow hostnames matching
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000333.Qq *.a.example.com
Damien Miller38505592013-10-17 11:48:13 +1100334to be canonicalized to names in the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000335.Qq *.b.example.com
Damien Miller0faf7472013-10-17 11:47:23 +1100336or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000337.Qq *.c.example.com
Damien Miller0faf7472013-10-17 11:47:23 +1100338domains.
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000339.It Cm CertificateFile
340Specifies a file from which the user's certificate is read.
341A corresponding private key must be provided separately in order
342to use this certificate either
343from an
344.Cm IdentityFile
345directive or
346.Fl i
347flag to
348.Xr ssh 1 ,
349via
350.Xr ssh-agent 1 ,
351or via a
352.Cm PKCS11Provider .
353.Pp
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000354Arguments to
355.Cm CertificateFile
356may use the tilde syntax to refer to a user's home directory
357or the tokens described in the
358.Sx TOKENS
359section.
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000360.Pp
361It is possible to have multiple certificate files specified in
362configuration files; these certificates will be tried in sequence.
363Multiple
364.Cm CertificateFile
365directives will add to the list of certificates used for
366authentication.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000367.It Cm ChallengeResponseAuthentication
Damien Miller1faa7132006-03-15 11:55:31 +1100368Specifies whether to use challenge-response authentication.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000369The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000370.Cm yes
371(the default)
Ben Lindstrom9f049032002-06-21 00:59:05 +0000372or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000373.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000374.It Cm CheckHostIP
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000375If set to
376.Cm yes
377(the default),
Damien Miller45ee2b92006-03-15 11:56:18 +1100378.Xr ssh 1
379will additionally check the host IP address in the
Ben Lindstrom9f049032002-06-21 00:59:05 +0000380.Pa known_hosts
381file.
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000382This allows it to detect if a host key changed due to DNS spoofing
djm@openbsd.org5e678592015-06-02 09:10:40 +0000383and will add addresses of destination hosts to
384.Pa ~/.ssh/known_hosts
385in the process, regardless of the setting of
386.Cm StrictHostKeyChecking .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000387If the option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000388.Cm no ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000389the check will not be executed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000390.It Cm Ciphers
djm@openbsd.org788ac792017-04-30 23:18:22 +0000391Specifies the ciphers allowed and their order of preference.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000392Multiple ciphers must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000393If the specified value begins with a
394.Sq +
395character, then the specified ciphers will be appended to the default set
396instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000397If the specified value begins with a
398.Sq -
399character, then the specified ciphers (including wildcards) will be removed
400from the default set instead of replacing them.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000401.Pp
Damien Miller0fde8ac2013-11-21 14:12:23 +1100402The supported ciphers are:
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000403.Bd -literal -offset indent
Damien Millerc1621c82014-04-20 13:22:46 +10004043des-cbc
Damien Millerc1621c82014-04-20 13:22:46 +1000405aes128-cbc
Damien Millerc1621c82014-04-20 13:22:46 +1000406aes192-cbc
Damien Millerc1621c82014-04-20 13:22:46 +1000407aes256-cbc
Damien Millerc1621c82014-04-20 13:22:46 +1000408aes128-ctr
Damien Millerc1621c82014-04-20 13:22:46 +1000409aes192-ctr
Damien Millerc1621c82014-04-20 13:22:46 +1000410aes256-ctr
Damien Millerc1621c82014-04-20 13:22:46 +1000411aes128-gcm@openssh.com
Damien Millerc1621c82014-04-20 13:22:46 +1000412aes256-gcm@openssh.com
Damien Millerc1621c82014-04-20 13:22:46 +1000413chacha20-poly1305@openssh.com
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000414.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100415.Pp
Damien Miller45ee2b92006-03-15 11:56:18 +1100416The default is:
Damien Millerc1621c82014-04-20 13:22:46 +1000417.Bd -literal -offset indent
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000418chacha20-poly1305@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000419aes128-ctr,aes192-ctr,aes256-ctr,
djm@openbsd.org00c52222018-04-05 22:54:28 +0000420aes128-gcm@openssh.com,aes256-gcm@openssh.com
Ben Lindstrom9f049032002-06-21 00:59:05 +0000421.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100422.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000423The list of available ciphers may also be obtained using
424.Qq ssh -Q cipher .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000425.It Cm ClearAllForwardings
Damien Miller45ee2b92006-03-15 11:56:18 +1100426Specifies that all local, remote, and dynamic port forwardings
Ben Lindstrom9f049032002-06-21 00:59:05 +0000427specified in the configuration files or on the command line be
Damien Miller495dca32003-04-01 21:42:14 +1000428cleared.
429This option is primarily useful when used from the
Damien Miller45ee2b92006-03-15 11:56:18 +1100430.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000431command line to clear port forwardings set in
432configuration files, and is automatically set by
433.Xr scp 1
434and
435.Xr sftp 1 .
436The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000437.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000438or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000439.Cm no
440(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000441.It Cm Compression
442Specifies whether to use compression.
443The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000444.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000445or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000446.Cm no
447(the default).
naddy@openbsd.org9a82e242017-05-03 21:49:18 +0000448.It Cm ConnectionAttempts
449Specifies the number of tries (one per second) to make before exiting.
450The argument must be an integer.
451This may be useful in scripts if the connection sometimes fails.
452The default is 1.
Damien Millerb78d5eb2003-05-16 11:39:04 +1000453.It Cm ConnectTimeout
Damien Miller45ee2b92006-03-15 11:56:18 +1100454Specifies the timeout (in seconds) used when connecting to the
455SSH server, instead of using the default system TCP timeout.
Damien Millerfbf486b2003-05-23 18:44:23 +1000456This value is used only when the target is down or really unreachable,
457not when it refuses the connection.
Damien Miller0e220db2004-06-15 10:34:08 +1000458.It Cm ControlMaster
459Enables the sharing of multiple sessions over a single network connection.
460When set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000461.Cm yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +1100462.Xr ssh 1
Damien Miller0e220db2004-06-15 10:34:08 +1000463will listen for connections on a control socket specified using the
464.Cm ControlPath
465argument.
466Additional sessions can connect to this socket using the same
467.Cm ControlPath
468with
469.Cm ControlMaster
470set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000471.Cm no
Damien Miller2234bac2004-06-30 22:38:52 +1000472(the default).
Damien Miller713de762005-11-05 15:13:49 +1100473These sessions will try to reuse the master instance's network connection
Damien Millerb3bfbb72005-11-05 15:11:48 +1100474rather than initiating new ones, but will fall back to connecting normally
475if the control socket does not exist, or is not listening.
476.Pp
Damien Miller23f07702004-06-18 01:19:03 +1000477Setting this to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000478.Cm ask
479will cause
480.Xr ssh 1
jmc@openbsd.org78de1672015-03-30 18:28:37 +0000481to listen for control connections, but require confirmation using
482.Xr ssh-askpass 1 .
Damien Millerdadfd4d2005-05-26 12:07:13 +1000483If the
484.Cm ControlPath
Damien Miller45ee2b92006-03-15 11:56:18 +1100485cannot be opened,
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000486.Xr ssh 1
487will continue without connecting to a master instance.
Damien Millerd14b1e72005-06-16 13:19:41 +1000488.Pp
Damien Miller13390022005-07-06 09:44:19 +1000489X11 and
Damien Millerfd94fba2005-07-06 09:44:59 +1000490.Xr ssh-agent 1
Damien Miller13390022005-07-06 09:44:19 +1000491forwarding is supported over these multiplexed connections, however the
Darren Tucker63551872005-12-20 16:14:15 +1100492display and agent forwarded will be the one belonging to the master
Damien Millerfd94fba2005-07-06 09:44:59 +1000493connection i.e. it is not possible to forward multiple displays or agents.
Damien Miller13390022005-07-06 09:44:19 +1000494.Pp
Damien Millerd14b1e72005-06-16 13:19:41 +1000495Two additional options allow for opportunistic multiplexing: try to use a
496master connection but fall back to creating a new one if one does not already
497exist.
498These options are:
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000499.Cm auto
Damien Millerd14b1e72005-06-16 13:19:41 +1000500and
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000501.Cm autoask .
Damien Millerd14b1e72005-06-16 13:19:41 +1000502The latter requires confirmation like the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000503.Cm ask
Damien Millerd14b1e72005-06-16 13:19:41 +1000504option.
Damien Miller0e220db2004-06-15 10:34:08 +1000505.It Cm ControlPath
Damien Miller6476cad2005-06-16 13:18:34 +1000506Specify the path to the control socket used for connection sharing as described
507in the
Damien Miller0e220db2004-06-15 10:34:08 +1000508.Cm ControlMaster
Damien Miller8f74c8f2005-06-26 08:56:03 +1000509section above or the string
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000510.Cm none
Damien Miller8f74c8f2005-06-26 08:56:03 +1000511to disable connection sharing.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000512Arguments to
513.Cm ControlPath
514may use the tilde syntax to refer to a user's home directory
515or the tokens described in the
516.Sx TOKENS
517section.
Damien Millerd14b1e72005-06-16 13:19:41 +1000518It is recommended that any
519.Cm ControlPath
520used for opportunistic connection sharing include
djm@openbsd.orgfc302562014-11-10 22:25:49 +0000521at least %h, %p, and %r (or alternatively %C) and be placed in a directory
522that is not writable by other users.
Damien Millerd14b1e72005-06-16 13:19:41 +1000523This ensures that shared connections are uniquely identified.
Damien Millere11e1ea2010-08-03 16:04:46 +1000524.It Cm ControlPersist
525When used in conjunction with
526.Cm ControlMaster ,
527specifies that the master connection should remain open
528in the background (waiting for future client connections)
529after the initial client connection has been closed.
530If set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000531.Cm no ,
Damien Millere11e1ea2010-08-03 16:04:46 +1000532then the master connection will not be placed into the background,
533and will close as soon as the initial client connection is closed.
534If set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000535.Cm yes
536or 0,
Damien Millere11e1ea2010-08-03 16:04:46 +1000537then the master connection will remain in the background indefinitely
538(until killed or closed via a mechanism such as the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000539.Qq ssh -O exit ) .
Damien Millere11e1ea2010-08-03 16:04:46 +1000540If set to a time in seconds, or a time in any of the formats documented in
541.Xr sshd_config 5 ,
542then the backgrounded master connection will automatically terminate
543after it has remained idle (with no client connections) for the
544specified time.
Damien Miller2234bac2004-06-30 22:38:52 +1000545.It Cm DynamicForward
Damien Millere9d001e2006-01-14 10:10:17 +1100546Specifies that a TCP port on the local machine be forwarded
Damien Miller2234bac2004-06-30 22:38:52 +1000547over the secure channel, and the application
548protocol is then used to determine where to connect to from the
549remote machine.
Darren Tuckerc8d64212005-10-03 18:13:42 +1000550.Pp
551The argument must be
552.Sm off
553.Oo Ar bind_address : Oc Ar port .
554.Sm on
Damien Miller7fa96602010-08-05 13:03:13 +1000555IPv6 addresses can be specified by enclosing addresses in square brackets.
Darren Tuckerc8d64212005-10-03 18:13:42 +1000556By default, the local port is bound in accordance with the
557.Cm GatewayPorts
558setting.
559However, an explicit
560.Ar bind_address
561may be used to bind the connection to a specific address.
562The
563.Ar bind_address
564of
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000565.Cm localhost
Darren Tuckerc8d64212005-10-03 18:13:42 +1000566indicates that the listening port be bound for local use only, while an
567empty address or
568.Sq *
569indicates that the port should be available from all interfaces.
570.Pp
Damien Miller2234bac2004-06-30 22:38:52 +1000571Currently the SOCKS4 and SOCKS5 protocols are supported, and
Damien Miller45ee2b92006-03-15 11:56:18 +1100572.Xr ssh 1
Damien Miller2234bac2004-06-30 22:38:52 +1000573will act as a SOCKS server.
574Multiple forwardings may be specified, and
575additional forwardings can be given on the command line.
576Only the superuser can forward privileged ports.
Darren Tucker674f71d2003-06-28 12:33:12 +1000577.It Cm EnableSSHKeysign
578Setting this option to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000579.Cm yes
Darren Tucker674f71d2003-06-28 12:33:12 +1000580in the global client configuration file
581.Pa /etc/ssh/ssh_config
582enables the use of the helper program
583.Xr ssh-keysign 8
584during
585.Cm HostbasedAuthentication .
586The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000587.Cm yes
Darren Tucker674f71d2003-06-28 12:33:12 +1000588or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000589.Cm no
590(the default).
Darren Tuckerf132c672003-10-15 15:58:18 +1000591This option should be placed in the non-hostspecific section.
Darren Tucker674f71d2003-06-28 12:33:12 +1000592See
593.Xr ssh-keysign 8
594for more information.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000595.It Cm EscapeChar
596Sets the escape character (default:
597.Ql ~ ) .
598The escape character can also
599be set on the command line.
600The argument should be a single character,
601.Ql ^
602followed by a letter, or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000603.Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +0000604to disable the escape
605character entirely (making the connection transparent for binary
606data).
Darren Tuckere7d4b192006-07-12 22:17:10 +1000607.It Cm ExitOnForwardFailure
608Specifies whether
609.Xr ssh 1
610should terminate the connection if it cannot set up all requested
djm@openbsd.orga954cdb2015-09-04 04:47:50 +0000611dynamic, tunnel, local, and remote port forwardings, (e.g.\&
jmc@openbsd.org5245bc12015-09-04 06:40:45 +0000612if either end is unable to bind and listen on a specified port).
djm@openbsd.orga954cdb2015-09-04 04:47:50 +0000613Note that
614.Cm ExitOnForwardFailure
615does not apply to connections made over port forwardings and will not,
616for example, cause
617.Xr ssh 1
618to exit if TCP connections to the ultimate forwarding destination fail.
Darren Tuckere7d4b192006-07-12 22:17:10 +1000619The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000620.Cm yes
Darren Tuckere7d4b192006-07-12 22:17:10 +1000621or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000622.Cm no
623(the default).
djm@openbsd.orgb79efde2014-12-21 23:12:42 +0000624.It Cm FingerprintHash
625Specifies the hash algorithm used when displaying key fingerprints.
626Valid options are:
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000627.Cm md5
djm@openbsd.orgb79efde2014-12-21 23:12:42 +0000628and
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000629.Cm sha256
630(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000631.It Cm ForwardAgent
632Specifies whether the connection to the authentication agent (if any)
633will be forwarded to the remote machine.
634The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000635.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000636or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000637.Cm no
638(the default).
Damien Milleraf653042002-09-04 16:40:37 +1000639.Pp
Damien Miller495dca32003-04-01 21:42:14 +1000640Agent forwarding should be enabled with caution.
641Users with the ability to bypass file permissions on the remote host
642(for the agent's Unix-domain socket)
643can access the local agent through the forwarded connection.
644An attacker cannot obtain key material from the agent,
Damien Milleraf653042002-09-04 16:40:37 +1000645however they can perform operations on the keys that enable them to
646authenticate using the identities loaded into the agent.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000647.It Cm ForwardX11
648Specifies whether X11 connections will be automatically redirected
649over the secure channel and
650.Ev DISPLAY
651set.
652The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000653.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000654or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000655.Cm no
656(the default).
Damien Milleraf653042002-09-04 16:40:37 +1000657.Pp
Damien Miller495dca32003-04-01 21:42:14 +1000658X11 forwarding should be enabled with caution.
659Users with the ability to bypass file permissions on the remote host
Darren Tucker0a118da2003-10-15 15:54:32 +1000660(for the user's X11 authorization database)
Damien Miller495dca32003-04-01 21:42:14 +1000661can access the local X11 display through the forwarded connection.
Darren Tucker0a118da2003-10-15 15:54:32 +1000662An attacker may then be able to perform activities such as keystroke monitoring
663if the
664.Cm ForwardX11Trusted
665option is also enabled.
Damien Miller1ab6a512010-06-26 10:02:24 +1000666.It Cm ForwardX11Timeout
Damien Millercede1db2010-07-02 13:33:48 +1000667Specify a timeout for untrusted X11 forwarding
668using the format described in the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000669.Sx TIME FORMATS
670section of
Damien Miller1ab6a512010-06-26 10:02:24 +1000671.Xr sshd_config 5 .
672X11 connections received by
673.Xr ssh 1
674after this time will be refused.
675The default is to disable untrusted X11 forwarding after twenty minutes has
676elapsed.
Darren Tucker0a118da2003-10-15 15:54:32 +1000677.It Cm ForwardX11Trusted
Darren Tuckerdcf6ec42004-05-13 13:03:56 +1000678If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000679.Cm yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +1100680remote X11 clients will have full access to the original X11 display.
Damien Miller1717fd42005-03-01 21:17:31 +1100681.Pp
Darren Tucker0a118da2003-10-15 15:54:32 +1000682If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000683.Cm no
684(the default),
Damien Miller45ee2b92006-03-15 11:56:18 +1100685remote X11 clients will be considered untrusted and prevented
Darren Tucker0a118da2003-10-15 15:54:32 +1000686from stealing or tampering with data belonging to trusted X11
687clients.
Damien Miller1717fd42005-03-01 21:17:31 +1100688Furthermore, the
689.Xr xauth 1
690token used for the session will be set to expire after 20 minutes.
691Remote clients will be refused access after this time.
Darren Tucker0a118da2003-10-15 15:54:32 +1000692.Pp
Darren Tucker0a118da2003-10-15 15:54:32 +1000693See the X11 SECURITY extension specification for full details on
694the restrictions imposed on untrusted clients.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000695.It Cm GatewayPorts
696Specifies whether remote hosts are allowed to connect to local
697forwarded ports.
698By default,
Damien Miller45ee2b92006-03-15 11:56:18 +1100699.Xr ssh 1
Damien Miller495dca32003-04-01 21:42:14 +1000700binds local port forwardings to the loopback address.
701This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000702.Cm GatewayPorts
Damien Miller45ee2b92006-03-15 11:56:18 +1100703can be used to specify that ssh
Ben Lindstrom9f049032002-06-21 00:59:05 +0000704should bind local port forwardings to the wildcard address,
705thus allowing remote hosts to connect to forwarded ports.
706The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000707.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000708or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000709.Cm no
710(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000711.It Cm GlobalKnownHostsFile
Damien Miller295ee632011-05-29 21:42:31 +1000712Specifies one or more files to use for the global
713host key database, separated by whitespace.
714The default is
715.Pa /etc/ssh/ssh_known_hosts ,
716.Pa /etc/ssh/ssh_known_hosts2 .
Darren Tucker0efd1552003-08-26 11:49:55 +1000717.It Cm GSSAPIAuthentication
Damien Millerbaafb982003-12-17 16:32:23 +1100718Specifies whether user authentication based on GSSAPI is allowed.
Damien Millerc2b98272003-09-03 12:13:30 +1000719The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000720.Cm no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000721.It Cm GSSAPIDelegateCredentials
722Forward (delegate) credentials to the server.
723The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000724.Cm no .
Damien Millere1776152005-03-01 21:47:37 +1100725.It Cm HashKnownHosts
726Indicates that
Damien Miller45ee2b92006-03-15 11:56:18 +1100727.Xr ssh 1
Damien Millere1776152005-03-01 21:47:37 +1100728should hash host names and addresses when they are added to
Damien Miller167ea5d2005-05-26 12:04:02 +1000729.Pa ~/.ssh/known_hosts .
Damien Millere1776152005-03-01 21:47:37 +1100730These hashed names may be used normally by
Damien Miller45ee2b92006-03-15 11:56:18 +1100731.Xr ssh 1
Damien Millere1776152005-03-01 21:47:37 +1100732and
Damien Miller45ee2b92006-03-15 11:56:18 +1100733.Xr sshd 8 ,
Damien Millere1776152005-03-01 21:47:37 +1100734but they do not reveal identifying information should the file's contents
735be disclosed.
736The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000737.Cm no .
Damien Miller858bb7d2006-08-05 11:34:51 +1000738Note that existing names and addresses in known hosts files
739will not be converted automatically,
740but may be manually hashed using
Damien Miller4b42d7f2005-03-01 21:48:35 +1100741.Xr ssh-keygen 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000742.It Cm HostbasedAuthentication
743Specifies whether to try rhosts based authentication with public key
744authentication.
745The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000746.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000747or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000748.Cm no
749(the default).
djm@openbsd.org46347ed2015-01-30 11:43:14 +0000750.It Cm HostbasedKeyTypes
751Specifies the key types that will be used for hostbased authentication
djm@openbsd.org312d2f22018-07-04 13:49:31 +0000752as a comma-separated list of patterns.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000753Alternately if the specified value begins with a
754.Sq +
755character, then the specified key types will be appended to the default set
756instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000757If the specified value begins with a
758.Sq -
759character, then the specified key types (including wildcards) will be removed
760from the default set instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000761The default for this option is:
762.Bd -literal -offset 3n
763ecdsa-sha2-nistp256-cert-v01@openssh.com,
764ecdsa-sha2-nistp384-cert-v01@openssh.com,
765ecdsa-sha2-nistp521-cert-v01@openssh.com,
766ssh-ed25519-cert-v01@openssh.com,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +0000767rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000768ssh-rsa-cert-v01@openssh.com,
769ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +0000770ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000771.Ed
772.Pp
djm@openbsd.org46347ed2015-01-30 11:43:14 +0000773The
774.Fl Q
775option of
776.Xr ssh 1
777may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000778.It Cm HostKeyAlgorithms
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000779Specifies the host key algorithms
Ben Lindstrom9f049032002-06-21 00:59:05 +0000780that the client wants to use in order of preference.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000781Alternately if the specified value begins with a
782.Sq +
783character, then the specified key types will be appended to the default set
784instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000785If the specified value begins with a
786.Sq -
787character, then the specified key types (including wildcards) will be removed
788from the default set instead of replacing them.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000789The default for this option is:
Damien Millereb8b60e2010-08-31 22:41:14 +1000790.Bd -literal -offset 3n
791ecdsa-sha2-nistp256-cert-v01@openssh.com,
792ecdsa-sha2-nistp384-cert-v01@openssh.com,
793ecdsa-sha2-nistp521-cert-v01@openssh.com,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100794ssh-ed25519-cert-v01@openssh.com,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +0000795rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000796ssh-rsa-cert-v01@openssh.com,
Damien Millereb8b60e2010-08-31 22:41:14 +1000797ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +0000798ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
Damien Millereb8b60e2010-08-31 22:41:14 +1000799.Ed
Damien Millerd925dcd2010-12-01 12:21:51 +1100800.Pp
801If hostkeys are known for the destination host then this default is modified
802to prefer their algorithms.
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000803.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000804The list of available key types may also be obtained using
805.Qq ssh -Q key .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000806.It Cm HostKeyAlias
807Specifies an alias that should be used instead of the
808real host name when looking up or saving the host key
djm@openbsd.org6f8ca3b2017-06-24 05:35:05 +0000809in the host key database files and when validating host certificates.
Damien Miller45ee2b92006-03-15 11:56:18 +1100810This option is useful for tunneling SSH connections
Ben Lindstrom9f049032002-06-21 00:59:05 +0000811or for multiple servers running on a single host.
812.It Cm HostName
813Specifies the real host name to log into.
814This can be used to specify nicknames or abbreviations for hosts.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000815Arguments to
816.Cm HostName
817accept the tokens described in the
818.Sx TOKENS
819section.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000820Numeric IP addresses are also permitted (both on the command line and in
821.Cm HostName
822specifications).
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000823The default is the name given on the command line.
Damien Millerbd394c32004-03-08 23:12:36 +1100824.It Cm IdentitiesOnly
825Specifies that
Damien Miller45ee2b92006-03-15 11:56:18 +1100826.Xr ssh 1
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000827should only use the authentication identity and certificate files explicitly
828configured in the
Damien Miller1a812582004-04-20 20:13:32 +1000829.Nm
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000830files
831or passed on the
832.Xr ssh 1
833command-line,
Damien Miller45ee2b92006-03-15 11:56:18 +1100834even if
835.Xr ssh-agent 1
Damien Millercb6b68b2012-12-03 09:49:52 +1100836or a
837.Cm PKCS11Provider
Damien Millerbd394c32004-03-08 23:12:36 +1100838offers more identities.
839The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000840.Cm yes
Damien Millerbd394c32004-03-08 23:12:36 +1100841or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000842.Cm no
843(the default).
Damien Miller45ee2b92006-03-15 11:56:18 +1100844This option is intended for situations where ssh-agent
Damien Millerbd394c32004-03-08 23:12:36 +1100845offers many different identities.
markus@openbsd.orgb02ad1c2016-05-04 12:21:53 +0000846.It Cm IdentityAgent
847Specifies the
848.Ux Ns -domain
849socket used to communicate with the authentication agent.
850.Pp
851This option overrides the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000852.Ev SSH_AUTH_SOCK
markus@openbsd.orgb02ad1c2016-05-04 12:21:53 +0000853environment variable and can be used to select a specific agent.
854Setting the socket name to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000855.Cm none
markus@openbsd.orgb02ad1c2016-05-04 12:21:53 +0000856disables the use of an authentication agent.
markus@openbsd.org1a75d142016-05-04 14:29:58 +0000857If the string
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000858.Qq SSH_AUTH_SOCK
markus@openbsd.org1a75d142016-05-04 14:29:58 +0000859is specified, the location of the socket will be read from the
860.Ev SSH_AUTH_SOCK
861environment variable.
markus@openbsd.orgb02ad1c2016-05-04 12:21:53 +0000862.Pp
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000863Arguments to
864.Cm IdentityAgent
865may use the tilde syntax to refer to a user's home directory
866or the tokens described in the
867.Sx TOKENS
868section.
Damien Miller957d4e42005-12-13 19:30:45 +1100869.It Cm IdentityFile
sobrado@openbsd.orgf70b22b2014-08-30 15:33:50 +0000870Specifies a file from which the user's DSA, ECDSA, Ed25519 or RSA authentication
Damien Millereb8b60e2010-08-31 22:41:14 +1000871identity is read.
Damien Miller957d4e42005-12-13 19:30:45 +1100872The default is
Damien Millereb8b60e2010-08-31 22:41:14 +1000873.Pa ~/.ssh/id_dsa ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100874.Pa ~/.ssh/id_ecdsa ,
875.Pa ~/.ssh/id_ed25519
Damien Miller957d4e42005-12-13 19:30:45 +1100876and
djm@openbsd.org788ac792017-04-30 23:18:22 +0000877.Pa ~/.ssh/id_rsa .
Damien Miller957d4e42005-12-13 19:30:45 +1100878Additionally, any identities represented by the authentication agent
Damien Miller7f2b4382013-07-18 16:10:29 +1000879will be used for authentication unless
880.Cm IdentitiesOnly
881is set.
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000882If no certificates have been explicitly specified by
883.Cm CertificateFile ,
Damien Miller5059d8d2010-03-05 21:31:11 +1100884.Xr ssh 1
885will try to load certificate information from the filename obtained by
886appending
887.Pa -cert.pub
888to the path of a specified
889.Cm IdentityFile .
Damien Miller6b1d53c2006-03-31 23:13:21 +1100890.Pp
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000891Arguments to
892.Cm IdentityFile
893may use the tilde syntax to refer to a user's home directory
894or the tokens described in the
895.Sx TOKENS
896section.
Damien Miller6b1d53c2006-03-31 23:13:21 +1100897.Pp
Damien Miller957d4e42005-12-13 19:30:45 +1100898It is possible to have
899multiple identity files specified in configuration files; all these
900identities will be tried in sequence.
Damien Miller6029e072011-06-20 14:22:49 +1000901Multiple
902.Cm IdentityFile
903directives will add to the list of identities tried (this behaviour
904differs from that of other configuration directives).
Damien Miller7f2b4382013-07-18 16:10:29 +1000905.Pp
906.Cm IdentityFile
907may be used in conjunction with
908.Cm IdentitiesOnly
909to select which identities in an agent are offered during authentication.
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000910.Cm IdentityFile
911may also be used in conjunction with
912.Cm CertificateFile
913in order to provide any certificate also needed for authentication with
914the identity.
Darren Tucker63e0df22013-05-16 20:30:31 +1000915.It Cm IgnoreUnknown
916Specifies a pattern-list of unknown options to be ignored if they are
917encountered in configuration parsing.
918This may be used to suppress errors if
919.Nm
920contains options that are unrecognised by
921.Xr ssh 1 .
922It is recommended that
923.Cm IgnoreUnknown
924be listed early in the configuration file as it will not be applied
925to unknown options that appear before it.
djm@openbsd.orgdc7990b2016-04-15 00:30:19 +0000926.It Cm Include
927Include the specified configuration file(s).
jmc@openbsd.org6aaabc22016-04-17 14:34:46 +0000928Multiple pathnames may be specified and each pathname may contain
kn@openbsd.orgddf1b792018-07-23 19:02:49 +0000929.Xr glob 7
djm@openbsd.orgdc7990b2016-04-15 00:30:19 +0000930wildcards and, for user configurations, shell-like
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000931.Sq ~
djm@openbsd.orgdc7990b2016-04-15 00:30:19 +0000932references to user home directories.
933Files without absolute paths are assumed to be in
934.Pa ~/.ssh
jmc@openbsd.org6aaabc22016-04-17 14:34:46 +0000935if included in a user configuration file or
djm@openbsd.orgdc7990b2016-04-15 00:30:19 +0000936.Pa /etc/ssh
937if included from the system configuration file.
938.Cm Include
939directive may appear inside a
940.Cm Match
941or
942.Cm Host
943block
944to perform conditional inclusion.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100945.It Cm IPQoS
946Specifies the IPv4 type-of-service or DSCP class for connections.
947Accepted values are
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000948.Cm af11 ,
949.Cm af12 ,
950.Cm af13 ,
951.Cm af21 ,
952.Cm af22 ,
953.Cm af23 ,
954.Cm af31 ,
955.Cm af32 ,
956.Cm af33 ,
957.Cm af41 ,
958.Cm af42 ,
959.Cm af43 ,
960.Cm cs0 ,
961.Cm cs1 ,
962.Cm cs2 ,
963.Cm cs3 ,
964.Cm cs4 ,
965.Cm cs5 ,
966.Cm cs6 ,
967.Cm cs7 ,
968.Cm ef ,
969.Cm lowdelay ,
970.Cm throughput ,
971.Cm reliability ,
djm@openbsd.org51676ec2017-07-23 23:37:02 +0000972a numeric value, or
973.Cm none
974to use the operating system default.
Damien Miller928362d2010-12-26 14:26:45 +1100975This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100976If one argument is specified, it is used as the packet class unconditionally.
977If two values are specified, the first is automatically selected for
978interactive sessions and the second for non-interactive sessions.
979The default is
job@openbsd.org5ee84482018-04-04 15:12:17 +0000980.Cm af21
jmc@openbsd.org83685712018-04-07 13:50:10 +0000981(Low-Latency Data)
Damien Miller0dac6fb2010-11-20 15:19:38 +1100982for interactive sessions and
job@openbsd.org5ee84482018-04-04 15:12:17 +0000983.Cm cs1
jmc@openbsd.org83685712018-04-07 13:50:10 +0000984(Lower Effort)
Damien Miller0dac6fb2010-11-20 15:19:38 +1100985for non-interactive sessions.
Damien Millercfb606c2007-10-26 14:24:48 +1000986.It Cm KbdInteractiveAuthentication
987Specifies whether to use keyboard-interactive authentication.
988The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000989.Cm yes
990(the default)
Damien Millercfb606c2007-10-26 14:24:48 +1000991or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000992.Cm no .
Darren Tucker636ca902004-11-05 20:22:00 +1100993.It Cm KbdInteractiveDevices
994Specifies the list of methods to use in keyboard-interactive authentication.
995Multiple method names must be comma-separated.
996The default is to use the server specified list.
Damien Miller9cfbaec2006-03-15 11:57:55 +1100997The methods available vary depending on what the server supports.
998For an OpenSSH server,
999it may be zero or more of:
Damien Miller87f08be2018-07-20 13:18:28 +10001000.Cm bsdauth
Damien Miller9cfbaec2006-03-15 11:57:55 +11001001and
Damien Miller87f08be2018-07-20 13:18:28 +10001002.Cm pam .
Damien Millerd5f62bf2010-09-24 22:11:14 +10001003.It Cm KexAlgorithms
1004Specifies the available KEX (Key Exchange) algorithms.
1005Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001006Alternately if the specified value begins with a
1007.Sq +
1008character, then the specified methods will be appended to the default set
1009instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +00001010If the specified value begins with a
1011.Sq -
1012character, then the specified methods (including wildcards) will be removed
1013from the default set instead of replacing them.
Damien Miller7fe2b1f2010-09-24 22:11:53 +10001014The default is:
1015.Bd -literal -offset indent
djm@openbsd.org16277fc2016-09-22 17:55:13 +00001016curve25519-sha256,curve25519-sha256@libssh.org,
Damien Miller7fe2b1f2010-09-24 22:11:53 +10001017ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
1018diffie-hellman-group-exchange-sha256,
djm@openbsd.org680321f2018-02-16 02:40:45 +00001019diffie-hellman-group16-sha512,
1020diffie-hellman-group18-sha512,
Damien Millerc1621c82014-04-20 13:22:46 +10001021diffie-hellman-group-exchange-sha1,
djm@openbsd.org680321f2018-02-16 02:40:45 +00001022diffie-hellman-group14-sha256,
djm@openbsd.orgbdfd29f2015-07-03 03:47:00 +00001023diffie-hellman-group14-sha1
Damien Miller7fe2b1f2010-09-24 22:11:53 +10001024.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001025.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001026The list of available key exchange algorithms may also be obtained using
1027.Qq ssh -Q kex .
Damien Millerd27b9472005-12-13 19:29:02 +11001028.It Cm LocalCommand
1029Specifies a command to execute on the local machine after successfully
1030connecting to the server.
1031The command string extends to the end of the line, and is executed with
Darren Tucker63b31cb2007-12-02 23:09:30 +11001032the user's shell.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001033Arguments to
1034.Cm LocalCommand
1035accept the tokens described in the
1036.Sx TOKENS
1037section.
Darren Tucker78be8c52010-01-08 17:05:59 +11001038.Pp
1039The command is run synchronously and does not have access to the
1040session of the
1041.Xr ssh 1
1042that spawned it.
1043It should not be used for interactive commands.
1044.Pp
Damien Millerd27b9472005-12-13 19:29:02 +11001045This directive is ignored unless
1046.Cm PermitLocalCommand
1047has been enabled.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001048.It Cm LocalForward
Damien Millere9d001e2006-01-14 10:10:17 +11001049Specifies that a TCP port on the local machine be forwarded over
Ben Lindstrom9f049032002-06-21 00:59:05 +00001050the secure channel to the specified host and port from the remote machine.
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001051The first argument must be
Damien Millerf91ee4c2005-03-01 21:24:33 +11001052.Sm off
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001053.Oo Ar bind_address : Oc Ar port
Damien Millerf91ee4c2005-03-01 21:24:33 +11001054.Sm on
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001055and the second argument must be
1056.Ar host : Ns Ar hostport .
Damien Miller7fa96602010-08-05 13:03:13 +10001057IPv6 addresses can be specified by enclosing addresses in square brackets.
Damien Millerf8c55462005-03-02 12:03:05 +11001058Multiple forwardings may be specified, and additional forwardings can be
Damien Millerf91ee4c2005-03-01 21:24:33 +11001059given on the command line.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001060Only the superuser can forward privileged ports.
Damien Millerf91ee4c2005-03-01 21:24:33 +11001061By default, the local port is bound in accordance with the
1062.Cm GatewayPorts
1063setting.
1064However, an explicit
1065.Ar bind_address
1066may be used to bind the connection to a specific address.
1067The
1068.Ar bind_address
1069of
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001070.Cm localhost
Damien Millerf8c55462005-03-02 12:03:05 +11001071indicates that the listening port be bound for local use only, while an
1072empty address or
1073.Sq *
Damien Millerf91ee4c2005-03-01 21:24:33 +11001074indicates that the port should be available from all interfaces.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001075.It Cm LogLevel
1076Gives the verbosity level that is used when logging messages from
Damien Miller45ee2b92006-03-15 11:56:18 +11001077.Xr ssh 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001078The possible values are:
Damien Miller45ee2b92006-03-15 11:56:18 +11001079QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +10001080The default is INFO.
1081DEBUG and DEBUG1 are equivalent.
1082DEBUG2 and DEBUG3 each specify higher levels of verbose output.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001083.It Cm MACs
1084Specifies the MAC (message authentication code) algorithms
1085in order of preference.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +00001086The MAC algorithm is used for data integrity protection.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001087Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001088If the specified value begins with a
1089.Sq +
1090character, then the specified algorithms will be appended to the default set
1091instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +00001092If the specified value begins with a
1093.Sq -
1094character, then the specified algorithms (including wildcards) will be removed
1095from the default set instead of replacing them.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001096.Pp
Damien Milleraf43a7a2012-12-12 10:46:31 +11001097The algorithms that contain
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001098.Qq -etm
Damien Milleraf43a7a2012-12-12 10:46:31 +11001099calculate the MAC after encryption (encrypt-then-mac).
1100These are considered safer and their use recommended.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001101.Pp
Damien Miller45ee2b92006-03-15 11:56:18 +11001102The default is:
Damien Miller5e7c30b2007-06-11 14:06:32 +10001103.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +11001104umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1105hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001106hmac-sha1-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +10001107umac-64@openssh.com,umac-128@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001108hmac-sha2-256,hmac-sha2-512,hmac-sha1
Damien Miller5e7c30b2007-06-11 14:06:32 +10001109.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001110.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001111The list of available MAC algorithms may also be obtained using
1112.Qq ssh -Q mac .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001113.It Cm NoHostAuthenticationForLocalhost
djm@openbsd.org4f011da2018-02-10 06:40:28 +00001114Disable host authentication for localhost (loopback addresses).
Ben Lindstrom9f049032002-06-21 00:59:05 +00001115The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001116.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +00001117or
jmc@openbsd.org78142e32017-02-27 14:30:33 +00001118.Cm no
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001119(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +00001120.It Cm NumberOfPasswordPrompts
1121Specifies the number of password prompts before giving up.
1122The argument to this keyword must be an integer.
Damien Miller45ee2b92006-03-15 11:56:18 +11001123The default is 3.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001124.It Cm PasswordAuthentication
1125Specifies whether to use password authentication.
1126The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001127.Cm yes
1128(the default)
Ben Lindstrom9f049032002-06-21 00:59:05 +00001129or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001130.Cm no .
Damien Millerd27b9472005-12-13 19:29:02 +11001131.It Cm PermitLocalCommand
1132Allow local command execution via the
1133.Ic LocalCommand
1134option or using the
Damien Miller4b2319f2005-12-13 19:30:27 +11001135.Ic !\& Ns Ar command
Damien Millerd27b9472005-12-13 19:29:02 +11001136escape sequence in
1137.Xr ssh 1 .
1138The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001139.Cm yes
Damien Millerd27b9472005-12-13 19:29:02 +11001140or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001141.Cm no
1142(the default).
Damien Miller7ea845e2010-02-12 09:21:02 +11001143.It Cm PKCS11Provider
1144Specifies which PKCS#11 provider to use.
Damien Miller8e1ea4e2010-11-20 15:20:10 +11001145The argument to this keyword is the PKCS#11 shared library
Damien Miller7ea845e2010-02-12 09:21:02 +11001146.Xr ssh 1
Damien Millera7618442010-02-12 09:26:02 +11001147should use to communicate with a PKCS#11 token providing the user's
Damien Miller7ea845e2010-02-12 09:21:02 +11001148private RSA key.
Damien Miller957d4e42005-12-13 19:30:45 +11001149.It Cm Port
1150Specifies the port number to connect on the remote host.
Damien Miller45ee2b92006-03-15 11:56:18 +11001151The default is 22.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001152.It Cm PreferredAuthentications
jmc@openbsd.orga685ae82016-02-17 07:38:19 +00001153Specifies the order in which the client should try authentication methods.
Darren Tucker1adc2bd2005-03-14 23:14:20 +11001154This allows a client to prefer one method (e.g.\&
Ben Lindstrom9f049032002-06-21 00:59:05 +00001155.Cm keyboard-interactive )
Darren Tucker1adc2bd2005-03-14 23:14:20 +11001156over another method (e.g.\&
Damien Miller544378d2010-04-16 15:52:24 +10001157.Cm password ) .
1158The default is:
1159.Bd -literal -offset indent
1160gssapi-with-mic,hostbased,publickey,
1161keyboard-interactive,password
1162.Ed
Ben Lindstrom9f049032002-06-21 00:59:05 +00001163.It Cm ProxyCommand
1164Specifies the command to use to connect to the server.
1165The command
Damien Miller079bac22014-07-09 13:06:25 +10001166string extends to the end of the line, and is executed
1167using the user's shell
1168.Ql exec
1169directive to avoid a lingering shell process.
1170.Pp
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001171Arguments to
1172.Cm ProxyCommand
1173accept the tokens described in the
1174.Sx TOKENS
1175section.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001176The command can be basically anything,
1177and should read from its standard input and write to its standard output.
1178It should eventually connect an
1179.Xr sshd 8
1180server running on some machine, or execute
1181.Ic sshd -i
1182somewhere.
1183Host key management will be done using the
1184HostName of the host being connected (defaulting to the name typed by
1185the user).
Damien Miller495dca32003-04-01 21:42:14 +10001186Setting the command to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001187.Cm none
Damien Miller9f1e33a2003-02-24 11:57:32 +11001188disables this option entirely.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001189Note that
1190.Cm CheckHostIP
1191is not available for connects with a proxy command.
1192.Pp
Damien Millerebcfedc2005-05-26 12:13:56 +10001193This directive is useful in conjunction with
1194.Xr nc 1
1195and its proxy support.
Damien Millerdfec2942005-05-26 12:14:32 +10001196For example, the following directive would connect via an HTTP proxy at
Damien Millerebcfedc2005-05-26 12:13:56 +10001197192.0.2.0:
1198.Bd -literal -offset 3n
1199ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p
1200.Ed
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001201.It Cm ProxyJump
millert@openbsd.org887669e2017-10-21 23:06:24 +00001202Specifies one or more jump proxies as either
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001203.Xo
1204.Sm off
jmc@openbsd.orge4eb7d92016-07-16 06:57:55 +00001205.Op Ar user No @
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001206.Ar host
jmc@openbsd.orge4eb7d92016-07-16 06:57:55 +00001207.Op : Ns Ar port
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001208.Sm on
millert@openbsd.org887669e2017-10-21 23:06:24 +00001209or an ssh URI
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001210.Xc .
djm@openbsd.org286f5a72016-07-22 03:35:11 +00001211Multiple proxies may be separated by comma characters and will be visited
djm@openbsd.orgf00211e2016-07-22 07:00:46 +00001212sequentially.
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001213Setting this option will cause
1214.Xr ssh 1
1215to connect to the target host by first making a
1216.Xr ssh 1
1217connection to the specified
1218.Cm ProxyJump
1219host and then establishing a
jmc@openbsd.orge4eb7d92016-07-16 06:57:55 +00001220TCP forwarding to the ultimate target from there.
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001221.Pp
1222Note that this option will compete with the
1223.Cm ProxyCommand
1224option - whichever is specified first will prevent later instances of the
1225other from taking effect.
Damien Miller1262b662013-08-21 02:44:24 +10001226.It Cm ProxyUseFdpass
Damien Millerf2f6c312013-08-21 02:44:58 +10001227Specifies that
Damien Miller1262b662013-08-21 02:44:24 +10001228.Cm ProxyCommand
1229will pass a connected file descriptor back to
Damien Millerf2f6c312013-08-21 02:44:58 +10001230.Xr ssh 1
Damien Miller1262b662013-08-21 02:44:24 +10001231instead of continuing to execute and pass data.
1232The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001233.Cm no .
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001234.It Cm PubkeyAcceptedKeyTypes
1235Specifies the key types that will be used for public key authentication
djm@openbsd.org312d2f22018-07-04 13:49:31 +00001236as a comma-separated list of patterns.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001237Alternately if the specified value begins with a
1238.Sq +
1239character, then the key types after it will be appended to the default
1240instead of replacing it.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +00001241If the specified value begins with a
1242.Sq -
1243character, then the specified key types (including wildcards) will be removed
1244from the default set instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001245The default for this option is:
1246.Bd -literal -offset 3n
1247ecdsa-sha2-nistp256-cert-v01@openssh.com,
1248ecdsa-sha2-nistp384-cert-v01@openssh.com,
1249ecdsa-sha2-nistp521-cert-v01@openssh.com,
1250ssh-ed25519-cert-v01@openssh.com,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +00001251rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001252ssh-rsa-cert-v01@openssh.com,
1253ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +00001254ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001255.Ed
1256.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001257The list of available key types may also be obtained using
1258.Qq ssh -Q key .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001259.It Cm PubkeyAuthentication
1260Specifies whether to try public key authentication.
1261The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001262.Cm yes
1263(the default)
Ben Lindstrom9f049032002-06-21 00:59:05 +00001264or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001265.Cm no .
Darren Tucker62388b22006-01-20 11:31:47 +11001266.It Cm RekeyLimit
1267Specifies the maximum amount of data that may be transmitted before the
Darren Tuckerc53c2af2013-05-16 20:28:16 +10001268session key is renegotiated, optionally followed a maximum amount of
1269time that may pass before the session key is renegotiated.
1270The first argument is specified in bytes and may have a suffix of
Damien Millerddfddf12006-01-31 21:39:03 +11001271.Sq K ,
1272.Sq M ,
Darren Tucker62388b22006-01-20 11:31:47 +11001273or
Damien Millerddfddf12006-01-31 21:39:03 +11001274.Sq G
Darren Tucker62388b22006-01-20 11:31:47 +11001275to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1276The default is between
Damien Miller45ee2b92006-03-15 11:56:18 +11001277.Sq 1G
Darren Tucker62388b22006-01-20 11:31:47 +11001278and
Damien Miller45ee2b92006-03-15 11:56:18 +11001279.Sq 4G ,
Darren Tucker62388b22006-01-20 11:31:47 +11001280depending on the cipher.
Darren Tuckerc53c2af2013-05-16 20:28:16 +10001281The optional second value is specified in seconds and may use any of the
1282units documented in the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001283.Sx TIME FORMATS
1284section of
Darren Tuckerc53c2af2013-05-16 20:28:16 +10001285.Xr sshd_config 5 .
1286The default value for
1287.Cm RekeyLimit
1288is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001289.Cm default none ,
Darren Tuckerc53c2af2013-05-16 20:28:16 +10001290which means that rekeying is performed after the cipher's default amount
1291of data has been sent or received and no time based rekeying is done.
bluhm@openbsd.org1112b532017-05-30 18:58:37 +00001292.It Cm RemoteCommand
1293Specifies a command to execute on the remote machine after successfully
1294connecting to the server.
1295The command string extends to the end of the line, and is executed with
1296the user's shell.
jmc@openbsd.orga3bb2502017-05-30 19:38:17 +00001297Arguments to
1298.Cm RemoteCommand
1299accept the tokens described in the
1300.Sx TOKENS
1301section.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001302.It Cm RemoteForward
Damien Millere9d001e2006-01-14 10:10:17 +11001303Specifies that a TCP port on the remote machine be forwarded over
markus@openbsd.org609d7a62017-09-21 19:16:53 +00001304the secure channel.
djm@openbsd.org001aa552018-04-10 00:10:49 +00001305The remote port may either be forwarded to a specified host and port
markus@openbsd.org609d7a62017-09-21 19:16:53 +00001306from the local machine, or may act as a SOCKS 4/5 proxy that allows a remote
1307client to connect to arbitrary destinations from the local machine.
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001308The first argument must be
Damien Millerf91ee4c2005-03-01 21:24:33 +11001309.Sm off
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001310.Oo Ar bind_address : Oc Ar port
Damien Millerf91ee4c2005-03-01 21:24:33 +11001311.Sm on
markus@openbsd.org609d7a62017-09-21 19:16:53 +00001312If forwarding to a specific destination then the second argument must be
1313.Ar host : Ns Ar hostport ,
1314otherwise if no destination argument is specified then the remote forwarding
1315will be established as a SOCKS proxy.
1316.Pp
Damien Miller7fa96602010-08-05 13:03:13 +10001317IPv6 addresses can be specified by enclosing addresses in square brackets.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001318Multiple forwardings may be specified, and additional
1319forwardings can be given on the command line.
Damien Millerde7532e2008-11-03 19:24:45 +11001320Privileged ports can be forwarded only when
1321logging in as root on the remote machine.
Damien Millere379e102009-02-14 16:34:39 +11001322.Pp
Damien Miller85c6d8a2009-02-14 16:34:21 +11001323If the
1324.Ar port
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001325argument is 0,
Damien Miller85c6d8a2009-02-14 16:34:21 +11001326the listen port will be dynamically allocated on the server and reported
1327to the client at run time.
Damien Millerf91ee4c2005-03-01 21:24:33 +11001328.Pp
1329If the
1330.Ar bind_address
1331is not specified, the default is to only bind to loopback addresses.
1332If the
1333.Ar bind_address
1334is
1335.Ql *
1336or an empty string, then the forwarding is requested to listen on all
1337interfaces.
1338Specifying a remote
1339.Ar bind_address
Damien Millerf8c55462005-03-02 12:03:05 +11001340will only succeed if the server's
1341.Cm GatewayPorts
Damien Millerf91ee4c2005-03-01 21:24:33 +11001342option is enabled (see
Damien Millerf8c55462005-03-02 12:03:05 +11001343.Xr sshd_config 5 ) .
Damien Miller21771e22011-05-15 08:45:50 +10001344.It Cm RequestTTY
1345Specifies whether to request a pseudo-tty for the session.
1346The argument may be one of:
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001347.Cm no
Damien Miller21771e22011-05-15 08:45:50 +10001348(never request a TTY),
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001349.Cm yes
Damien Miller21771e22011-05-15 08:45:50 +10001350(always request a TTY when standard input is a TTY),
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001351.Cm force
Damien Miller21771e22011-05-15 08:45:50 +10001352(always request a TTY) or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001353.Cm auto
Damien Miller21771e22011-05-15 08:45:50 +10001354(request a TTY when opening a login session).
1355This option mirrors the
1356.Fl t
1357and
1358.Fl T
1359flags for
1360.Xr ssh 1 .
djm@openbsd.org5e39a492014-12-04 02:24:32 +00001361.It Cm RevokedHostKeys
1362Specifies revoked host public keys.
1363Keys listed in this file will be refused for host authentication.
1364Note that if this file does not exist or is not readable,
1365then host authentication will be refused for all hosts.
1366Keys may be specified as a text file, listing one public key per line, or as
1367an OpenSSH Key Revocation List (KRL) as generated by
1368.Xr ssh-keygen 1 .
1369For more information on KRLs, see the KEY REVOCATION LISTS section in
1370.Xr ssh-keygen 1 .
Darren Tucker46bc0752004-05-02 22:11:30 +10001371.It Cm SendEnv
1372Specifies what variables from the local
1373.Xr environ 7
1374should be sent to the server.
Damien Miller45ee2b92006-03-15 11:56:18 +11001375The server must also support it, and the server must be configured to
Darren Tucker1e0c9bf2004-05-02 22:12:48 +10001376accept these environment variables.
dtucker@openbsd.org85b96ef2015-04-28 10:17:58 +00001377Note that the
1378.Ev TERM
jmc@openbsd.orgc1d5bcf2015-04-28 13:47:38 +00001379environment variable is always sent whenever a
dtucker@openbsd.org85b96ef2015-04-28 10:17:58 +00001380pseudo-terminal is requested as it is required by the protocol.
Darren Tucker46bc0752004-05-02 22:11:30 +10001381Refer to
1382.Cm AcceptEnv
1383in
1384.Xr sshd_config 5
1385for how to configure the server.
Damien Miller6def5512006-03-15 11:54:05 +11001386Variables are specified by name, which may contain wildcard characters.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +10001387Multiple environment variables may be separated by whitespace or spread
Darren Tucker46bc0752004-05-02 22:11:30 +10001388across multiple
1389.Cm SendEnv
1390directives.
Damien Millerf54a4b92006-03-15 11:54:36 +11001391.Pp
1392See
1393.Sx PATTERNS
1394for more information on patterns.
djm@openbsd.org555294a2018-04-06 13:02:39 +00001395.Pp
jmc@openbsd.org83685712018-04-07 13:50:10 +00001396It is possible to clear previously set
djm@openbsd.org555294a2018-04-06 13:02:39 +00001397.Cm SendEnv
1398variable names by prefixing patterns with
1399.Pa - .
1400The default is not to send any environment variables.
Damien Miller509b0102003-12-17 16:33:10 +11001401.It Cm ServerAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +11001402Sets the number of server alive messages (see below) which may be
Damien Miller509b0102003-12-17 16:33:10 +11001403sent without
Damien Miller45ee2b92006-03-15 11:56:18 +11001404.Xr ssh 1
Damien Miller509b0102003-12-17 16:33:10 +11001405receiving any messages back from the server.
1406If this threshold is reached while server alive messages are being sent,
Damien Miller45ee2b92006-03-15 11:56:18 +11001407ssh will disconnect from the server, terminating the session.
Damien Miller509b0102003-12-17 16:33:10 +11001408It is important to note that the use of server alive messages is very
1409different from
1410.Cm TCPKeepAlive
1411(below).
1412The server alive messages are sent through the encrypted channel
1413and therefore will not be spoofable.
1414The TCP keepalive option enabled by
1415.Cm TCPKeepAlive
1416is spoofable.
1417The server alive mechanism is valuable when the client or
1418server depend on knowing when a connection has become inactive.
1419.Pp
1420The default value is 3.
1421If, for example,
1422.Cm ServerAliveInterval
Damien Miller45ee2b92006-03-15 11:56:18 +11001423(see below) is set to 15 and
Damien Miller509b0102003-12-17 16:33:10 +11001424.Cm ServerAliveCountMax
Damien Miller45ee2b92006-03-15 11:56:18 +11001425is left at the default, if the server becomes unresponsive,
1426ssh will disconnect after approximately 45 seconds.
Damien Miller957d4e42005-12-13 19:30:45 +11001427.It Cm ServerAliveInterval
1428Sets a timeout interval in seconds after which if no data has been received
1429from the server,
Damien Miller45ee2b92006-03-15 11:56:18 +11001430.Xr ssh 1
Damien Miller957d4e42005-12-13 19:30:45 +11001431will send a message through the encrypted
1432channel to request a response from the server.
1433The default
1434is 0, indicating that these messages will not be sent to the server.
jmc@openbsd.orgacf42602018-06-09 06:36:31 +00001435.It Cm SetEnv
1436Directly specify one or more environment variables and their contents to
1437be sent to the server.
1438Similarly to
1439.Cm SendEnv ,
1440the server must be prepared to accept the environment variable.
Damien Miller7acefbb2014-07-18 14:11:24 +10001441.It Cm StreamLocalBindMask
1442Sets the octal file creation mode mask
1443.Pq umask
1444used when creating a Unix-domain socket file for local or remote
1445port forwarding.
1446This option is only used for port forwarding to a Unix-domain socket file.
1447.Pp
1448The default value is 0177, which creates a Unix-domain socket file that is
1449readable and writable only by the owner.
1450Note that not all operating systems honor the file mode on Unix-domain
1451socket files.
1452.It Cm StreamLocalBindUnlink
1453Specifies whether to remove an existing Unix-domain socket file for local
1454or remote port forwarding before creating a new one.
1455If the socket file already exists and
1456.Cm StreamLocalBindUnlink
1457is not enabled,
1458.Nm ssh
1459will be unable to forward the port to the Unix-domain socket file.
1460This option is only used for port forwarding to a Unix-domain socket file.
1461.Pp
1462The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001463.Cm yes
Damien Miller7acefbb2014-07-18 14:11:24 +10001464or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001465.Cm no
1466(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +00001467.It Cm StrictHostKeyChecking
1468If this flag is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001469.Cm yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +11001470.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001471will never automatically add host keys to the
Damien Miller167ea5d2005-05-26 12:04:02 +10001472.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +00001473file, and refuses to connect to hosts whose host key has changed.
dtucker@openbsd.org3e615092018-02-06 06:01:54 +00001474This provides maximum protection against man-in-the-middle (MITM) attacks,
Damien Miller45ee2b92006-03-15 11:56:18 +11001475though it can be annoying when the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001476.Pa /etc/ssh/ssh_known_hosts
Damien Miller45ee2b92006-03-15 11:56:18 +11001477file is poorly maintained or when connections to new hosts are
Ben Lindstrom9f049032002-06-21 00:59:05 +00001478frequently made.
1479This option forces the user to manually
1480add all new hosts.
jmc@openbsd.org149a8cd2017-09-04 06:34:43 +00001481.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001482If this flag is set to
djm@openbsd.org22376d22017-09-03 23:33:13 +00001483.Dq accept-new
jmc@openbsd.org149a8cd2017-09-04 06:34:43 +00001484then ssh will automatically add new host keys to the user
djm@openbsd.org22376d22017-09-03 23:33:13 +00001485known hosts files, but will not permit connections to hosts with
1486changed host keys.
1487If this flag is set to
1488.Dq no
1489or
1490.Dq off ,
jmc@openbsd.org149a8cd2017-09-04 06:34:43 +00001491ssh will automatically add new host keys to the user known hosts files
1492and allow connections to hosts with changed hostkeys to proceed,
1493subject to some restrictions.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001494If this flag is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001495.Cm ask
1496(the default),
Ben Lindstrom9f049032002-06-21 00:59:05 +00001497new host keys
1498will be added to the user known host files only after the user
1499has confirmed that is what they really want to do, and
Damien Miller45ee2b92006-03-15 11:56:18 +11001500ssh will refuse to connect to hosts whose host key has changed.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001501The host keys of
1502known hosts will be verified automatically in all cases.
jmc@openbsd.org47a287b2017-04-28 06:15:03 +00001503.It Cm SyslogFacility
1504Gives the facility code that is used when logging messages from
1505.Xr ssh 1 .
1506The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1507LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1508The default is USER.
Damien Miller12c150e2003-12-17 16:31:10 +11001509.It Cm TCPKeepAlive
1510Specifies whether the system should send TCP keepalive messages to the
1511other side.
1512If they are sent, death of the connection or crash of one
1513of the machines will be properly noticed.
1514However, this means that
1515connections will die if the route is down temporarily, and some people
1516find it annoying.
1517.Pp
1518The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001519.Cm yes
Damien Miller12c150e2003-12-17 16:31:10 +11001520(to send TCP keepalive messages), and the client will notice
1521if the network goes down or the remote host dies.
1522This is important in scripts, and many users want it too.
1523.Pp
1524To disable TCP keepalive messages, the value should be set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001525.Cm no .
djm@openbsd.orga7c38212018-02-10 09:03:54 +00001526See also
1527.Cm ServerAliveInterval
1528for protocol-level keepalives.
Damien Millerd27b9472005-12-13 19:29:02 +11001529.It Cm Tunnel
Damien Miller991dba42006-07-10 20:16:27 +10001530Request
Damien Millerd27b9472005-12-13 19:29:02 +11001531.Xr tun 4
Damien Miller7746c392005-12-13 19:33:37 +11001532device forwarding between the client and the server.
Damien Millerd27b9472005-12-13 19:29:02 +11001533The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001534.Cm yes ,
1535.Cm point-to-point
Damien Miller991dba42006-07-10 20:16:27 +10001536(layer 3),
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001537.Cm ethernet
Damien Miller991dba42006-07-10 20:16:27 +10001538(layer 2),
Damien Millerd27b9472005-12-13 19:29:02 +11001539or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001540.Cm no
1541(the default).
Damien Miller991dba42006-07-10 20:16:27 +10001542Specifying
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001543.Cm yes
Damien Miller991dba42006-07-10 20:16:27 +10001544requests the default tunnel mode, which is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001545.Cm point-to-point .
Damien Millerd27b9472005-12-13 19:29:02 +11001546.It Cm TunnelDevice
Damien Miller991dba42006-07-10 20:16:27 +10001547Specifies the
Damien Millerd27b9472005-12-13 19:29:02 +11001548.Xr tun 4
Damien Miller991dba42006-07-10 20:16:27 +10001549devices to open on the client
1550.Pq Ar local_tun
1551and the server
1552.Pq Ar remote_tun .
1553.Pp
1554The argument must be
1555.Sm off
1556.Ar local_tun Op : Ar remote_tun .
1557.Sm on
1558The devices may be specified by numerical ID or the keyword
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001559.Cm any ,
Damien Miller991dba42006-07-10 20:16:27 +10001560which uses the next available tunnel device.
1561If
1562.Ar remote_tun
1563is not specified, it defaults to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001564.Cm any .
Damien Miller991dba42006-07-10 20:16:27 +10001565The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001566.Cm any:any .
djm@openbsd.org1d1092b2015-01-26 12:16:36 +00001567.It Cm UpdateHostKeys
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001568Specifies whether
1569.Xr ssh 1
1570should accept notifications of additional hostkeys from the server sent
1571after authentication has completed and add them to
1572.Cm UserKnownHostsFile .
1573The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001574.Cm yes ,
1575.Cm no
djm@openbsd.org523463a2015-02-16 22:13:32 +00001576(the default) or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001577.Cm ask .
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001578Enabling this option allows learning alternate hostkeys for a server
djm@openbsd.org1d1092b2015-01-26 12:16:36 +00001579and supports graceful key rotation by allowing a server to send replacement
1580public keys before old ones are removed.
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001581Additional hostkeys are only accepted if the key used to authenticate the
sobrado@openbsd.orge3cbb062015-09-22 08:33:23 +00001582host was already trusted or explicitly accepted by the user.
djm@openbsd.org523463a2015-02-16 22:13:32 +00001583If
1584.Cm UpdateHostKeys
1585is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001586.Cm ask ,
djm@openbsd.org523463a2015-02-16 22:13:32 +00001587then the user is asked to confirm the modifications to the known_hosts file.
djm@openbsd.org44732de2015-02-20 22:17:21 +00001588Confirmation is currently incompatible with
1589.Cm ControlPersist ,
1590and will be disabled if it is enabled.
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001591.Pp
1592Presently, only
1593.Xr sshd 8
1594from OpenSSH 6.8 and greater support the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001595.Qq hostkeys@openssh.com
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001596protocol extension used to inform the client of all the server's hostkeys.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001597.It Cm User
1598Specifies the user to log in as.
1599This can be useful when a different user name is used on different machines.
1600This saves the trouble of
1601having to remember to give the user name on the command line.
1602.It Cm UserKnownHostsFile
Damien Miller295ee632011-05-29 21:42:31 +10001603Specifies one or more files to use for the user
1604host key database, separated by whitespace.
1605The default is
1606.Pa ~/.ssh/known_hosts ,
1607.Pa ~/.ssh/known_hosts2 .
Damien Miller37876e92003-05-15 10:19:46 +10001608.It Cm VerifyHostKeyDNS
1609Specifies whether to verify the remote key using DNS and SSHFP resource
1610records.
Damien Miller150b5572003-11-17 21:19:29 +11001611If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001612.Cm yes ,
Damien Millerfe448472003-11-17 21:19:49 +11001613the client will implicitly trust keys that match a secure fingerprint
Damien Miller150b5572003-11-17 21:19:29 +11001614from DNS.
1615Insecure fingerprints will be handled as if this option was set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001616.Cm ask .
Damien Miller150b5572003-11-17 21:19:29 +11001617If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001618.Cm ask ,
Damien Miller150b5572003-11-17 21:19:29 +11001619information on fingerprint match will be displayed, but the user will still
1620need to confirm new host keys according to the
1621.Cm StrictHostKeyChecking
1622option.
Damien Miller37876e92003-05-15 10:19:46 +10001623The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001624.Cm no .
Damien Miller45ee2b92006-03-15 11:56:18 +11001625.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001626See also
1627.Sx VERIFYING HOST KEYS
1628in
Damien Miller45ee2b92006-03-15 11:56:18 +11001629.Xr ssh 1 .
Damien Miller10288242008-06-30 00:04:03 +10001630.It Cm VisualHostKey
1631If this flag is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001632.Cm yes ,
Damien Miller10288242008-06-30 00:04:03 +10001633an ASCII art representation of the remote host key fingerprint is
djm@openbsd.orgb79efde2014-12-21 23:12:42 +00001634printed in addition to the fingerprint string at login and
Damien Millera414cd32008-11-03 19:25:21 +11001635for unknown host keys.
Damien Miller10288242008-06-30 00:04:03 +10001636If this flag is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001637.Cm no
1638(the default),
Damien Millera414cd32008-11-03 19:25:21 +11001639no fingerprint strings are printed at login and
djm@openbsd.orgb79efde2014-12-21 23:12:42 +00001640only the fingerprint string will be printed for unknown host keys.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001641.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001642Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001643.Xr xauth 1
1644program.
1645The default is
1646.Pa /usr/X11R6/bin/xauth .
1647.El
Damien Millerb5282c22006-03-15 11:59:08 +11001648.Sh PATTERNS
1649A
1650.Em pattern
1651consists of zero or more non-whitespace characters,
1652.Sq *
1653(a wildcard that matches zero or more characters),
1654or
1655.Sq ?\&
1656(a wildcard that matches exactly one character).
1657For example, to specify a set of declarations for any host in the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001658.Qq .co.uk
Damien Millerb5282c22006-03-15 11:59:08 +11001659set of domains,
1660the following pattern could be used:
1661.Pp
1662.Dl Host *.co.uk
1663.Pp
1664The following pattern
1665would match any host in the 192.168.0.[0-9] network range:
1666.Pp
1667.Dl Host 192.168.0.?
1668.Pp
1669A
1670.Em pattern-list
1671is a comma-separated list of patterns.
1672Patterns within pattern-lists may be negated
1673by preceding them with an exclamation mark
1674.Pq Sq !\& .
1675For example,
Damien Miller51682fa2013-10-17 11:48:31 +11001676to allow a key to be used from anywhere within an organization
Damien Millerb5282c22006-03-15 11:59:08 +11001677except from the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001678.Qq dialup
Damien Millerb5282c22006-03-15 11:59:08 +11001679pool,
1680the following entry (in authorized_keys) could be used:
1681.Pp
1682.Dl from=\&"!*.dialup.example.com,*.example.com\&"
djm@openbsd.org05b69e92017-10-18 02:49:44 +00001683.Pp
1684Note that a negated match will never produce a positive result by itself.
1685For example, attempting to match
1686.Qq host3
1687against the following pattern-list will fail:
1688.Pp
1689.Dl from=\&"!host1,!host2\&"
1690.Pp
1691The solution here is to include a term that will yield a positive match,
1692such as a wildcard:
1693.Pp
1694.Dl from=\&"!host1,!host2,*\&"
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001695.Sh TOKENS
1696Arguments to some keywords can make use of tokens,
1697which are expanded at runtime:
1698.Pp
1699.Bl -tag -width XXXX -offset indent -compact
1700.It %%
1701A literal
1702.Sq % .
1703.It \&%C
jmc@openbsd.org2b4f3ab2017-10-05 12:56:50 +00001704Hash of %l%h%p%r.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001705.It %d
1706Local user's home directory.
1707.It %h
1708The remote hostname.
1709.It %i
1710The local user ID.
1711.It %L
1712The local hostname.
1713.It %l
1714The local hostname, including the domain name.
1715.It %n
1716The original remote hostname, as given on the command line.
1717.It %p
1718The remote port.
1719.It %r
1720The remote username.
djm@openbsd.orgb7548b12017-10-23 05:08:00 +00001721.It \&%T
1722The local
1723.Xr tun 4
1724or
1725.Xr tap 4
1726network interface assigned if
jmc@openbsd.org08696272017-10-24 06:27:42 +00001727tunnel forwarding was requested, or
1728.Qq NONE
djm@openbsd.orgb7548b12017-10-23 05:08:00 +00001729otherwise.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001730.It %u
1731The local username.
1732.El
1733.Pp
1734.Cm Match exec
djm@openbsd.org9c935dd2018-06-01 03:33:53 +00001735accepts the tokens %%, %h, %i, %L, %l, %n, %p, %r, and %u.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001736.Pp
1737.Cm CertificateFile
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001738accepts the tokens %%, %d, %h, %i, %l, %r, and %u.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001739.Pp
1740.Cm ControlPath
1741accepts the tokens %%, %C, %h, %i, %L, %l, %n, %p, %r, and %u.
1742.Pp
1743.Cm HostName
1744accepts the tokens %% and %h.
1745.Pp
1746.Cm IdentityAgent
1747and
1748.Cm IdentityFile
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001749accept the tokens %%, %d, %h, %i, %l, %r, and %u.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001750.Pp
1751.Cm LocalCommand
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001752accepts the tokens %%, %C, %d, %h, %i, %l, %n, %p, %r, %T, and %u.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001753.Pp
1754.Cm ProxyCommand
1755accepts the tokens %%, %h, %p, and %r.
jmc@openbsd.orga3bb2502017-05-30 19:38:17 +00001756.Pp
1757.Cm RemoteCommand
djm@openbsd.org9c935dd2018-06-01 03:33:53 +00001758accepts the tokens %%, %C, %d, %h, %i, %l, %n, %p, %r, and %u.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001759.Sh FILES
1760.Bl -tag -width Ds
Damien Miller167ea5d2005-05-26 12:04:02 +10001761.It Pa ~/.ssh/config
Ben Lindstrom9f049032002-06-21 00:59:05 +00001762This is the per-user configuration file.
1763The format of this file is described above.
Damien Miller45ee2b92006-03-15 11:56:18 +11001764This file is used by the SSH client.
Damien Millerc970cb92004-04-20 20:12:53 +10001765Because of the potential for abuse, this file must have strict permissions:
1766read/write for the user, and not accessible by others.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001767.It Pa /etc/ssh/ssh_config
1768Systemwide configuration file.
1769This file provides defaults for those
1770values that are not specified in the user's configuration file, and
1771for those users who do not have a configuration file.
1772This file must be world-readable.
1773.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001774.Sh SEE ALSO
1775.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001776.Sh AUTHORS
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001777.An -nosplit
Ben Lindstrom9f049032002-06-21 00:59:05 +00001778OpenSSH is a derivative of the original and free
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001779ssh 1.2.12 release by
1780.An Tatu Ylonen .
1781.An Aaron Campbell , Bob Beck , Markus Friedl ,
1782.An Niels Provos , Theo de Raadt
1783and
1784.An Dug Song
Ben Lindstrom9f049032002-06-21 00:59:05 +00001785removed many bugs, re-added newer features and
1786created OpenSSH.
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001787.An Markus Friedl
1788contributed the support for SSH protocol versions 1.5 and 2.0.