blob: 9d89c13aa5cb4b5c701d4b1097c9e5ce94860ae9 [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.\"
dtucker@openbsd.orged833da2020-04-03 02:27:12 +000036.\" $OpenBSD: ssh_config.5,v 1.323 2020/04/03 02:27:12 dtucker Exp $
37.Dd $Mdocdate: April 3 2020 $
Ben Lindstrom9f049032002-06-21 00:59:05 +000038.Dt SSH_CONFIG 5
39.Os
40.Sh NAME
41.Nm ssh_config
jmc@openbsd.org483cc722019-11-30 07:07:59 +000042.Nd OpenSSH client configuration file
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 ,
djm@openbsd.org9e34e0c2018-11-23 05:08:07 +0000142.Cm final ,
Damien Miller8a04be72013-10-23 16:29:40 +1100143.Cm exec ,
Damien Miller194fd902013-10-15 12:13:05 +1100144.Cm host ,
145.Cm originalhost ,
146.Cm user ,
147and
148.Cm localuser .
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000149The
150.Cm all
151criteria must appear alone or immediately after
djm@openbsd.org9e34e0c2018-11-23 05:08:07 +0000152.Cm canonical
153or
154.Cm final .
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000155Other criteria may be combined arbitrarily.
156All criteria but
jmc@openbsd.orgdd0cf632018-11-23 06:58:28 +0000157.Cm all ,
158.Cm canonical ,
djm@openbsd.org9e34e0c2018-11-23 05:08:07 +0000159and
160.Cm final
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000161require an argument.
162Criteria may be negated by prepending an exclamation mark
163.Pq Sq !\& .
Damien Miller194fd902013-10-15 12:13:05 +1100164.Pp
Damien Miller8e5a67f2013-10-23 16:30:25 +1100165The
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000166.Cm canonical
dtucker@openbsd.orgdd2cfeb2015-05-28 05:09:45 +0000167keyword matches only when the configuration file is being re-parsed
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000168after hostname canonicalization (see the
169.Cm CanonicalizeHostname
jmc@openbsd.orgdd0cf632018-11-23 06:58:28 +0000170option).
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000171This may be useful to specify conditions that work with canonical host
172names only.
djm@openbsd.org9e34e0c2018-11-23 05:08:07 +0000173.Pp
174The
175.Cm final
176keyword requests that the configuration be re-parsed (regardless of whether
177.Cm CanonicalizeHostname
178is enabled), and matches only during this final pass.
179If
180.Cm CanonicalizeHostname
181is enabled, then
182.Cm canonical
183and
184.Cm final
185match during the same pass.
186.Pp
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000187The
Damien Miller8a04be72013-10-23 16:29:40 +1100188.Cm exec
Damien Miller8e5a67f2013-10-23 16:30:25 +1100189keyword executes the specified command under the user's shell.
Damien Miller194fd902013-10-15 12:13:05 +1100190If the command returns a zero exit status then the condition is considered true.
191Commands containing whitespace characters must be quoted.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000192Arguments to
193.Cm exec
194accept the tokens described in the
195.Sx TOKENS
196section.
Damien Miller194fd902013-10-15 12:13:05 +1100197.Pp
198The other keywords' criteria must be single entries or comma-separated
199lists and may use the wildcard and negation operators described in the
200.Sx PATTERNS
201section.
202The criteria for the
203.Cm host
204keyword are matched against the target hostname, after any substitution
205by the
jmc@openbsd.org76af9c52019-06-12 05:53:21 +0000206.Cm Hostname
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000207or
208.Cm CanonicalizeHostname
209options.
Damien Miller194fd902013-10-15 12:13:05 +1100210The
211.Cm originalhost
212keyword matches against the hostname as it was specified on the command-line.
213The
214.Cm user
215keyword matches against the target username on the remote host.
216The
217.Cm localuser
218keyword matches against the name of the local user running
219.Xr ssh 1
220(this keyword may be useful in system-wide
221.Nm
222files).
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000223.It Cm AddKeysToAgent
224Specifies whether keys should be automatically added to a running
jmc@openbsd.orge41a0712015-11-15 23:58:04 +0000225.Xr ssh-agent 1 .
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000226If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000227.Cm yes
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000228and a key is loaded from a file, the key and its passphrase are added to
229the agent with the default lifetime, as if by
230.Xr ssh-add 1 .
231If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000232.Cm ask ,
233.Xr ssh 1
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000234will require confirmation using the
235.Ev SSH_ASKPASS
236program before adding a key (see
237.Xr ssh-add 1
238for details).
239If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000240.Cm confirm ,
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000241each use of the key must be confirmed, as if the
242.Fl c
243option was specified to
244.Xr ssh-add 1 .
245If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000246.Cm no ,
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000247no keys are added to the agent.
248The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000249.Cm yes ,
250.Cm confirm ,
251.Cm ask ,
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000252or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000253.Cm no
254(the default).
Damien Miller20a8f972003-05-18 20:50:30 +1000255.It Cm AddressFamily
Damien Millerfbf486b2003-05-23 18:44:23 +1000256Specifies which address family to use when connecting.
257Valid arguments are
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000258.Cm any
259(the default),
260.Cm inet
Damien Miller45ee2b92006-03-15 11:56:18 +1100261(use IPv4 only), or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000262.Cm inet6
Darren Tucker79a7acf2005-02-09 09:48:57 +1100263(use IPv6 only).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000264.It Cm BatchMode
265If set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000266.Cm yes ,
djm@openbsd.org469df612020-01-25 23:33:27 +0000267user interaction such as password prompts and host key confirmation requests
268will be disabled.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000269This option is useful in scripts and other batch jobs where no user
djm@openbsd.org469df612020-01-25 23:33:27 +0000270is present to interact with
271.Xr ssh 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000272The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000273.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000274or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000275.Cm no
276(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000277.It Cm BindAddress
Darren Tucker89f4d472005-07-14 17:06:21 +1000278Use the specified address on the local machine as the source address of
Darren Tucker6c71d202005-07-14 17:06:50 +1000279the connection.
280Only useful on systems with more than one address.
jmc@openbsd.org7d330a12018-02-23 07:38:09 +0000281.It Cm BindInterface
282Use the address of the specified interface on the local machine as the
283source address of the connection.
Damien Miller0faf7472013-10-17 11:47:23 +1100284.It Cm CanonicalDomains
Damien Miller607af342013-10-17 11:47:51 +1100285When
Damien Miller38505592013-10-17 11:48:13 +1100286.Cm CanonicalizeHostname
Damien Miller0faf7472013-10-17 11:47:23 +1100287is enabled, this option specifies the list of domain suffixes in which to
288search for the specified destination host.
Damien Miller38505592013-10-17 11:48:13 +1100289.It Cm CanonicalizeFallbackLocal
Damien Miller51682fa2013-10-17 11:48:31 +1100290Specifies whether to fail with an error when hostname canonicalization fails.
Damien Miller607af342013-10-17 11:47:51 +1100291The default,
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000292.Cm yes ,
Damien Miller607af342013-10-17 11:47:51 +1100293will attempt to look up the unqualified hostname using the system resolver's
Damien Miller0faf7472013-10-17 11:47:23 +1100294search rules.
295A value of
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000296.Cm no
Damien Miller0faf7472013-10-17 11:47:23 +1100297will cause
298.Xr ssh 1
299to fail instantly if
Damien Miller38505592013-10-17 11:48:13 +1100300.Cm CanonicalizeHostname
Damien Miller0faf7472013-10-17 11:47:23 +1100301is enabled and the target hostname cannot be found in any of the domains
302specified by
303.Cm CanonicalDomains .
Damien Miller38505592013-10-17 11:48:13 +1100304.It Cm CanonicalizeHostname
Damien Miller51682fa2013-10-17 11:48:31 +1100305Controls whether explicit hostname canonicalization is performed.
Damien Miller607af342013-10-17 11:47:51 +1100306The default,
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000307.Cm no ,
Damien Miller0faf7472013-10-17 11:47:23 +1100308is not to perform any name rewriting and let the system resolver handle all
309hostname lookups.
310If set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000311.Cm yes
Damien Miller0faf7472013-10-17 11:47:23 +1100312then, for connections that do not use a
djm@openbsd.org383a33d2018-09-21 03:11:36 +0000313.Cm ProxyCommand
314or
315.Cm ProxyJump ,
Damien Miller0faf7472013-10-17 11:47:23 +1100316.Xr ssh 1
Damien Miller38505592013-10-17 11:48:13 +1100317will attempt to canonicalize the hostname specified on the command line
Damien Miller0faf7472013-10-17 11:47:23 +1100318using the
319.Cm CanonicalDomains
320suffixes and
Damien Miller38505592013-10-17 11:48:13 +1100321.Cm CanonicalizePermittedCNAMEs
Damien Miller0faf7472013-10-17 11:47:23 +1100322rules.
323If
Damien Miller38505592013-10-17 11:48:13 +1100324.Cm CanonicalizeHostname
Damien Miller0faf7472013-10-17 11:47:23 +1100325is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000326.Cm always ,
Damien Miller51682fa2013-10-17 11:48:31 +1100327then canonicalization is applied to proxied connections too.
Damien Miller13f97b22014-02-24 15:57:55 +1100328.Pp
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000329If this option is enabled, then the configuration files are processed
330again using the new target name to pick up any new configuration in matching
Damien Miller13f97b22014-02-24 15:57:55 +1100331.Cm Host
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000332and
333.Cm Match
Damien Miller13f97b22014-02-24 15:57:55 +1100334stanzas.
Damien Miller38505592013-10-17 11:48:13 +1100335.It Cm CanonicalizeMaxDots
Damien Miller607af342013-10-17 11:47:51 +1100336Specifies the maximum number of dot characters in a hostname before
Damien Miller51682fa2013-10-17 11:48:31 +1100337canonicalization is disabled.
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000338The default, 1,
Damien Miller607af342013-10-17 11:47:51 +1100339allows a single dot (i.e. hostname.subdomain).
Damien Miller38505592013-10-17 11:48:13 +1100340.It Cm CanonicalizePermittedCNAMEs
Damien Miller607af342013-10-17 11:47:51 +1100341Specifies rules to determine whether CNAMEs should be followed when
Damien Miller38505592013-10-17 11:48:13 +1100342canonicalizing hostnames.
Damien Miller0faf7472013-10-17 11:47:23 +1100343The rules consist of one or more arguments of
Damien Miller607af342013-10-17 11:47:51 +1100344.Ar source_domain_list : Ns Ar target_domain_list ,
Damien Miller0faf7472013-10-17 11:47:23 +1100345where
346.Ar source_domain_list
Damien Miller51682fa2013-10-17 11:48:31 +1100347is a pattern-list of domains that may follow CNAMEs in canonicalization,
Damien Miller0faf7472013-10-17 11:47:23 +1100348and
349.Ar target_domain_list
Damien Miller607af342013-10-17 11:47:51 +1100350is a pattern-list of domains that they may resolve to.
Damien Miller0faf7472013-10-17 11:47:23 +1100351.Pp
352For example,
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000353.Qq *.a.example.com:*.b.example.com,*.c.example.com
Damien Miller0faf7472013-10-17 11:47:23 +1100354will allow hostnames matching
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000355.Qq *.a.example.com
Damien Miller38505592013-10-17 11:48:13 +1100356to be canonicalized to names in the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000357.Qq *.b.example.com
Damien Miller0faf7472013-10-17 11:47:23 +1100358or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000359.Qq *.c.example.com
Damien Miller0faf7472013-10-17 11:47:23 +1100360domains.
jmc@openbsd.orge6933a22018-09-20 06:58:48 +0000361.It Cm CASignatureAlgorithms
362Specifies which algorithms are allowed for signing of certificates
363by certificate authorities (CAs).
364The default is:
365.Bd -literal -offset indent
djm@openbsd.org6e76e692019-08-02 01:23:19 +0000366ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
jmc@openbsd.orge6933a22018-09-20 06:58:48 +0000367ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
368.Ed
369.Pp
370.Xr ssh 1
371will not accept host certificates signed using algorithms other than those
372specified.
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000373.It Cm CertificateFile
374Specifies a file from which the user's certificate is read.
375A corresponding private key must be provided separately in order
376to use this certificate either
377from an
378.Cm IdentityFile
379directive or
380.Fl i
381flag to
382.Xr ssh 1 ,
383via
384.Xr ssh-agent 1 ,
385or via a
naddy@openbsd.orgaa4c6402019-11-07 08:38:38 +0000386.Cm PKCS11Provider
387or
388.Cm SecurityKeyProvider .
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000389.Pp
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000390Arguments to
391.Cm CertificateFile
392may use the tilde syntax to refer to a user's home directory
393or the tokens described in the
394.Sx TOKENS
395section.
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000396.Pp
397It is possible to have multiple certificate files specified in
398configuration files; these certificates will be tried in sequence.
399Multiple
400.Cm CertificateFile
401directives will add to the list of certificates used for
402authentication.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000403.It Cm ChallengeResponseAuthentication
Damien Miller1faa7132006-03-15 11:55:31 +1100404Specifies whether to use challenge-response authentication.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000405The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000406.Cm yes
407(the default)
Ben Lindstrom9f049032002-06-21 00:59:05 +0000408or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000409.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000410.It Cm CheckHostIP
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000411If set to
412.Cm yes
413(the default),
Damien Miller45ee2b92006-03-15 11:56:18 +1100414.Xr ssh 1
415will additionally check the host IP address in the
Ben Lindstrom9f049032002-06-21 00:59:05 +0000416.Pa known_hosts
417file.
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000418This allows it to detect if a host key changed due to DNS spoofing
djm@openbsd.org5e678592015-06-02 09:10:40 +0000419and will add addresses of destination hosts to
420.Pa ~/.ssh/known_hosts
421in the process, regardless of the setting of
422.Cm StrictHostKeyChecking .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000423If the option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000424.Cm no ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000425the check will not be executed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000426.It Cm Ciphers
djm@openbsd.org788ac792017-04-30 23:18:22 +0000427Specifies the ciphers allowed and their order of preference.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000428Multiple ciphers must be comma-separated.
kn@openbsd.orgdc2ca582019-08-16 11:16:32 +0000429If the specified list begins with a
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000430.Sq +
431character, then the specified ciphers will be appended to the default set
432instead of replacing them.
kn@openbsd.orgdc2ca582019-08-16 11:16:32 +0000433If the specified list begins with a
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000434.Sq -
435character, then the specified ciphers (including wildcards) will be removed
436from the default set instead of replacing them.
naddy@openbsd.org91a21352019-09-06 14:45:34 +0000437If the specified list begins with a
438.Sq ^
439character, then the specified ciphers will be placed at the head of the
440default set.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000441.Pp
Damien Miller0fde8ac2013-11-21 14:12:23 +1100442The supported ciphers are:
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000443.Bd -literal -offset indent
Damien Millerc1621c82014-04-20 13:22:46 +10004443des-cbc
Damien Millerc1621c82014-04-20 13:22:46 +1000445aes128-cbc
Damien Millerc1621c82014-04-20 13:22:46 +1000446aes192-cbc
Damien Millerc1621c82014-04-20 13:22:46 +1000447aes256-cbc
Damien Millerc1621c82014-04-20 13:22:46 +1000448aes128-ctr
Damien Millerc1621c82014-04-20 13:22:46 +1000449aes192-ctr
Damien Millerc1621c82014-04-20 13:22:46 +1000450aes256-ctr
Damien Millerc1621c82014-04-20 13:22:46 +1000451aes128-gcm@openssh.com
Damien Millerc1621c82014-04-20 13:22:46 +1000452aes256-gcm@openssh.com
Damien Millerc1621c82014-04-20 13:22:46 +1000453chacha20-poly1305@openssh.com
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000454.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100455.Pp
Damien Miller45ee2b92006-03-15 11:56:18 +1100456The default is:
Damien Millerc1621c82014-04-20 13:22:46 +1000457.Bd -literal -offset indent
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000458chacha20-poly1305@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000459aes128-ctr,aes192-ctr,aes256-ctr,
djm@openbsd.org00c52222018-04-05 22:54:28 +0000460aes128-gcm@openssh.com,aes256-gcm@openssh.com
Ben Lindstrom9f049032002-06-21 00:59:05 +0000461.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100462.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000463The list of available ciphers may also be obtained using
464.Qq ssh -Q cipher .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000465.It Cm ClearAllForwardings
Damien Miller45ee2b92006-03-15 11:56:18 +1100466Specifies that all local, remote, and dynamic port forwardings
Ben Lindstrom9f049032002-06-21 00:59:05 +0000467specified in the configuration files or on the command line be
Damien Miller495dca32003-04-01 21:42:14 +1000468cleared.
469This option is primarily useful when used from the
Damien Miller45ee2b92006-03-15 11:56:18 +1100470.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000471command line to clear port forwardings set in
472configuration files, and is automatically set by
473.Xr scp 1
474and
475.Xr sftp 1 .
476The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000477.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000478or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000479.Cm no
480(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000481.It Cm Compression
482Specifies whether to use compression.
483The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000484.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000485or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000486.Cm no
487(the default).
naddy@openbsd.org9a82e242017-05-03 21:49:18 +0000488.It Cm ConnectionAttempts
489Specifies the number of tries (one per second) to make before exiting.
490The argument must be an integer.
491This may be useful in scripts if the connection sometimes fails.
492The default is 1.
Damien Millerb78d5eb2003-05-16 11:39:04 +1000493.It Cm ConnectTimeout
Damien Miller45ee2b92006-03-15 11:56:18 +1100494Specifies the timeout (in seconds) used when connecting to the
495SSH server, instead of using the default system TCP timeout.
djm@openbsd.org2ce1d112019-09-13 04:07:42 +0000496This timeout is applied both to establishing the connection and to performing
497the initial SSH protocol handshake and key exchange.
Damien Miller0e220db2004-06-15 10:34:08 +1000498.It Cm ControlMaster
499Enables the sharing of multiple sessions over a single network connection.
500When set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000501.Cm yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +1100502.Xr ssh 1
Damien Miller0e220db2004-06-15 10:34:08 +1000503will listen for connections on a control socket specified using the
504.Cm ControlPath
505argument.
506Additional sessions can connect to this socket using the same
507.Cm ControlPath
508with
509.Cm ControlMaster
510set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000511.Cm no
Damien Miller2234bac2004-06-30 22:38:52 +1000512(the default).
Damien Miller713de762005-11-05 15:13:49 +1100513These sessions will try to reuse the master instance's network connection
Damien Millerb3bfbb72005-11-05 15:11:48 +1100514rather than initiating new ones, but will fall back to connecting normally
515if the control socket does not exist, or is not listening.
516.Pp
Damien Miller23f07702004-06-18 01:19:03 +1000517Setting this to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000518.Cm ask
519will cause
520.Xr ssh 1
jmc@openbsd.org78de1672015-03-30 18:28:37 +0000521to listen for control connections, but require confirmation using
522.Xr ssh-askpass 1 .
Damien Millerdadfd4d2005-05-26 12:07:13 +1000523If the
524.Cm ControlPath
Damien Miller45ee2b92006-03-15 11:56:18 +1100525cannot be opened,
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000526.Xr ssh 1
527will continue without connecting to a master instance.
Damien Millerd14b1e72005-06-16 13:19:41 +1000528.Pp
Damien Miller13390022005-07-06 09:44:19 +1000529X11 and
Damien Millerfd94fba2005-07-06 09:44:59 +1000530.Xr ssh-agent 1
Damien Miller13390022005-07-06 09:44:19 +1000531forwarding is supported over these multiplexed connections, however the
Darren Tucker63551872005-12-20 16:14:15 +1100532display and agent forwarded will be the one belonging to the master
Damien Millerfd94fba2005-07-06 09:44:59 +1000533connection i.e. it is not possible to forward multiple displays or agents.
Damien Miller13390022005-07-06 09:44:19 +1000534.Pp
Damien Millerd14b1e72005-06-16 13:19:41 +1000535Two additional options allow for opportunistic multiplexing: try to use a
536master connection but fall back to creating a new one if one does not already
537exist.
538These options are:
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000539.Cm auto
Damien Millerd14b1e72005-06-16 13:19:41 +1000540and
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000541.Cm autoask .
Damien Millerd14b1e72005-06-16 13:19:41 +1000542The latter requires confirmation like the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000543.Cm ask
Damien Millerd14b1e72005-06-16 13:19:41 +1000544option.
Damien Miller0e220db2004-06-15 10:34:08 +1000545.It Cm ControlPath
Damien Miller6476cad2005-06-16 13:18:34 +1000546Specify the path to the control socket used for connection sharing as described
547in the
Damien Miller0e220db2004-06-15 10:34:08 +1000548.Cm ControlMaster
Damien Miller8f74c8f2005-06-26 08:56:03 +1000549section above or the string
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000550.Cm none
Damien Miller8f74c8f2005-06-26 08:56:03 +1000551to disable connection sharing.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000552Arguments to
553.Cm ControlPath
554may use the tilde syntax to refer to a user's home directory
555or the tokens described in the
556.Sx TOKENS
557section.
Damien Millerd14b1e72005-06-16 13:19:41 +1000558It is recommended that any
559.Cm ControlPath
560used for opportunistic connection sharing include
djm@openbsd.orgfc302562014-11-10 22:25:49 +0000561at least %h, %p, and %r (or alternatively %C) and be placed in a directory
562that is not writable by other users.
Damien Millerd14b1e72005-06-16 13:19:41 +1000563This ensures that shared connections are uniquely identified.
Damien Millere11e1ea2010-08-03 16:04:46 +1000564.It Cm ControlPersist
565When used in conjunction with
566.Cm ControlMaster ,
567specifies that the master connection should remain open
568in the background (waiting for future client connections)
569after the initial client connection has been closed.
570If set to
naddy@openbsd.orga78c66d2020-01-21 12:40:04 +0000571.Cm no
572(the default),
Damien Millere11e1ea2010-08-03 16:04:46 +1000573then the master connection will not be placed into the background,
574and will close as soon as the initial client connection is closed.
575If set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000576.Cm yes
577or 0,
Damien Millere11e1ea2010-08-03 16:04:46 +1000578then the master connection will remain in the background indefinitely
579(until killed or closed via a mechanism such as the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000580.Qq ssh -O exit ) .
Damien Millere11e1ea2010-08-03 16:04:46 +1000581If set to a time in seconds, or a time in any of the formats documented in
582.Xr sshd_config 5 ,
583then the backgrounded master connection will automatically terminate
584after it has remained idle (with no client connections) for the
585specified time.
Damien Miller2234bac2004-06-30 22:38:52 +1000586.It Cm DynamicForward
Damien Millere9d001e2006-01-14 10:10:17 +1100587Specifies that a TCP port on the local machine be forwarded
Damien Miller2234bac2004-06-30 22:38:52 +1000588over the secure channel, and the application
589protocol is then used to determine where to connect to from the
590remote machine.
Darren Tuckerc8d64212005-10-03 18:13:42 +1000591.Pp
592The argument must be
593.Sm off
594.Oo Ar bind_address : Oc Ar port .
595.Sm on
Damien Miller7fa96602010-08-05 13:03:13 +1000596IPv6 addresses can be specified by enclosing addresses in square brackets.
Darren Tuckerc8d64212005-10-03 18:13:42 +1000597By default, the local port is bound in accordance with the
598.Cm GatewayPorts
599setting.
600However, an explicit
601.Ar bind_address
602may be used to bind the connection to a specific address.
603The
604.Ar bind_address
605of
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000606.Cm localhost
Darren Tuckerc8d64212005-10-03 18:13:42 +1000607indicates that the listening port be bound for local use only, while an
608empty address or
609.Sq *
610indicates that the port should be available from all interfaces.
611.Pp
Damien Miller2234bac2004-06-30 22:38:52 +1000612Currently the SOCKS4 and SOCKS5 protocols are supported, and
Damien Miller45ee2b92006-03-15 11:56:18 +1100613.Xr ssh 1
Damien Miller2234bac2004-06-30 22:38:52 +1000614will act as a SOCKS server.
615Multiple forwardings may be specified, and
616additional forwardings can be given on the command line.
617Only the superuser can forward privileged ports.
Darren Tucker674f71d2003-06-28 12:33:12 +1000618.It Cm EnableSSHKeysign
619Setting this option to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000620.Cm yes
Darren Tucker674f71d2003-06-28 12:33:12 +1000621in the global client configuration file
622.Pa /etc/ssh/ssh_config
623enables the use of the helper program
624.Xr ssh-keysign 8
625during
626.Cm HostbasedAuthentication .
627The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000628.Cm yes
Darren Tucker674f71d2003-06-28 12:33:12 +1000629or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000630.Cm no
631(the default).
Darren Tuckerf132c672003-10-15 15:58:18 +1000632This option should be placed in the non-hostspecific section.
Darren Tucker674f71d2003-06-28 12:33:12 +1000633See
634.Xr ssh-keysign 8
635for more information.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000636.It Cm EscapeChar
637Sets the escape character (default:
638.Ql ~ ) .
639The escape character can also
640be set on the command line.
641The argument should be a single character,
642.Ql ^
643followed by a letter, or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000644.Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +0000645to disable the escape
646character entirely (making the connection transparent for binary
647data).
Darren Tuckere7d4b192006-07-12 22:17:10 +1000648.It Cm ExitOnForwardFailure
649Specifies whether
650.Xr ssh 1
651should terminate the connection if it cannot set up all requested
djm@openbsd.orga954cdb2015-09-04 04:47:50 +0000652dynamic, tunnel, local, and remote port forwardings, (e.g.\&
jmc@openbsd.org5245bc12015-09-04 06:40:45 +0000653if either end is unable to bind and listen on a specified port).
djm@openbsd.orga954cdb2015-09-04 04:47:50 +0000654Note that
655.Cm ExitOnForwardFailure
656does not apply to connections made over port forwardings and will not,
657for example, cause
658.Xr ssh 1
659to exit if TCP connections to the ultimate forwarding destination fail.
Darren Tuckere7d4b192006-07-12 22:17:10 +1000660The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000661.Cm yes
Darren Tuckere7d4b192006-07-12 22:17:10 +1000662or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000663.Cm no
664(the default).
djm@openbsd.orgb79efde2014-12-21 23:12:42 +0000665.It Cm FingerprintHash
666Specifies the hash algorithm used when displaying key fingerprints.
667Valid options are:
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000668.Cm md5
djm@openbsd.orgb79efde2014-12-21 23:12:42 +0000669and
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000670.Cm sha256
671(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000672.It Cm ForwardAgent
673Specifies whether the connection to the authentication agent (if any)
674will be forwarded to the remote machine.
djm@openbsd.org40be78f2019-12-21 02:19:13 +0000675The argument may be
676.Cm yes ,
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000677.Cm no
djm@openbsd.org40be78f2019-12-21 02:19:13 +0000678(the default),
679an explicit path to an agent socket or the name of an environment variable
680(beginning with
681.Sq $ )
682in which to find the path.
Damien Milleraf653042002-09-04 16:40:37 +1000683.Pp
Damien Miller495dca32003-04-01 21:42:14 +1000684Agent forwarding should be enabled with caution.
685Users with the ability to bypass file permissions on the remote host
686(for the agent's Unix-domain socket)
687can access the local agent through the forwarded connection.
688An attacker cannot obtain key material from the agent,
Damien Milleraf653042002-09-04 16:40:37 +1000689however they can perform operations on the keys that enable them to
690authenticate using the identities loaded into the agent.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000691.It Cm ForwardX11
692Specifies whether X11 connections will be automatically redirected
693over the secure channel and
694.Ev DISPLAY
695set.
696The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000697.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000698or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000699.Cm no
700(the default).
Damien Milleraf653042002-09-04 16:40:37 +1000701.Pp
Damien Miller495dca32003-04-01 21:42:14 +1000702X11 forwarding should be enabled with caution.
703Users with the ability to bypass file permissions on the remote host
Darren Tucker0a118da2003-10-15 15:54:32 +1000704(for the user's X11 authorization database)
Damien Miller495dca32003-04-01 21:42:14 +1000705can access the local X11 display through the forwarded connection.
Darren Tucker0a118da2003-10-15 15:54:32 +1000706An attacker may then be able to perform activities such as keystroke monitoring
707if the
708.Cm ForwardX11Trusted
709option is also enabled.
Damien Miller1ab6a512010-06-26 10:02:24 +1000710.It Cm ForwardX11Timeout
Damien Millercede1db2010-07-02 13:33:48 +1000711Specify a timeout for untrusted X11 forwarding
712using the format described in the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000713.Sx TIME FORMATS
714section of
Damien Miller1ab6a512010-06-26 10:02:24 +1000715.Xr sshd_config 5 .
716X11 connections received by
717.Xr ssh 1
718after this time will be refused.
djm@openbsd.orgb5e412a2018-09-21 12:46:22 +0000719Setting
720.Cm ForwardX11Timeout
721to zero will disable the timeout and permit X11 forwarding for the life
722of the connection.
Damien Miller1ab6a512010-06-26 10:02:24 +1000723The default is to disable untrusted X11 forwarding after twenty minutes has
724elapsed.
Darren Tucker0a118da2003-10-15 15:54:32 +1000725.It Cm ForwardX11Trusted
Darren Tuckerdcf6ec42004-05-13 13:03:56 +1000726If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000727.Cm yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +1100728remote X11 clients will have full access to the original X11 display.
Damien Miller1717fd42005-03-01 21:17:31 +1100729.Pp
Darren Tucker0a118da2003-10-15 15:54:32 +1000730If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000731.Cm no
732(the default),
Damien Miller45ee2b92006-03-15 11:56:18 +1100733remote X11 clients will be considered untrusted and prevented
Darren Tucker0a118da2003-10-15 15:54:32 +1000734from stealing or tampering with data belonging to trusted X11
735clients.
Damien Miller1717fd42005-03-01 21:17:31 +1100736Furthermore, the
737.Xr xauth 1
738token used for the session will be set to expire after 20 minutes.
739Remote clients will be refused access after this time.
Darren Tucker0a118da2003-10-15 15:54:32 +1000740.Pp
Darren Tucker0a118da2003-10-15 15:54:32 +1000741See the X11 SECURITY extension specification for full details on
742the restrictions imposed on untrusted clients.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000743.It Cm GatewayPorts
744Specifies whether remote hosts are allowed to connect to local
745forwarded ports.
746By default,
Damien Miller45ee2b92006-03-15 11:56:18 +1100747.Xr ssh 1
Damien Miller495dca32003-04-01 21:42:14 +1000748binds local port forwardings to the loopback address.
749This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000750.Cm GatewayPorts
Damien Miller45ee2b92006-03-15 11:56:18 +1100751can be used to specify that ssh
Ben Lindstrom9f049032002-06-21 00:59:05 +0000752should bind local port forwardings to the wildcard address,
753thus allowing remote hosts to connect to forwarded ports.
754The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000755.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000756or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000757.Cm no
758(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000759.It Cm GlobalKnownHostsFile
Damien Miller295ee632011-05-29 21:42:31 +1000760Specifies one or more files to use for the global
761host key database, separated by whitespace.
762The default is
763.Pa /etc/ssh/ssh_known_hosts ,
764.Pa /etc/ssh/ssh_known_hosts2 .
Darren Tucker0efd1552003-08-26 11:49:55 +1000765.It Cm GSSAPIAuthentication
Damien Millerbaafb982003-12-17 16:32:23 +1100766Specifies whether user authentication based on GSSAPI is allowed.
Damien Millerc2b98272003-09-03 12:13:30 +1000767The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000768.Cm no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000769.It Cm GSSAPIDelegateCredentials
770Forward (delegate) credentials to the server.
771The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000772.Cm no .
Damien Millere1776152005-03-01 21:47:37 +1100773.It Cm HashKnownHosts
774Indicates that
Damien Miller45ee2b92006-03-15 11:56:18 +1100775.Xr ssh 1
Damien Millere1776152005-03-01 21:47:37 +1100776should hash host names and addresses when they are added to
Damien Miller167ea5d2005-05-26 12:04:02 +1000777.Pa ~/.ssh/known_hosts .
Damien Millere1776152005-03-01 21:47:37 +1100778These hashed names may be used normally by
Damien Miller45ee2b92006-03-15 11:56:18 +1100779.Xr ssh 1
Damien Millere1776152005-03-01 21:47:37 +1100780and
Damien Miller45ee2b92006-03-15 11:56:18 +1100781.Xr sshd 8 ,
djm@openbsd.org3432b6e2020-01-25 07:02:51 +0000782but they do not visually reveal identifying information if the
783file's contents are disclosed.
Damien Millere1776152005-03-01 21:47:37 +1100784The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000785.Cm no .
Damien Miller858bb7d2006-08-05 11:34:51 +1000786Note that existing names and addresses in known hosts files
787will not be converted automatically,
788but may be manually hashed using
Damien Miller4b42d7f2005-03-01 21:48:35 +1100789.Xr ssh-keygen 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000790.It Cm HostbasedAuthentication
791Specifies whether to try rhosts based authentication with public key
792authentication.
793The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000794.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000795or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000796.Cm no
797(the default).
djm@openbsd.org46347ed2015-01-30 11:43:14 +0000798.It Cm HostbasedKeyTypes
799Specifies the key types that will be used for hostbased authentication
djm@openbsd.org312d2f22018-07-04 13:49:31 +0000800as a comma-separated list of patterns.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +0000801Alternately if the specified list begins with a
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000802.Sq +
803character, then the specified key types will be appended to the default set
804instead of replacing them.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +0000805If the specified list begins with a
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000806.Sq -
807character, then the specified key types (including wildcards) will be removed
808from the default set instead of replacing them.
naddy@openbsd.org91a21352019-09-06 14:45:34 +0000809If the specified list begins with a
810.Sq ^
811character, then the specified key types will be placed at the head of the
812default set.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000813The default for this option is:
814.Bd -literal -offset 3n
815ecdsa-sha2-nistp256-cert-v01@openssh.com,
816ecdsa-sha2-nistp384-cert-v01@openssh.com,
817ecdsa-sha2-nistp521-cert-v01@openssh.com,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +0000818sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000819ssh-ed25519-cert-v01@openssh.com,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +0000820sk-ssh-ed25519-cert-v01@openssh.com,
naddy@openbsd.orgaa4c6402019-11-07 08:38:38 +0000821rsa-sha2-512-cert-v01@openssh.com,
822rsa-sha2-256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000823ssh-rsa-cert-v01@openssh.com,
824ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +0000825sk-ecdsa-sha2-nistp256@openssh.com,
826ssh-ed25519,sk-ssh-ed25519@openssh.com,
827rsa-sha2-512,rsa-sha2-256,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000828.Ed
829.Pp
djm@openbsd.org46347ed2015-01-30 11:43:14 +0000830The
831.Fl Q
832option of
833.Xr ssh 1
834may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000835.It Cm HostKeyAlgorithms
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000836Specifies the host key algorithms
Ben Lindstrom9f049032002-06-21 00:59:05 +0000837that the client wants to use in order of preference.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +0000838Alternately if the specified list begins with a
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000839.Sq +
840character, then the specified key types will be appended to the default set
841instead of replacing them.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +0000842If the specified list begins with a
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000843.Sq -
844character, then the specified key types (including wildcards) will be removed
845from the default set instead of replacing them.
naddy@openbsd.org91a21352019-09-06 14:45:34 +0000846If the specified list begins with a
847.Sq ^
848character, then the specified key types will be placed at the head of the
849default set.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000850The default for this option is:
Damien Millereb8b60e2010-08-31 22:41:14 +1000851.Bd -literal -offset 3n
852ecdsa-sha2-nistp256-cert-v01@openssh.com,
853ecdsa-sha2-nistp384-cert-v01@openssh.com,
854ecdsa-sha2-nistp521-cert-v01@openssh.com,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +0000855sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100856ssh-ed25519-cert-v01@openssh.com,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +0000857sk-ssh-ed25519-cert-v01@openssh.com,
naddy@openbsd.orgaa4c6402019-11-07 08:38:38 +0000858rsa-sha2-512-cert-v01@openssh.com,
859rsa-sha2-256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000860ssh-rsa-cert-v01@openssh.com,
Damien Millereb8b60e2010-08-31 22:41:14 +1000861ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +0000862sk-ecdsa-sha2-nistp256@openssh.com,
863ssh-ed25519,sk-ssh-ed25519@openssh.com,
864rsa-sha2-512,rsa-sha2-256,ssh-rsa
Damien Millereb8b60e2010-08-31 22:41:14 +1000865.Ed
Damien Millerd925dcd2010-12-01 12:21:51 +1100866.Pp
867If hostkeys are known for the destination host then this default is modified
868to prefer their algorithms.
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000869.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000870The list of available key types may also be obtained using
dtucker@openbsd.orgd4d9e1d2020-02-07 03:54:44 +0000871.Qq ssh -Q HostKeyAlgorithms .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000872.It Cm HostKeyAlias
873Specifies an alias that should be used instead of the
874real host name when looking up or saving the host key
djm@openbsd.org6f8ca3b2017-06-24 05:35:05 +0000875in the host key database files and when validating host certificates.
Damien Miller45ee2b92006-03-15 11:56:18 +1100876This option is useful for tunneling SSH connections
Ben Lindstrom9f049032002-06-21 00:59:05 +0000877or for multiple servers running on a single host.
jmc@openbsd.org76af9c52019-06-12 05:53:21 +0000878.It Cm Hostname
Ben Lindstrom9f049032002-06-21 00:59:05 +0000879Specifies the real host name to log into.
880This can be used to specify nicknames or abbreviations for hosts.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000881Arguments to
jmc@openbsd.org76af9c52019-06-12 05:53:21 +0000882.Cm Hostname
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000883accept the tokens described in the
884.Sx TOKENS
885section.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000886Numeric IP addresses are also permitted (both on the command line and in
jmc@openbsd.org76af9c52019-06-12 05:53:21 +0000887.Cm Hostname
Ben Lindstrom9f049032002-06-21 00:59:05 +0000888specifications).
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000889The default is the name given on the command line.
Damien Millerbd394c32004-03-08 23:12:36 +1100890.It Cm IdentitiesOnly
891Specifies that
Damien Miller45ee2b92006-03-15 11:56:18 +1100892.Xr ssh 1
djm@openbsd.org7047d5a2019-09-13 04:52:34 +0000893should only use the configured authentication identity and certificate files
894(either the default files, or those explicitly configured in the
Damien Miller1a812582004-04-20 20:13:32 +1000895.Nm
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000896files
897or passed on the
898.Xr ssh 1
djm@openbsd.org7047d5a2019-09-13 04:52:34 +0000899command-line),
Damien Miller45ee2b92006-03-15 11:56:18 +1100900even if
901.Xr ssh-agent 1
Damien Millercb6b68b2012-12-03 09:49:52 +1100902or a
903.Cm PKCS11Provider
naddy@openbsd.orgaa4c6402019-11-07 08:38:38 +0000904or
905.Cm SecurityKeyProvider
Damien Millerbd394c32004-03-08 23:12:36 +1100906offers more identities.
907The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000908.Cm yes
Damien Millerbd394c32004-03-08 23:12:36 +1100909or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000910.Cm no
911(the default).
Damien Miller45ee2b92006-03-15 11:56:18 +1100912This option is intended for situations where ssh-agent
Damien Millerbd394c32004-03-08 23:12:36 +1100913offers many different identities.
markus@openbsd.orgb02ad1c2016-05-04 12:21:53 +0000914.It Cm IdentityAgent
915Specifies the
916.Ux Ns -domain
917socket used to communicate with the authentication agent.
918.Pp
919This option overrides the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000920.Ev SSH_AUTH_SOCK
markus@openbsd.orgb02ad1c2016-05-04 12:21:53 +0000921environment variable and can be used to select a specific agent.
922Setting the socket name to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000923.Cm none
markus@openbsd.orgb02ad1c2016-05-04 12:21:53 +0000924disables the use of an authentication agent.
markus@openbsd.org1a75d142016-05-04 14:29:58 +0000925If the string
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000926.Qq SSH_AUTH_SOCK
markus@openbsd.org1a75d142016-05-04 14:29:58 +0000927is specified, the location of the socket will be read from the
928.Ev SSH_AUTH_SOCK
929environment variable.
djm@openbsd.org5eff5b82018-10-03 06:38:35 +0000930Otherwise if the specified value begins with a
931.Sq $
932character, then it will be treated as an environment variable containing
933the location of the socket.
markus@openbsd.orgb02ad1c2016-05-04 12:21:53 +0000934.Pp
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000935Arguments to
936.Cm IdentityAgent
937may use the tilde syntax to refer to a user's home directory
938or the tokens described in the
939.Sx TOKENS
940section.
Damien Miller957d4e42005-12-13 19:30:45 +1100941.It Cm IdentityFile
naddy@openbsd.org141df482019-12-21 20:22:34 +0000942Specifies a file from which the user's DSA, ECDSA, authenticator-hosted ECDSA,
943Ed25519, authenticator-hosted Ed25519 or RSA authentication identity is read.
Damien Miller957d4e42005-12-13 19:30:45 +1100944The default is
Damien Millereb8b60e2010-08-31 22:41:14 +1000945.Pa ~/.ssh/id_dsa ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100946.Pa ~/.ssh/id_ecdsa ,
naddy@openbsd.orgaa4c6402019-11-07 08:38:38 +0000947.Pa ~/.ssh/id_ecdsa_sk ,
naddy@openbsd.orgf0edda82019-11-18 23:16:49 +0000948.Pa ~/.ssh/id_ed25519 ,
949.Pa ~/.ssh/id_ed25519_sk
Damien Miller957d4e42005-12-13 19:30:45 +1100950and
djm@openbsd.org788ac792017-04-30 23:18:22 +0000951.Pa ~/.ssh/id_rsa .
Damien Miller957d4e42005-12-13 19:30:45 +1100952Additionally, any identities represented by the authentication agent
Damien Miller7f2b4382013-07-18 16:10:29 +1000953will be used for authentication unless
954.Cm IdentitiesOnly
955is set.
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000956If no certificates have been explicitly specified by
957.Cm CertificateFile ,
Damien Miller5059d8d2010-03-05 21:31:11 +1100958.Xr ssh 1
959will try to load certificate information from the filename obtained by
960appending
961.Pa -cert.pub
962to the path of a specified
963.Cm IdentityFile .
Damien Miller6b1d53c2006-03-31 23:13:21 +1100964.Pp
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000965Arguments to
966.Cm IdentityFile
967may use the tilde syntax to refer to a user's home directory
968or the tokens described in the
969.Sx TOKENS
970section.
Damien Miller6b1d53c2006-03-31 23:13:21 +1100971.Pp
Damien Miller957d4e42005-12-13 19:30:45 +1100972It is possible to have
973multiple identity files specified in configuration files; all these
974identities will be tried in sequence.
Damien Miller6029e072011-06-20 14:22:49 +1000975Multiple
976.Cm IdentityFile
977directives will add to the list of identities tried (this behaviour
978differs from that of other configuration directives).
Damien Miller7f2b4382013-07-18 16:10:29 +1000979.Pp
980.Cm IdentityFile
981may be used in conjunction with
982.Cm IdentitiesOnly
983to select which identities in an agent are offered during authentication.
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000984.Cm IdentityFile
985may also be used in conjunction with
986.Cm CertificateFile
987in order to provide any certificate also needed for authentication with
988the identity.
Darren Tucker63e0df22013-05-16 20:30:31 +1000989.It Cm IgnoreUnknown
990Specifies a pattern-list of unknown options to be ignored if they are
991encountered in configuration parsing.
992This may be used to suppress errors if
993.Nm
994contains options that are unrecognised by
995.Xr ssh 1 .
996It is recommended that
997.Cm IgnoreUnknown
998be listed early in the configuration file as it will not be applied
999to unknown options that appear before it.
djm@openbsd.orgdc7990b2016-04-15 00:30:19 +00001000.It Cm Include
1001Include the specified configuration file(s).
jmc@openbsd.org6aaabc22016-04-17 14:34:46 +00001002Multiple pathnames may be specified and each pathname may contain
kn@openbsd.orgddf1b792018-07-23 19:02:49 +00001003.Xr glob 7
djm@openbsd.orgdc7990b2016-04-15 00:30:19 +00001004wildcards and, for user configurations, shell-like
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001005.Sq ~
djm@openbsd.orgdc7990b2016-04-15 00:30:19 +00001006references to user home directories.
1007Files without absolute paths are assumed to be in
1008.Pa ~/.ssh
jmc@openbsd.org6aaabc22016-04-17 14:34:46 +00001009if included in a user configuration file or
djm@openbsd.orgdc7990b2016-04-15 00:30:19 +00001010.Pa /etc/ssh
1011if included from the system configuration file.
1012.Cm Include
1013directive may appear inside a
1014.Cm Match
1015or
1016.Cm Host
1017block
1018to perform conditional inclusion.
Damien Miller0dac6fb2010-11-20 15:19:38 +11001019.It Cm IPQoS
1020Specifies the IPv4 type-of-service or DSCP class for connections.
1021Accepted values are
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001022.Cm af11 ,
1023.Cm af12 ,
1024.Cm af13 ,
1025.Cm af21 ,
1026.Cm af22 ,
1027.Cm af23 ,
1028.Cm af31 ,
1029.Cm af32 ,
1030.Cm af33 ,
1031.Cm af41 ,
1032.Cm af42 ,
1033.Cm af43 ,
1034.Cm cs0 ,
1035.Cm cs1 ,
1036.Cm cs2 ,
1037.Cm cs3 ,
1038.Cm cs4 ,
1039.Cm cs5 ,
1040.Cm cs6 ,
1041.Cm cs7 ,
1042.Cm ef ,
djm@openbsd.org4594c762020-01-28 01:49:36 +00001043.Cm le ,
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001044.Cm lowdelay ,
1045.Cm throughput ,
1046.Cm reliability ,
djm@openbsd.org51676ec2017-07-23 23:37:02 +00001047a numeric value, or
1048.Cm none
1049to use the operating system default.
Damien Miller928362d2010-12-26 14:26:45 +11001050This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +11001051If one argument is specified, it is used as the packet class unconditionally.
1052If two values are specified, the first is automatically selected for
1053interactive sessions and the second for non-interactive sessions.
1054The default is
job@openbsd.org5ee84482018-04-04 15:12:17 +00001055.Cm af21
jmc@openbsd.org83685712018-04-07 13:50:10 +00001056(Low-Latency Data)
Damien Miller0dac6fb2010-11-20 15:19:38 +11001057for interactive sessions and
job@openbsd.org5ee84482018-04-04 15:12:17 +00001058.Cm cs1
jmc@openbsd.org83685712018-04-07 13:50:10 +00001059(Lower Effort)
Damien Miller0dac6fb2010-11-20 15:19:38 +11001060for non-interactive sessions.
Damien Millercfb606c2007-10-26 14:24:48 +10001061.It Cm KbdInteractiveAuthentication
1062Specifies whether to use keyboard-interactive authentication.
1063The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001064.Cm yes
1065(the default)
Damien Millercfb606c2007-10-26 14:24:48 +10001066or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001067.Cm no .
Darren Tucker636ca902004-11-05 20:22:00 +11001068.It Cm KbdInteractiveDevices
1069Specifies the list of methods to use in keyboard-interactive authentication.
1070Multiple method names must be comma-separated.
1071The default is to use the server specified list.
Damien Miller9cfbaec2006-03-15 11:57:55 +11001072The methods available vary depending on what the server supports.
1073For an OpenSSH server,
1074it may be zero or more of:
Damien Miller87f08be2018-07-20 13:18:28 +10001075.Cm bsdauth
Damien Miller9cfbaec2006-03-15 11:57:55 +11001076and
Damien Miller87f08be2018-07-20 13:18:28 +10001077.Cm pam .
Damien Millerd5f62bf2010-09-24 22:11:14 +10001078.It Cm KexAlgorithms
1079Specifies the available KEX (Key Exchange) algorithms.
1080Multiple algorithms must be comma-separated.
kn@openbsd.orgdc2ca582019-08-16 11:16:32 +00001081If the specified list begins with a
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001082.Sq +
1083character, then the specified methods will be appended to the default set
1084instead of replacing them.
kn@openbsd.orgdc2ca582019-08-16 11:16:32 +00001085If the specified list begins with a
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +00001086.Sq -
1087character, then the specified methods (including wildcards) will be removed
1088from the default set instead of replacing them.
naddy@openbsd.org91a21352019-09-06 14:45:34 +00001089If the specified list begins with a
1090.Sq ^
1091character, then the specified methods will be placed at the head of the
1092default set.
Damien Miller7fe2b1f2010-09-24 22:11:53 +10001093The default is:
1094.Bd -literal -offset indent
djm@openbsd.org16277fc2016-09-22 17:55:13 +00001095curve25519-sha256,curve25519-sha256@libssh.org,
Damien Miller7fe2b1f2010-09-24 22:11:53 +10001096ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
1097diffie-hellman-group-exchange-sha256,
djm@openbsd.org680321f2018-02-16 02:40:45 +00001098diffie-hellman-group16-sha512,
1099diffie-hellman-group18-sha512,
tedu@openbsd.org0b813432020-01-25 07:09:14 +00001100diffie-hellman-group14-sha256
Damien Miller7fe2b1f2010-09-24 22:11:53 +10001101.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001102.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001103The list of available key exchange algorithms may also be obtained using
1104.Qq ssh -Q kex .
Damien Millerd27b9472005-12-13 19:29:02 +11001105.It Cm LocalCommand
1106Specifies a command to execute on the local machine after successfully
1107connecting to the server.
1108The command string extends to the end of the line, and is executed with
Darren Tucker63b31cb2007-12-02 23:09:30 +11001109the user's shell.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001110Arguments to
1111.Cm LocalCommand
1112accept the tokens described in the
1113.Sx TOKENS
1114section.
Darren Tucker78be8c52010-01-08 17:05:59 +11001115.Pp
1116The command is run synchronously and does not have access to the
1117session of the
1118.Xr ssh 1
1119that spawned it.
1120It should not be used for interactive commands.
1121.Pp
Damien Millerd27b9472005-12-13 19:29:02 +11001122This directive is ignored unless
1123.Cm PermitLocalCommand
1124has been enabled.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001125.It Cm LocalForward
Damien Millere9d001e2006-01-14 10:10:17 +11001126Specifies that a TCP port on the local machine be forwarded over
Ben Lindstrom9f049032002-06-21 00:59:05 +00001127the secure channel to the specified host and port from the remote machine.
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001128The first argument must be
Damien Millerf91ee4c2005-03-01 21:24:33 +11001129.Sm off
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001130.Oo Ar bind_address : Oc Ar port
Damien Millerf91ee4c2005-03-01 21:24:33 +11001131.Sm on
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001132and the second argument must be
1133.Ar host : Ns Ar hostport .
Damien Miller7fa96602010-08-05 13:03:13 +10001134IPv6 addresses can be specified by enclosing addresses in square brackets.
Damien Millerf8c55462005-03-02 12:03:05 +11001135Multiple forwardings may be specified, and additional forwardings can be
Damien Millerf91ee4c2005-03-01 21:24:33 +11001136given on the command line.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001137Only the superuser can forward privileged ports.
Damien Millerf91ee4c2005-03-01 21:24:33 +11001138By default, the local port is bound in accordance with the
1139.Cm GatewayPorts
1140setting.
1141However, an explicit
1142.Ar bind_address
1143may be used to bind the connection to a specific address.
1144The
1145.Ar bind_address
1146of
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001147.Cm localhost
Damien Millerf8c55462005-03-02 12:03:05 +11001148indicates that the listening port be bound for local use only, while an
1149empty address or
1150.Sq *
Damien Millerf91ee4c2005-03-01 21:24:33 +11001151indicates that the port should be available from all interfaces.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001152.It Cm LogLevel
1153Gives the verbosity level that is used when logging messages from
Damien Miller45ee2b92006-03-15 11:56:18 +11001154.Xr ssh 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001155The possible values are:
Damien Miller45ee2b92006-03-15 11:56:18 +11001156QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +10001157The default is INFO.
1158DEBUG and DEBUG1 are equivalent.
1159DEBUG2 and DEBUG3 each specify higher levels of verbose output.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001160.It Cm MACs
1161Specifies the MAC (message authentication code) algorithms
1162in order of preference.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +00001163The MAC algorithm is used for data integrity protection.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001164Multiple algorithms must be comma-separated.
kn@openbsd.orgdc2ca582019-08-16 11:16:32 +00001165If the specified list begins with a
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001166.Sq +
1167character, then the specified algorithms will be appended to the default set
1168instead of replacing them.
kn@openbsd.orgdc2ca582019-08-16 11:16:32 +00001169If the specified list begins with a
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +00001170.Sq -
1171character, then the specified algorithms (including wildcards) will be removed
1172from the default set instead of replacing them.
naddy@openbsd.org91a21352019-09-06 14:45:34 +00001173If the specified list begins with a
1174.Sq ^
1175character, then the specified algorithms will be placed at the head of the
1176default set.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001177.Pp
Damien Milleraf43a7a2012-12-12 10:46:31 +11001178The algorithms that contain
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001179.Qq -etm
Damien Milleraf43a7a2012-12-12 10:46:31 +11001180calculate the MAC after encryption (encrypt-then-mac).
1181These are considered safer and their use recommended.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001182.Pp
Damien Miller45ee2b92006-03-15 11:56:18 +11001183The default is:
Damien Miller5e7c30b2007-06-11 14:06:32 +10001184.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +11001185umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1186hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001187hmac-sha1-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +10001188umac-64@openssh.com,umac-128@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001189hmac-sha2-256,hmac-sha2-512,hmac-sha1
Damien Miller5e7c30b2007-06-11 14:06:32 +10001190.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001191.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001192The list of available MAC algorithms may also be obtained using
1193.Qq ssh -Q mac .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001194.It Cm NoHostAuthenticationForLocalhost
djm@openbsd.org4f011da2018-02-10 06:40:28 +00001195Disable host authentication for localhost (loopback addresses).
Ben Lindstrom9f049032002-06-21 00:59:05 +00001196The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001197.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +00001198or
jmc@openbsd.org78142e32017-02-27 14:30:33 +00001199.Cm no
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001200(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +00001201.It Cm NumberOfPasswordPrompts
1202Specifies the number of password prompts before giving up.
1203The argument to this keyword must be an integer.
Damien Miller45ee2b92006-03-15 11:56:18 +11001204The default is 3.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001205.It Cm PasswordAuthentication
1206Specifies whether to use password authentication.
1207The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001208.Cm yes
1209(the default)
Ben Lindstrom9f049032002-06-21 00:59:05 +00001210or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001211.Cm no .
Damien Millerd27b9472005-12-13 19:29:02 +11001212.It Cm PermitLocalCommand
1213Allow local command execution via the
1214.Ic LocalCommand
1215option or using the
Damien Miller4b2319f2005-12-13 19:30:27 +11001216.Ic !\& Ns Ar command
Damien Millerd27b9472005-12-13 19:29:02 +11001217escape sequence in
1218.Xr ssh 1 .
1219The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001220.Cm yes
Damien Millerd27b9472005-12-13 19:29:02 +11001221or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001222.Cm no
1223(the default).
Damien Miller7ea845e2010-02-12 09:21:02 +11001224.It Cm PKCS11Provider
djm@openbsd.orgde817e92019-03-01 02:16:47 +00001225Specifies which PKCS#11 provider to use or
1226.Cm none
1227to indicate that no provider should be used (the default).
1228The argument to this keyword is a path to the PKCS#11 shared library
Damien Miller7ea845e2010-02-12 09:21:02 +11001229.Xr ssh 1
djm@openbsd.orgde817e92019-03-01 02:16:47 +00001230should use to communicate with a PKCS#11 token providing keys for user
1231authentication.
Damien Miller957d4e42005-12-13 19:30:45 +11001232.It Cm Port
1233Specifies the port number to connect on the remote host.
Damien Miller45ee2b92006-03-15 11:56:18 +11001234The default is 22.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001235.It Cm PreferredAuthentications
jmc@openbsd.orga685ae82016-02-17 07:38:19 +00001236Specifies the order in which the client should try authentication methods.
Darren Tucker1adc2bd2005-03-14 23:14:20 +11001237This allows a client to prefer one method (e.g.\&
Ben Lindstrom9f049032002-06-21 00:59:05 +00001238.Cm keyboard-interactive )
Darren Tucker1adc2bd2005-03-14 23:14:20 +11001239over another method (e.g.\&
Damien Miller544378d2010-04-16 15:52:24 +10001240.Cm password ) .
1241The default is:
1242.Bd -literal -offset indent
1243gssapi-with-mic,hostbased,publickey,
1244keyboard-interactive,password
1245.Ed
Ben Lindstrom9f049032002-06-21 00:59:05 +00001246.It Cm ProxyCommand
1247Specifies the command to use to connect to the server.
1248The command
Damien Miller079bac22014-07-09 13:06:25 +10001249string extends to the end of the line, and is executed
1250using the user's shell
1251.Ql exec
1252directive to avoid a lingering shell process.
1253.Pp
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001254Arguments to
1255.Cm ProxyCommand
1256accept the tokens described in the
1257.Sx TOKENS
1258section.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001259The command can be basically anything,
1260and should read from its standard input and write to its standard output.
1261It should eventually connect an
1262.Xr sshd 8
1263server running on some machine, or execute
1264.Ic sshd -i
1265somewhere.
1266Host key management will be done using the
jmc@openbsd.org73491492019-06-12 11:31:50 +00001267.Cm Hostname
1268of the host being connected (defaulting to the name typed by the user).
Damien Miller495dca32003-04-01 21:42:14 +10001269Setting the command to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001270.Cm none
Damien Miller9f1e33a2003-02-24 11:57:32 +11001271disables this option entirely.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001272Note that
1273.Cm CheckHostIP
1274is not available for connects with a proxy command.
1275.Pp
Damien Millerebcfedc2005-05-26 12:13:56 +10001276This directive is useful in conjunction with
1277.Xr nc 1
1278and its proxy support.
Damien Millerdfec2942005-05-26 12:14:32 +10001279For example, the following directive would connect via an HTTP proxy at
Damien Millerebcfedc2005-05-26 12:13:56 +10001280192.0.2.0:
1281.Bd -literal -offset 3n
1282ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p
1283.Ed
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001284.It Cm ProxyJump
millert@openbsd.org887669e2017-10-21 23:06:24 +00001285Specifies one or more jump proxies as either
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001286.Xo
1287.Sm off
jmc@openbsd.orge4eb7d92016-07-16 06:57:55 +00001288.Op Ar user No @
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001289.Ar host
jmc@openbsd.orge4eb7d92016-07-16 06:57:55 +00001290.Op : Ns Ar port
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001291.Sm on
millert@openbsd.org887669e2017-10-21 23:06:24 +00001292or an ssh URI
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001293.Xc .
djm@openbsd.org286f5a72016-07-22 03:35:11 +00001294Multiple proxies may be separated by comma characters and will be visited
djm@openbsd.orgf00211e2016-07-22 07:00:46 +00001295sequentially.
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001296Setting this option will cause
1297.Xr ssh 1
1298to connect to the target host by first making a
1299.Xr ssh 1
1300connection to the specified
1301.Cm ProxyJump
1302host and then establishing a
jmc@openbsd.orge4eb7d92016-07-16 06:57:55 +00001303TCP forwarding to the ultimate target from there.
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001304.Pp
1305Note that this option will compete with the
1306.Cm ProxyCommand
1307option - whichever is specified first will prevent later instances of the
1308other from taking effect.
djm@openbsd.org7a2cb182019-01-22 11:51:25 +00001309.Pp
1310Note also that the configuration for the destination host (either supplied
1311via the command-line or the configuration file) is not generally applied
1312to jump hosts.
1313.Pa ~/.ssh/config
1314should be used if specific configuration is required for jump hosts.
Damien Miller1262b662013-08-21 02:44:24 +10001315.It Cm ProxyUseFdpass
Damien Millerf2f6c312013-08-21 02:44:58 +10001316Specifies that
Damien Miller1262b662013-08-21 02:44:24 +10001317.Cm ProxyCommand
1318will pass a connected file descriptor back to
Damien Millerf2f6c312013-08-21 02:44:58 +10001319.Xr ssh 1
Damien Miller1262b662013-08-21 02:44:24 +10001320instead of continuing to execute and pass data.
1321The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001322.Cm no .
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001323.It Cm PubkeyAcceptedKeyTypes
1324Specifies the key types that will be used for public key authentication
djm@openbsd.org312d2f22018-07-04 13:49:31 +00001325as a comma-separated list of patterns.
kn@openbsd.orgdc2ca582019-08-16 11:16:32 +00001326If the specified list begins with a
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001327.Sq +
1328character, then the key types after it will be appended to the default
1329instead of replacing it.
kn@openbsd.orgdc2ca582019-08-16 11:16:32 +00001330If the specified list begins with a
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +00001331.Sq -
1332character, then the specified key types (including wildcards) will be removed
1333from the default set instead of replacing them.
naddy@openbsd.org91a21352019-09-06 14:45:34 +00001334If the specified list begins with a
1335.Sq ^
1336character, then the specified key types will be placed at the head of the
1337default set.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001338The default for this option is:
1339.Bd -literal -offset 3n
1340ecdsa-sha2-nistp256-cert-v01@openssh.com,
1341ecdsa-sha2-nistp384-cert-v01@openssh.com,
1342ecdsa-sha2-nistp521-cert-v01@openssh.com,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +00001343sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001344ssh-ed25519-cert-v01@openssh.com,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +00001345sk-ssh-ed25519-cert-v01@openssh.com,
naddy@openbsd.orgaa4c6402019-11-07 08:38:38 +00001346rsa-sha2-512-cert-v01@openssh.com,
1347rsa-sha2-256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001348ssh-rsa-cert-v01@openssh.com,
1349ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +00001350sk-ecdsa-sha2-nistp256@openssh.com,
1351ssh-ed25519,sk-ssh-ed25519@openssh.com,
1352rsa-sha2-512,rsa-sha2-256,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001353.Ed
1354.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001355The list of available key types may also be obtained using
dtucker@openbsd.orgd4d9e1d2020-02-07 03:54:44 +00001356.Qq ssh -Q PubkeyAcceptedKeyTypes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001357.It Cm PubkeyAuthentication
1358Specifies whether to try public key authentication.
1359The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001360.Cm yes
1361(the default)
Ben Lindstrom9f049032002-06-21 00:59:05 +00001362or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001363.Cm no .
Darren Tucker62388b22006-01-20 11:31:47 +11001364.It Cm RekeyLimit
1365Specifies the maximum amount of data that may be transmitted before the
Darren Tuckerc53c2af2013-05-16 20:28:16 +10001366session key is renegotiated, optionally followed a maximum amount of
1367time that may pass before the session key is renegotiated.
1368The first argument is specified in bytes and may have a suffix of
Damien Millerddfddf12006-01-31 21:39:03 +11001369.Sq K ,
1370.Sq M ,
Darren Tucker62388b22006-01-20 11:31:47 +11001371or
Damien Millerddfddf12006-01-31 21:39:03 +11001372.Sq G
Darren Tucker62388b22006-01-20 11:31:47 +11001373to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1374The default is between
Damien Miller45ee2b92006-03-15 11:56:18 +11001375.Sq 1G
Darren Tucker62388b22006-01-20 11:31:47 +11001376and
Damien Miller45ee2b92006-03-15 11:56:18 +11001377.Sq 4G ,
Darren Tucker62388b22006-01-20 11:31:47 +11001378depending on the cipher.
Darren Tuckerc53c2af2013-05-16 20:28:16 +10001379The optional second value is specified in seconds and may use any of the
schwarze@openbsd.orgdb7606d2019-05-14 12:47:17 +00001380units documented in the TIME FORMATS section of
Darren Tuckerc53c2af2013-05-16 20:28:16 +10001381.Xr sshd_config 5 .
1382The default value for
1383.Cm RekeyLimit
1384is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001385.Cm default none ,
Darren Tuckerc53c2af2013-05-16 20:28:16 +10001386which means that rekeying is performed after the cipher's default amount
1387of data has been sent or received and no time based rekeying is done.
bluhm@openbsd.org1112b532017-05-30 18:58:37 +00001388.It Cm RemoteCommand
1389Specifies a command to execute on the remote machine after successfully
1390connecting to the server.
1391The command string extends to the end of the line, and is executed with
1392the user's shell.
jmc@openbsd.orga3bb2502017-05-30 19:38:17 +00001393Arguments to
1394.Cm RemoteCommand
1395accept the tokens described in the
1396.Sx TOKENS
1397section.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001398.It Cm RemoteForward
Damien Millere9d001e2006-01-14 10:10:17 +11001399Specifies that a TCP port on the remote machine be forwarded over
markus@openbsd.org609d7a62017-09-21 19:16:53 +00001400the secure channel.
djm@openbsd.org001aa552018-04-10 00:10:49 +00001401The remote port may either be forwarded to a specified host and port
markus@openbsd.org609d7a62017-09-21 19:16:53 +00001402from the local machine, or may act as a SOCKS 4/5 proxy that allows a remote
1403client to connect to arbitrary destinations from the local machine.
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001404The first argument must be
Damien Millerf91ee4c2005-03-01 21:24:33 +11001405.Sm off
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001406.Oo Ar bind_address : Oc Ar port
Damien Millerf91ee4c2005-03-01 21:24:33 +11001407.Sm on
markus@openbsd.org609d7a62017-09-21 19:16:53 +00001408If forwarding to a specific destination then the second argument must be
1409.Ar host : Ns Ar hostport ,
1410otherwise if no destination argument is specified then the remote forwarding
1411will be established as a SOCKS proxy.
1412.Pp
Damien Miller7fa96602010-08-05 13:03:13 +10001413IPv6 addresses can be specified by enclosing addresses in square brackets.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001414Multiple forwardings may be specified, and additional
1415forwardings can be given on the command line.
Damien Millerde7532e2008-11-03 19:24:45 +11001416Privileged ports can be forwarded only when
1417logging in as root on the remote machine.
Damien Millere379e102009-02-14 16:34:39 +11001418.Pp
Damien Miller85c6d8a2009-02-14 16:34:21 +11001419If the
1420.Ar port
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001421argument is 0,
Damien Miller85c6d8a2009-02-14 16:34:21 +11001422the listen port will be dynamically allocated on the server and reported
1423to the client at run time.
Damien Millerf91ee4c2005-03-01 21:24:33 +11001424.Pp
1425If the
1426.Ar bind_address
1427is not specified, the default is to only bind to loopback addresses.
1428If the
1429.Ar bind_address
1430is
1431.Ql *
1432or an empty string, then the forwarding is requested to listen on all
1433interfaces.
1434Specifying a remote
1435.Ar bind_address
Damien Millerf8c55462005-03-02 12:03:05 +11001436will only succeed if the server's
1437.Cm GatewayPorts
Damien Millerf91ee4c2005-03-01 21:24:33 +11001438option is enabled (see
Damien Millerf8c55462005-03-02 12:03:05 +11001439.Xr sshd_config 5 ) .
Damien Miller21771e22011-05-15 08:45:50 +10001440.It Cm RequestTTY
1441Specifies whether to request a pseudo-tty for the session.
1442The argument may be one of:
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001443.Cm no
Damien Miller21771e22011-05-15 08:45:50 +10001444(never request a TTY),
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001445.Cm yes
Damien Miller21771e22011-05-15 08:45:50 +10001446(always request a TTY when standard input is a TTY),
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001447.Cm force
Damien Miller21771e22011-05-15 08:45:50 +10001448(always request a TTY) or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001449.Cm auto
Damien Miller21771e22011-05-15 08:45:50 +10001450(request a TTY when opening a login session).
1451This option mirrors the
1452.Fl t
1453and
1454.Fl T
1455flags for
1456.Xr ssh 1 .
djm@openbsd.org5e39a492014-12-04 02:24:32 +00001457.It Cm RevokedHostKeys
1458Specifies revoked host public keys.
1459Keys listed in this file will be refused for host authentication.
1460Note that if this file does not exist or is not readable,
1461then host authentication will be refused for all hosts.
1462Keys may be specified as a text file, listing one public key per line, or as
1463an OpenSSH Key Revocation List (KRL) as generated by
1464.Xr ssh-keygen 1 .
1465For more information on KRLs, see the KEY REVOCATION LISTS section in
1466.Xr ssh-keygen 1 .
naddy@openbsd.orgaa4c6402019-11-07 08:38:38 +00001467.It Cm SecurityKeyProvider
naddy@openbsd.org141df482019-12-21 20:22:34 +00001468Specifies a path to a library that will be used when loading any
1469FIDO authenticator-hosted keys, overriding the default of using
1470the built-in USB HID support.
naddy@openbsd.org2cf262c2019-11-18 23:17:48 +00001471.Pp
1472If the specified value begins with a
1473.Sq $
1474character, then it will be treated as an environment variable containing
1475the path to the library.
Darren Tucker46bc0752004-05-02 22:11:30 +10001476.It Cm SendEnv
1477Specifies what variables from the local
1478.Xr environ 7
1479should be sent to the server.
Damien Miller45ee2b92006-03-15 11:56:18 +11001480The server must also support it, and the server must be configured to
Darren Tucker1e0c9bf2004-05-02 22:12:48 +10001481accept these environment variables.
dtucker@openbsd.org85b96ef2015-04-28 10:17:58 +00001482Note that the
1483.Ev TERM
jmc@openbsd.orgc1d5bcf2015-04-28 13:47:38 +00001484environment variable is always sent whenever a
dtucker@openbsd.org85b96ef2015-04-28 10:17:58 +00001485pseudo-terminal is requested as it is required by the protocol.
Darren Tucker46bc0752004-05-02 22:11:30 +10001486Refer to
1487.Cm AcceptEnv
1488in
1489.Xr sshd_config 5
1490for how to configure the server.
Damien Miller6def5512006-03-15 11:54:05 +11001491Variables are specified by name, which may contain wildcard characters.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +10001492Multiple environment variables may be separated by whitespace or spread
Darren Tucker46bc0752004-05-02 22:11:30 +10001493across multiple
1494.Cm SendEnv
1495directives.
Damien Millerf54a4b92006-03-15 11:54:36 +11001496.Pp
1497See
1498.Sx PATTERNS
1499for more information on patterns.
djm@openbsd.org555294a2018-04-06 13:02:39 +00001500.Pp
jmc@openbsd.org83685712018-04-07 13:50:10 +00001501It is possible to clear previously set
djm@openbsd.org555294a2018-04-06 13:02:39 +00001502.Cm SendEnv
1503variable names by prefixing patterns with
1504.Pa - .
1505The default is not to send any environment variables.
Damien Miller509b0102003-12-17 16:33:10 +11001506.It Cm ServerAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +11001507Sets the number of server alive messages (see below) which may be
Damien Miller509b0102003-12-17 16:33:10 +11001508sent without
Damien Miller45ee2b92006-03-15 11:56:18 +11001509.Xr ssh 1
Damien Miller509b0102003-12-17 16:33:10 +11001510receiving any messages back from the server.
1511If this threshold is reached while server alive messages are being sent,
Damien Miller45ee2b92006-03-15 11:56:18 +11001512ssh will disconnect from the server, terminating the session.
Damien Miller509b0102003-12-17 16:33:10 +11001513It is important to note that the use of server alive messages is very
1514different from
1515.Cm TCPKeepAlive
1516(below).
1517The server alive messages are sent through the encrypted channel
1518and therefore will not be spoofable.
1519The TCP keepalive option enabled by
1520.Cm TCPKeepAlive
1521is spoofable.
1522The server alive mechanism is valuable when the client or
dtucker@openbsd.org8fdbc722019-08-09 04:24:03 +00001523server depend on knowing when a connection has become unresponsive.
Damien Miller509b0102003-12-17 16:33:10 +11001524.Pp
1525The default value is 3.
1526If, for example,
1527.Cm ServerAliveInterval
Damien Miller45ee2b92006-03-15 11:56:18 +11001528(see below) is set to 15 and
Damien Miller509b0102003-12-17 16:33:10 +11001529.Cm ServerAliveCountMax
Damien Miller45ee2b92006-03-15 11:56:18 +11001530is left at the default, if the server becomes unresponsive,
1531ssh will disconnect after approximately 45 seconds.
Damien Miller957d4e42005-12-13 19:30:45 +11001532.It Cm ServerAliveInterval
1533Sets a timeout interval in seconds after which if no data has been received
1534from the server,
Damien Miller45ee2b92006-03-15 11:56:18 +11001535.Xr ssh 1
Damien Miller957d4e42005-12-13 19:30:45 +11001536will send a message through the encrypted
1537channel to request a response from the server.
1538The default
1539is 0, indicating that these messages will not be sent to the server.
jmc@openbsd.orgacf42602018-06-09 06:36:31 +00001540.It Cm SetEnv
1541Directly specify one or more environment variables and their contents to
1542be sent to the server.
1543Similarly to
1544.Cm SendEnv ,
1545the server must be prepared to accept the environment variable.
Damien Miller7acefbb2014-07-18 14:11:24 +10001546.It Cm StreamLocalBindMask
1547Sets the octal file creation mode mask
1548.Pq umask
1549used when creating a Unix-domain socket file for local or remote
1550port forwarding.
1551This option is only used for port forwarding to a Unix-domain socket file.
1552.Pp
1553The default value is 0177, which creates a Unix-domain socket file that is
1554readable and writable only by the owner.
1555Note that not all operating systems honor the file mode on Unix-domain
1556socket files.
1557.It Cm StreamLocalBindUnlink
1558Specifies whether to remove an existing Unix-domain socket file for local
1559or remote port forwarding before creating a new one.
1560If the socket file already exists and
1561.Cm StreamLocalBindUnlink
1562is not enabled,
1563.Nm ssh
1564will be unable to forward the port to the Unix-domain socket file.
1565This option is only used for port forwarding to a Unix-domain socket file.
1566.Pp
1567The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001568.Cm yes
Damien Miller7acefbb2014-07-18 14:11:24 +10001569or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001570.Cm no
1571(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +00001572.It Cm StrictHostKeyChecking
1573If this flag is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001574.Cm yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +11001575.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001576will never automatically add host keys to the
Damien Miller167ea5d2005-05-26 12:04:02 +10001577.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +00001578file, and refuses to connect to hosts whose host key has changed.
dtucker@openbsd.org3e615092018-02-06 06:01:54 +00001579This provides maximum protection against man-in-the-middle (MITM) attacks,
Damien Miller45ee2b92006-03-15 11:56:18 +11001580though it can be annoying when the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001581.Pa /etc/ssh/ssh_known_hosts
Damien Miller45ee2b92006-03-15 11:56:18 +11001582file is poorly maintained or when connections to new hosts are
Ben Lindstrom9f049032002-06-21 00:59:05 +00001583frequently made.
1584This option forces the user to manually
1585add all new hosts.
jmc@openbsd.org149a8cd2017-09-04 06:34:43 +00001586.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001587If this flag is set to
djm@openbsd.org22376d22017-09-03 23:33:13 +00001588.Dq accept-new
jmc@openbsd.org149a8cd2017-09-04 06:34:43 +00001589then ssh will automatically add new host keys to the user
djm@openbsd.org22376d22017-09-03 23:33:13 +00001590known hosts files, but will not permit connections to hosts with
1591changed host keys.
1592If this flag is set to
1593.Dq no
1594or
1595.Dq off ,
jmc@openbsd.org149a8cd2017-09-04 06:34:43 +00001596ssh will automatically add new host keys to the user known hosts files
1597and allow connections to hosts with changed hostkeys to proceed,
1598subject to some restrictions.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001599If this flag is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001600.Cm ask
1601(the default),
Ben Lindstrom9f049032002-06-21 00:59:05 +00001602new host keys
1603will be added to the user known host files only after the user
1604has confirmed that is what they really want to do, and
Damien Miller45ee2b92006-03-15 11:56:18 +11001605ssh will refuse to connect to hosts whose host key has changed.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001606The host keys of
1607known hosts will be verified automatically in all cases.
jmc@openbsd.org47a287b2017-04-28 06:15:03 +00001608.It Cm SyslogFacility
1609Gives the facility code that is used when logging messages from
1610.Xr ssh 1 .
1611The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1612LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1613The default is USER.
Damien Miller12c150e2003-12-17 16:31:10 +11001614.It Cm TCPKeepAlive
1615Specifies whether the system should send TCP keepalive messages to the
1616other side.
1617If they are sent, death of the connection or crash of one
1618of the machines will be properly noticed.
1619However, this means that
1620connections will die if the route is down temporarily, and some people
1621find it annoying.
1622.Pp
1623The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001624.Cm yes
Damien Miller12c150e2003-12-17 16:31:10 +11001625(to send TCP keepalive messages), and the client will notice
1626if the network goes down or the remote host dies.
1627This is important in scripts, and many users want it too.
1628.Pp
1629To disable TCP keepalive messages, the value should be set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001630.Cm no .
djm@openbsd.orga7c38212018-02-10 09:03:54 +00001631See also
1632.Cm ServerAliveInterval
1633for protocol-level keepalives.
Damien Millerd27b9472005-12-13 19:29:02 +11001634.It Cm Tunnel
Damien Miller991dba42006-07-10 20:16:27 +10001635Request
Damien Millerd27b9472005-12-13 19:29:02 +11001636.Xr tun 4
Damien Miller7746c392005-12-13 19:33:37 +11001637device forwarding between the client and the server.
Damien Millerd27b9472005-12-13 19:29:02 +11001638The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001639.Cm yes ,
1640.Cm point-to-point
Damien Miller991dba42006-07-10 20:16:27 +10001641(layer 3),
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001642.Cm ethernet
Damien Miller991dba42006-07-10 20:16:27 +10001643(layer 2),
Damien Millerd27b9472005-12-13 19:29:02 +11001644or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001645.Cm no
1646(the default).
Damien Miller991dba42006-07-10 20:16:27 +10001647Specifying
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001648.Cm yes
Damien Miller991dba42006-07-10 20:16:27 +10001649requests the default tunnel mode, which is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001650.Cm point-to-point .
Damien Millerd27b9472005-12-13 19:29:02 +11001651.It Cm TunnelDevice
Damien Miller991dba42006-07-10 20:16:27 +10001652Specifies the
Damien Millerd27b9472005-12-13 19:29:02 +11001653.Xr tun 4
Damien Miller991dba42006-07-10 20:16:27 +10001654devices to open on the client
1655.Pq Ar local_tun
1656and the server
1657.Pq Ar remote_tun .
1658.Pp
1659The argument must be
1660.Sm off
1661.Ar local_tun Op : Ar remote_tun .
1662.Sm on
1663The devices may be specified by numerical ID or the keyword
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001664.Cm any ,
Damien Miller991dba42006-07-10 20:16:27 +10001665which uses the next available tunnel device.
1666If
1667.Ar remote_tun
1668is not specified, it defaults to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001669.Cm any .
Damien Miller991dba42006-07-10 20:16:27 +10001670The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001671.Cm any:any .
djm@openbsd.org1d1092b2015-01-26 12:16:36 +00001672.It Cm UpdateHostKeys
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001673Specifies whether
1674.Xr ssh 1
1675should accept notifications of additional hostkeys from the server sent
1676after authentication has completed and add them to
1677.Cm UserKnownHostsFile .
1678The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001679.Cm yes ,
1680.Cm no
djm@openbsd.org771891a2020-01-30 22:25:34 +00001681or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001682.Cm ask .
djm@openbsd.org771891a2020-01-30 22:25:34 +00001683This option allows learning alternate hostkeys for a server
djm@openbsd.org1d1092b2015-01-26 12:16:36 +00001684and supports graceful key rotation by allowing a server to send replacement
1685public keys before old ones are removed.
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001686Additional hostkeys are only accepted if the key used to authenticate the
sobrado@openbsd.orge3cbb062015-09-22 08:33:23 +00001687host was already trusted or explicitly accepted by the user.
djm@openbsd.org771891a2020-01-30 22:25:34 +00001688.Pp
1689.Cm UpdateHostKeys
jmc@openbsd.orgba261a12020-01-31 22:25:59 +00001690is enabled by default if the user has not overridden the default
djm@openbsd.org771891a2020-01-30 22:25:34 +00001691.Cm UserKnownHostsFile
1692setting, otherwise
1693.Cm UpdateHostKeys
1694will be set to
1695.Cm ask .
1696.Pp
djm@openbsd.org523463a2015-02-16 22:13:32 +00001697If
1698.Cm UpdateHostKeys
1699is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001700.Cm ask ,
djm@openbsd.org523463a2015-02-16 22:13:32 +00001701then the user is asked to confirm the modifications to the known_hosts file.
djm@openbsd.org44732de2015-02-20 22:17:21 +00001702Confirmation is currently incompatible with
1703.Cm ControlPersist ,
1704and will be disabled if it is enabled.
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001705.Pp
1706Presently, only
1707.Xr sshd 8
1708from OpenSSH 6.8 and greater support the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001709.Qq hostkeys@openssh.com
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001710protocol extension used to inform the client of all the server's hostkeys.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001711.It Cm User
1712Specifies the user to log in as.
1713This can be useful when a different user name is used on different machines.
1714This saves the trouble of
1715having to remember to give the user name on the command line.
1716.It Cm UserKnownHostsFile
Damien Miller295ee632011-05-29 21:42:31 +10001717Specifies one or more files to use for the user
1718host key database, separated by whitespace.
1719The default is
1720.Pa ~/.ssh/known_hosts ,
1721.Pa ~/.ssh/known_hosts2 .
Damien Miller37876e92003-05-15 10:19:46 +10001722.It Cm VerifyHostKeyDNS
1723Specifies whether to verify the remote key using DNS and SSHFP resource
1724records.
Damien Miller150b5572003-11-17 21:19:29 +11001725If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001726.Cm yes ,
Damien Millerfe448472003-11-17 21:19:49 +11001727the client will implicitly trust keys that match a secure fingerprint
Damien Miller150b5572003-11-17 21:19:29 +11001728from DNS.
1729Insecure fingerprints will be handled as if this option was set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001730.Cm ask .
Damien Miller150b5572003-11-17 21:19:29 +11001731If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001732.Cm ask ,
Damien Miller150b5572003-11-17 21:19:29 +11001733information on fingerprint match will be displayed, but the user will still
1734need to confirm new host keys according to the
1735.Cm StrictHostKeyChecking
1736option.
Damien Miller37876e92003-05-15 10:19:46 +10001737The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001738.Cm no .
Damien Miller45ee2b92006-03-15 11:56:18 +11001739.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001740See also
1741.Sx VERIFYING HOST KEYS
1742in
Damien Miller45ee2b92006-03-15 11:56:18 +11001743.Xr ssh 1 .
Damien Miller10288242008-06-30 00:04:03 +10001744.It Cm VisualHostKey
1745If this flag is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001746.Cm yes ,
Damien Miller10288242008-06-30 00:04:03 +10001747an ASCII art representation of the remote host key fingerprint is
djm@openbsd.orgb79efde2014-12-21 23:12:42 +00001748printed in addition to the fingerprint string at login and
Damien Millera414cd32008-11-03 19:25:21 +11001749for unknown host keys.
Damien Miller10288242008-06-30 00:04:03 +10001750If this flag is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001751.Cm no
1752(the default),
Damien Millera414cd32008-11-03 19:25:21 +11001753no fingerprint strings are printed at login and
djm@openbsd.orgb79efde2014-12-21 23:12:42 +00001754only the fingerprint string will be printed for unknown host keys.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001755.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001756Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001757.Xr xauth 1
1758program.
1759The default is
1760.Pa /usr/X11R6/bin/xauth .
1761.El
Damien Millerb5282c22006-03-15 11:59:08 +11001762.Sh PATTERNS
1763A
1764.Em pattern
1765consists of zero or more non-whitespace characters,
1766.Sq *
1767(a wildcard that matches zero or more characters),
1768or
1769.Sq ?\&
1770(a wildcard that matches exactly one character).
1771For example, to specify a set of declarations for any host in the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001772.Qq .co.uk
Damien Millerb5282c22006-03-15 11:59:08 +11001773set of domains,
1774the following pattern could be used:
1775.Pp
1776.Dl Host *.co.uk
1777.Pp
1778The following pattern
1779would match any host in the 192.168.0.[0-9] network range:
1780.Pp
1781.Dl Host 192.168.0.?
1782.Pp
1783A
1784.Em pattern-list
1785is a comma-separated list of patterns.
1786Patterns within pattern-lists may be negated
1787by preceding them with an exclamation mark
1788.Pq Sq !\& .
1789For example,
Damien Miller51682fa2013-10-17 11:48:31 +11001790to allow a key to be used from anywhere within an organization
Damien Millerb5282c22006-03-15 11:59:08 +11001791except from the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001792.Qq dialup
Damien Millerb5282c22006-03-15 11:59:08 +11001793pool,
1794the following entry (in authorized_keys) could be used:
1795.Pp
1796.Dl from=\&"!*.dialup.example.com,*.example.com\&"
djm@openbsd.org05b69e92017-10-18 02:49:44 +00001797.Pp
1798Note that a negated match will never produce a positive result by itself.
1799For example, attempting to match
1800.Qq host3
1801against the following pattern-list will fail:
1802.Pp
1803.Dl from=\&"!host1,!host2\&"
1804.Pp
1805The solution here is to include a term that will yield a positive match,
1806such as a wildcard:
1807.Pp
1808.Dl from=\&"!host1,!host2,*\&"
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001809.Sh TOKENS
1810Arguments to some keywords can make use of tokens,
1811which are expanded at runtime:
1812.Pp
1813.Bl -tag -width XXXX -offset indent -compact
1814.It %%
1815A literal
1816.Sq % .
1817.It \&%C
jmc@openbsd.org2b4f3ab2017-10-05 12:56:50 +00001818Hash of %l%h%p%r.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001819.It %d
1820Local user's home directory.
1821.It %h
1822The remote hostname.
1823.It %i
1824The local user ID.
1825.It %L
1826The local hostname.
1827.It %l
1828The local hostname, including the domain name.
1829.It %n
1830The original remote hostname, as given on the command line.
1831.It %p
1832The remote port.
1833.It %r
1834The remote username.
djm@openbsd.orgb7548b12017-10-23 05:08:00 +00001835.It \&%T
1836The local
1837.Xr tun 4
1838or
1839.Xr tap 4
1840network interface assigned if
jmc@openbsd.org08696272017-10-24 06:27:42 +00001841tunnel forwarding was requested, or
1842.Qq NONE
djm@openbsd.orgb7548b12017-10-23 05:08:00 +00001843otherwise.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001844.It %u
1845The local username.
1846.El
1847.Pp
dtucker@openbsd.orged833da2020-04-03 02:27:12 +00001848.Cm Match exec ,
1849.Cm CertificateFile ,
1850.Cm ControlPath ,
1851.Cm IdentityAgent ,
1852.Cm IdentityFile ,
1853and
1854.Cm RemoteCommand
1855accept the tokens %%, %C, %d, %h, %i, %L, %l, %n, %p, %r, and %u.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001856.Pp
jmc@openbsd.org76af9c52019-06-12 05:53:21 +00001857.Cm Hostname
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001858accepts the tokens %% and %h.
1859.Pp
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001860.Cm LocalCommand
dtucker@openbsd.orged833da2020-04-03 02:27:12 +00001861accepts all tokens.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001862.Pp
1863.Cm ProxyCommand
djm@openbsd.orgfbe24b12019-09-13 04:27:35 +00001864accepts the tokens %%, %h, %n, %p, and %r.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001865.Sh FILES
1866.Bl -tag -width Ds
Damien Miller167ea5d2005-05-26 12:04:02 +10001867.It Pa ~/.ssh/config
Ben Lindstrom9f049032002-06-21 00:59:05 +00001868This is the per-user configuration file.
1869The format of this file is described above.
Damien Miller45ee2b92006-03-15 11:56:18 +11001870This file is used by the SSH client.
Damien Millerc970cb92004-04-20 20:12:53 +10001871Because of the potential for abuse, this file must have strict permissions:
jmc@openbsd.orgd9ecfab2019-02-18 07:02:34 +00001872read/write for the user, and not writable by others.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001873.It Pa /etc/ssh/ssh_config
1874Systemwide configuration file.
1875This file provides defaults for those
1876values that are not specified in the user's configuration file, and
1877for those users who do not have a configuration file.
1878This file must be world-readable.
1879.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001880.Sh SEE ALSO
1881.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001882.Sh AUTHORS
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001883.An -nosplit
Ben Lindstrom9f049032002-06-21 00:59:05 +00001884OpenSSH is a derivative of the original and free
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001885ssh 1.2.12 release by
1886.An Tatu Ylonen .
1887.An Aaron Campbell , Bob Beck , Markus Friedl ,
1888.An Niels Provos , Theo de Raadt
1889and
1890.An Dug Song
Ben Lindstrom9f049032002-06-21 00:59:05 +00001891removed many bugs, re-added newer features and
1892created OpenSSH.
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001893.An Markus Friedl
1894contributed the support for SSH protocol versions 1.5 and 2.0.