blob: 0a19ba64c00c125b25528f3b692161403e6a0ba7 [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.\"
jmc@openbsd.orgdd0cf632018-11-23 06:58:28 +000036.\" $OpenBSD: ssh_config.5,v 1.288 2018/11/23 06:58:28 jmc Exp $
djm@openbsd.org9e34e0c2018-11-23 05:08:07 +000037.Dd $Mdocdate: November 23 2018 $
Ben Lindstrom9f049032002-06-21 00:59:05 +000038.Dt SSH_CONFIG 5
39.Os
40.Sh NAME
41.Nm ssh_config
42.Nd OpenSSH SSH client configuration files
Ben Lindstrom9f049032002-06-21 00:59:05 +000043.Sh DESCRIPTION
Damien Miller45ee2b92006-03-15 11:56:18 +110044.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +000045obtains configuration data from the following sources in
46the following order:
Damien Miller5c853b52006-03-15 11:37:02 +110047.Pp
Ben Lindstrom479b4762002-08-20 19:04:51 +000048.Bl -enum -offset indent -compact
49.It
50command-line options
51.It
52user's configuration file
Damien Miller167ea5d2005-05-26 12:04:02 +100053.Pq Pa ~/.ssh/config
Ben Lindstrom479b4762002-08-20 19:04:51 +000054.It
55system-wide configuration file
56.Pq Pa /etc/ssh/ssh_config
57.El
Ben Lindstrom9f049032002-06-21 00:59:05 +000058.Pp
59For each parameter, the first obtained value
60will be used.
Darren Tucker43d8e282005-02-09 09:51:08 +110061The configuration files contain sections separated by
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +000062.Cm Host
Ben Lindstrom9f049032002-06-21 00:59:05 +000063specifications, and that section is only applied for hosts that
64match one of the patterns given in the specification.
djm@openbsd.org957fbce2014-10-08 22:20:25 +000065The matched host name is usually the one given on the command line
66(see the
67.Cm CanonicalizeHostname
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +000068option for exceptions).
Ben Lindstrom9f049032002-06-21 00:59:05 +000069.Pp
70Since the first obtained value for each parameter is used, more
71host-specific declarations should be given near the beginning of the
72file, and general defaults at the end.
73.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +000074The file contains keyword-argument pairs, one per line.
75Lines starting with
Ben Lindstrom9f049032002-06-21 00:59:05 +000076.Ql #
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +000077and empty lines are interpreted as comments.
78Arguments may optionally be enclosed in double quotes
79.Pq \&"
80in order to represent arguments containing spaces.
Ben Lindstrom9f049032002-06-21 00:59:05 +000081Configuration options may be separated by whitespace or
82optional whitespace and exactly one
83.Ql = ;
84the latter format is useful to avoid the need to quote whitespace
85when specifying configuration options using the
86.Nm ssh ,
Damien Miller4aea9742006-03-15 11:59:39 +110087.Nm scp ,
Ben Lindstrom9f049032002-06-21 00:59:05 +000088and
89.Nm sftp
90.Fl o
91option.
92.Pp
93The possible
94keywords and their meanings are as follows (note that
95keywords are case-insensitive and arguments are case-sensitive):
96.Bl -tag -width Ds
97.It Cm Host
98Restricts the following declarations (up to the next
99.Cm Host
Damien Miller194fd902013-10-15 12:13:05 +1100100or
101.Cm Match
Ben Lindstrom9f049032002-06-21 00:59:05 +0000102keyword) to be only for those hosts that match one of the patterns
103given after the keyword.
Damien Millerfa51b162008-11-03 19:17:33 +1100104If more than one pattern is provided, they should be separated by whitespace.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000105A single
Damien Miller208f1ed2006-03-15 11:56:03 +1100106.Ql *
Ben Lindstrom9f049032002-06-21 00:59:05 +0000107as a pattern can be used to provide global
108defaults for all hosts.
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000109The host is usually the
Ben Lindstrom9f049032002-06-21 00:59:05 +0000110.Ar hostname
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000111argument given on the command line
112(see the
113.Cm CanonicalizeHostname
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000114keyword for exceptions).
Damien Millerf54a4b92006-03-15 11:54:36 +1100115.Pp
Damien Millerfe924212011-05-15 08:44:45 +1000116A pattern entry may be negated by prefixing it with an exclamation mark
117.Pq Sq !\& .
118If a negated entry is matched, then the
119.Cm Host
120entry is ignored, regardless of whether any other patterns on the line
121match.
122Negated matches are therefore useful to provide exceptions for wildcard
123matches.
124.Pp
Damien Millerf54a4b92006-03-15 11:54:36 +1100125See
126.Sx PATTERNS
127for more information on patterns.
Damien Millerd77b81f2013-10-17 11:39:00 +1100128.It Cm Match
Damien Miller194fd902013-10-15 12:13:05 +1100129Restricts the following declarations (up to the next
130.Cm Host
131or
132.Cm Match
133keyword) to be used only when the conditions following the
134.Cm Match
135keyword are satisfied.
sobrado@openbsd.orge3cbb062015-09-22 08:33:23 +0000136Match conditions are specified using one or more criteria
Damien Millercf31f382013-10-24 21:02:56 +1100137or the single token
138.Cm all
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000139which always matches.
140The available criteria keywords are:
141.Cm canonical ,
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
206.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 ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000267passphrase/password querying will be disabled.
268This option is useful in scripts and other batch jobs where no user
269is present to supply the password.
270The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000271.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000272or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000273.Cm no
274(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000275.It Cm BindAddress
Darren Tucker89f4d472005-07-14 17:06:21 +1000276Use the specified address on the local machine as the source address of
Darren Tucker6c71d202005-07-14 17:06:50 +1000277the connection.
278Only useful on systems with more than one address.
jmc@openbsd.org7d330a12018-02-23 07:38:09 +0000279.It Cm BindInterface
280Use the address of the specified interface on the local machine as the
281source address of the connection.
Damien Miller0faf7472013-10-17 11:47:23 +1100282.It Cm CanonicalDomains
Damien Miller607af342013-10-17 11:47:51 +1100283When
Damien Miller38505592013-10-17 11:48:13 +1100284.Cm CanonicalizeHostname
Damien Miller0faf7472013-10-17 11:47:23 +1100285is enabled, this option specifies the list of domain suffixes in which to
286search for the specified destination host.
Damien Miller38505592013-10-17 11:48:13 +1100287.It Cm CanonicalizeFallbackLocal
Damien Miller51682fa2013-10-17 11:48:31 +1100288Specifies whether to fail with an error when hostname canonicalization fails.
Damien Miller607af342013-10-17 11:47:51 +1100289The default,
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000290.Cm yes ,
Damien Miller607af342013-10-17 11:47:51 +1100291will attempt to look up the unqualified hostname using the system resolver's
Damien Miller0faf7472013-10-17 11:47:23 +1100292search rules.
293A value of
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000294.Cm no
Damien Miller0faf7472013-10-17 11:47:23 +1100295will cause
296.Xr ssh 1
297to fail instantly if
Damien Miller38505592013-10-17 11:48:13 +1100298.Cm CanonicalizeHostname
Damien Miller0faf7472013-10-17 11:47:23 +1100299is enabled and the target hostname cannot be found in any of the domains
300specified by
301.Cm CanonicalDomains .
Damien Miller38505592013-10-17 11:48:13 +1100302.It Cm CanonicalizeHostname
Damien Miller51682fa2013-10-17 11:48:31 +1100303Controls whether explicit hostname canonicalization is performed.
Damien Miller607af342013-10-17 11:47:51 +1100304The default,
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000305.Cm no ,
Damien Miller0faf7472013-10-17 11:47:23 +1100306is not to perform any name rewriting and let the system resolver handle all
307hostname lookups.
308If set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000309.Cm yes
Damien Miller0faf7472013-10-17 11:47:23 +1100310then, for connections that do not use a
djm@openbsd.org383a33d2018-09-21 03:11:36 +0000311.Cm ProxyCommand
312or
313.Cm ProxyJump ,
Damien Miller0faf7472013-10-17 11:47:23 +1100314.Xr ssh 1
Damien Miller38505592013-10-17 11:48:13 +1100315will attempt to canonicalize the hostname specified on the command line
Damien Miller0faf7472013-10-17 11:47:23 +1100316using the
317.Cm CanonicalDomains
318suffixes and
Damien Miller38505592013-10-17 11:48:13 +1100319.Cm CanonicalizePermittedCNAMEs
Damien Miller0faf7472013-10-17 11:47:23 +1100320rules.
321If
Damien Miller38505592013-10-17 11:48:13 +1100322.Cm CanonicalizeHostname
Damien Miller0faf7472013-10-17 11:47:23 +1100323is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000324.Cm always ,
Damien Miller51682fa2013-10-17 11:48:31 +1100325then canonicalization is applied to proxied connections too.
Damien Miller13f97b22014-02-24 15:57:55 +1100326.Pp
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000327If this option is enabled, then the configuration files are processed
328again using the new target name to pick up any new configuration in matching
Damien Miller13f97b22014-02-24 15:57:55 +1100329.Cm Host
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000330and
331.Cm Match
Damien Miller13f97b22014-02-24 15:57:55 +1100332stanzas.
Damien Miller38505592013-10-17 11:48:13 +1100333.It Cm CanonicalizeMaxDots
Damien Miller607af342013-10-17 11:47:51 +1100334Specifies the maximum number of dot characters in a hostname before
Damien Miller51682fa2013-10-17 11:48:31 +1100335canonicalization is disabled.
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000336The default, 1,
Damien Miller607af342013-10-17 11:47:51 +1100337allows a single dot (i.e. hostname.subdomain).
Damien Miller38505592013-10-17 11:48:13 +1100338.It Cm CanonicalizePermittedCNAMEs
Damien Miller607af342013-10-17 11:47:51 +1100339Specifies rules to determine whether CNAMEs should be followed when
Damien Miller38505592013-10-17 11:48:13 +1100340canonicalizing hostnames.
Damien Miller0faf7472013-10-17 11:47:23 +1100341The rules consist of one or more arguments of
Damien Miller607af342013-10-17 11:47:51 +1100342.Ar source_domain_list : Ns Ar target_domain_list ,
Damien Miller0faf7472013-10-17 11:47:23 +1100343where
344.Ar source_domain_list
Damien Miller51682fa2013-10-17 11:48:31 +1100345is a pattern-list of domains that may follow CNAMEs in canonicalization,
Damien Miller0faf7472013-10-17 11:47:23 +1100346and
347.Ar target_domain_list
Damien Miller607af342013-10-17 11:47:51 +1100348is a pattern-list of domains that they may resolve to.
Damien Miller0faf7472013-10-17 11:47:23 +1100349.Pp
350For example,
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000351.Qq *.a.example.com:*.b.example.com,*.c.example.com
Damien Miller0faf7472013-10-17 11:47:23 +1100352will allow hostnames matching
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000353.Qq *.a.example.com
Damien Miller38505592013-10-17 11:48:13 +1100354to be canonicalized to names in the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000355.Qq *.b.example.com
Damien Miller0faf7472013-10-17 11:47:23 +1100356or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000357.Qq *.c.example.com
Damien Miller0faf7472013-10-17 11:47:23 +1100358domains.
jmc@openbsd.orge6933a22018-09-20 06:58:48 +0000359.It Cm CASignatureAlgorithms
360Specifies which algorithms are allowed for signing of certificates
361by certificate authorities (CAs).
362The default is:
363.Bd -literal -offset indent
364ecdsa-sha2-nistp256.ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
365ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
366.Ed
367.Pp
368.Xr ssh 1
369will not accept host certificates signed using algorithms other than those
370specified.
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000371.It Cm CertificateFile
372Specifies a file from which the user's certificate is read.
373A corresponding private key must be provided separately in order
374to use this certificate either
375from an
376.Cm IdentityFile
377directive or
378.Fl i
379flag to
380.Xr ssh 1 ,
381via
382.Xr ssh-agent 1 ,
383or via a
384.Cm PKCS11Provider .
385.Pp
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000386Arguments to
387.Cm CertificateFile
388may use the tilde syntax to refer to a user's home directory
389or the tokens described in the
390.Sx TOKENS
391section.
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000392.Pp
393It is possible to have multiple certificate files specified in
394configuration files; these certificates will be tried in sequence.
395Multiple
396.Cm CertificateFile
397directives will add to the list of certificates used for
398authentication.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000399.It Cm ChallengeResponseAuthentication
Damien Miller1faa7132006-03-15 11:55:31 +1100400Specifies whether to use challenge-response authentication.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000401The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000402.Cm yes
403(the default)
Ben Lindstrom9f049032002-06-21 00:59:05 +0000404or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000405.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000406.It Cm CheckHostIP
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000407If set to
408.Cm yes
409(the default),
Damien Miller45ee2b92006-03-15 11:56:18 +1100410.Xr ssh 1
411will additionally check the host IP address in the
Ben Lindstrom9f049032002-06-21 00:59:05 +0000412.Pa known_hosts
413file.
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000414This allows it to detect if a host key changed due to DNS spoofing
djm@openbsd.org5e678592015-06-02 09:10:40 +0000415and will add addresses of destination hosts to
416.Pa ~/.ssh/known_hosts
417in the process, regardless of the setting of
418.Cm StrictHostKeyChecking .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000419If the option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000420.Cm no ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000421the check will not be executed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000422.It Cm Ciphers
djm@openbsd.org788ac792017-04-30 23:18:22 +0000423Specifies the ciphers allowed and their order of preference.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000424Multiple ciphers must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000425If the specified value begins with a
426.Sq +
427character, then the specified ciphers will be appended to the default set
428instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000429If the specified value begins with a
430.Sq -
431character, then the specified ciphers (including wildcards) will be removed
432from the default set instead of replacing them.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000433.Pp
Damien Miller0fde8ac2013-11-21 14:12:23 +1100434The supported ciphers are:
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000435.Bd -literal -offset indent
Damien Millerc1621c82014-04-20 13:22:46 +10004363des-cbc
Damien Millerc1621c82014-04-20 13:22:46 +1000437aes128-cbc
Damien Millerc1621c82014-04-20 13:22:46 +1000438aes192-cbc
Damien Millerc1621c82014-04-20 13:22:46 +1000439aes256-cbc
Damien Millerc1621c82014-04-20 13:22:46 +1000440aes128-ctr
Damien Millerc1621c82014-04-20 13:22:46 +1000441aes192-ctr
Damien Millerc1621c82014-04-20 13:22:46 +1000442aes256-ctr
Damien Millerc1621c82014-04-20 13:22:46 +1000443aes128-gcm@openssh.com
Damien Millerc1621c82014-04-20 13:22:46 +1000444aes256-gcm@openssh.com
Damien Millerc1621c82014-04-20 13:22:46 +1000445chacha20-poly1305@openssh.com
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000446.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100447.Pp
Damien Miller45ee2b92006-03-15 11:56:18 +1100448The default is:
Damien Millerc1621c82014-04-20 13:22:46 +1000449.Bd -literal -offset indent
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000450chacha20-poly1305@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000451aes128-ctr,aes192-ctr,aes256-ctr,
djm@openbsd.org00c52222018-04-05 22:54:28 +0000452aes128-gcm@openssh.com,aes256-gcm@openssh.com
Ben Lindstrom9f049032002-06-21 00:59:05 +0000453.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100454.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000455The list of available ciphers may also be obtained using
456.Qq ssh -Q cipher .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000457.It Cm ClearAllForwardings
Damien Miller45ee2b92006-03-15 11:56:18 +1100458Specifies that all local, remote, and dynamic port forwardings
Ben Lindstrom9f049032002-06-21 00:59:05 +0000459specified in the configuration files or on the command line be
Damien Miller495dca32003-04-01 21:42:14 +1000460cleared.
461This option is primarily useful when used from the
Damien Miller45ee2b92006-03-15 11:56:18 +1100462.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000463command line to clear port forwardings set in
464configuration files, and is automatically set by
465.Xr scp 1
466and
467.Xr sftp 1 .
468The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000469.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000470or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000471.Cm no
472(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000473.It Cm Compression
474Specifies whether to use compression.
475The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000476.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000477or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000478.Cm no
479(the default).
naddy@openbsd.org9a82e242017-05-03 21:49:18 +0000480.It Cm ConnectionAttempts
481Specifies the number of tries (one per second) to make before exiting.
482The argument must be an integer.
483This may be useful in scripts if the connection sometimes fails.
484The default is 1.
Damien Millerb78d5eb2003-05-16 11:39:04 +1000485.It Cm ConnectTimeout
Damien Miller45ee2b92006-03-15 11:56:18 +1100486Specifies the timeout (in seconds) used when connecting to the
487SSH server, instead of using the default system TCP timeout.
Damien Millerfbf486b2003-05-23 18:44:23 +1000488This value is used only when the target is down or really unreachable,
489not when it refuses the connection.
Damien Miller0e220db2004-06-15 10:34:08 +1000490.It Cm ControlMaster
491Enables the sharing of multiple sessions over a single network connection.
492When set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000493.Cm yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +1100494.Xr ssh 1
Damien Miller0e220db2004-06-15 10:34:08 +1000495will listen for connections on a control socket specified using the
496.Cm ControlPath
497argument.
498Additional sessions can connect to this socket using the same
499.Cm ControlPath
500with
501.Cm ControlMaster
502set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000503.Cm no
Damien Miller2234bac2004-06-30 22:38:52 +1000504(the default).
Damien Miller713de762005-11-05 15:13:49 +1100505These sessions will try to reuse the master instance's network connection
Damien Millerb3bfbb72005-11-05 15:11:48 +1100506rather than initiating new ones, but will fall back to connecting normally
507if the control socket does not exist, or is not listening.
508.Pp
Damien Miller23f07702004-06-18 01:19:03 +1000509Setting this to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000510.Cm ask
511will cause
512.Xr ssh 1
jmc@openbsd.org78de1672015-03-30 18:28:37 +0000513to listen for control connections, but require confirmation using
514.Xr ssh-askpass 1 .
Damien Millerdadfd4d2005-05-26 12:07:13 +1000515If the
516.Cm ControlPath
Damien Miller45ee2b92006-03-15 11:56:18 +1100517cannot be opened,
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000518.Xr ssh 1
519will continue without connecting to a master instance.
Damien Millerd14b1e72005-06-16 13:19:41 +1000520.Pp
Damien Miller13390022005-07-06 09:44:19 +1000521X11 and
Damien Millerfd94fba2005-07-06 09:44:59 +1000522.Xr ssh-agent 1
Damien Miller13390022005-07-06 09:44:19 +1000523forwarding is supported over these multiplexed connections, however the
Darren Tucker63551872005-12-20 16:14:15 +1100524display and agent forwarded will be the one belonging to the master
Damien Millerfd94fba2005-07-06 09:44:59 +1000525connection i.e. it is not possible to forward multiple displays or agents.
Damien Miller13390022005-07-06 09:44:19 +1000526.Pp
Damien Millerd14b1e72005-06-16 13:19:41 +1000527Two additional options allow for opportunistic multiplexing: try to use a
528master connection but fall back to creating a new one if one does not already
529exist.
530These options are:
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000531.Cm auto
Damien Millerd14b1e72005-06-16 13:19:41 +1000532and
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000533.Cm autoask .
Damien Millerd14b1e72005-06-16 13:19:41 +1000534The latter requires confirmation like the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000535.Cm ask
Damien Millerd14b1e72005-06-16 13:19:41 +1000536option.
Damien Miller0e220db2004-06-15 10:34:08 +1000537.It Cm ControlPath
Damien Miller6476cad2005-06-16 13:18:34 +1000538Specify the path to the control socket used for connection sharing as described
539in the
Damien Miller0e220db2004-06-15 10:34:08 +1000540.Cm ControlMaster
Damien Miller8f74c8f2005-06-26 08:56:03 +1000541section above or the string
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000542.Cm none
Damien Miller8f74c8f2005-06-26 08:56:03 +1000543to disable connection sharing.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000544Arguments to
545.Cm ControlPath
546may use the tilde syntax to refer to a user's home directory
547or the tokens described in the
548.Sx TOKENS
549section.
Damien Millerd14b1e72005-06-16 13:19:41 +1000550It is recommended that any
551.Cm ControlPath
552used for opportunistic connection sharing include
djm@openbsd.orgfc302562014-11-10 22:25:49 +0000553at least %h, %p, and %r (or alternatively %C) and be placed in a directory
554that is not writable by other users.
Damien Millerd14b1e72005-06-16 13:19:41 +1000555This ensures that shared connections are uniquely identified.
Damien Millere11e1ea2010-08-03 16:04:46 +1000556.It Cm ControlPersist
557When used in conjunction with
558.Cm ControlMaster ,
559specifies that the master connection should remain open
560in the background (waiting for future client connections)
561after the initial client connection has been closed.
562If set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000563.Cm no ,
Damien Millere11e1ea2010-08-03 16:04:46 +1000564then the master connection will not be placed into the background,
565and will close as soon as the initial client connection is closed.
566If set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000567.Cm yes
568or 0,
Damien Millere11e1ea2010-08-03 16:04:46 +1000569then the master connection will remain in the background indefinitely
570(until killed or closed via a mechanism such as the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000571.Qq ssh -O exit ) .
Damien Millere11e1ea2010-08-03 16:04:46 +1000572If set to a time in seconds, or a time in any of the formats documented in
573.Xr sshd_config 5 ,
574then the backgrounded master connection will automatically terminate
575after it has remained idle (with no client connections) for the
576specified time.
Damien Miller2234bac2004-06-30 22:38:52 +1000577.It Cm DynamicForward
Damien Millere9d001e2006-01-14 10:10:17 +1100578Specifies that a TCP port on the local machine be forwarded
Damien Miller2234bac2004-06-30 22:38:52 +1000579over the secure channel, and the application
580protocol is then used to determine where to connect to from the
581remote machine.
Darren Tuckerc8d64212005-10-03 18:13:42 +1000582.Pp
583The argument must be
584.Sm off
585.Oo Ar bind_address : Oc Ar port .
586.Sm on
Damien Miller7fa96602010-08-05 13:03:13 +1000587IPv6 addresses can be specified by enclosing addresses in square brackets.
Darren Tuckerc8d64212005-10-03 18:13:42 +1000588By default, the local port is bound in accordance with the
589.Cm GatewayPorts
590setting.
591However, an explicit
592.Ar bind_address
593may be used to bind the connection to a specific address.
594The
595.Ar bind_address
596of
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000597.Cm localhost
Darren Tuckerc8d64212005-10-03 18:13:42 +1000598indicates that the listening port be bound for local use only, while an
599empty address or
600.Sq *
601indicates that the port should be available from all interfaces.
602.Pp
Damien Miller2234bac2004-06-30 22:38:52 +1000603Currently the SOCKS4 and SOCKS5 protocols are supported, and
Damien Miller45ee2b92006-03-15 11:56:18 +1100604.Xr ssh 1
Damien Miller2234bac2004-06-30 22:38:52 +1000605will act as a SOCKS server.
606Multiple forwardings may be specified, and
607additional forwardings can be given on the command line.
608Only the superuser can forward privileged ports.
Darren Tucker674f71d2003-06-28 12:33:12 +1000609.It Cm EnableSSHKeysign
610Setting this option to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000611.Cm yes
Darren Tucker674f71d2003-06-28 12:33:12 +1000612in the global client configuration file
613.Pa /etc/ssh/ssh_config
614enables the use of the helper program
615.Xr ssh-keysign 8
616during
617.Cm HostbasedAuthentication .
618The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000619.Cm yes
Darren Tucker674f71d2003-06-28 12:33:12 +1000620or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000621.Cm no
622(the default).
Darren Tuckerf132c672003-10-15 15:58:18 +1000623This option should be placed in the non-hostspecific section.
Darren Tucker674f71d2003-06-28 12:33:12 +1000624See
625.Xr ssh-keysign 8
626for more information.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000627.It Cm EscapeChar
628Sets the escape character (default:
629.Ql ~ ) .
630The escape character can also
631be set on the command line.
632The argument should be a single character,
633.Ql ^
634followed by a letter, or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000635.Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +0000636to disable the escape
637character entirely (making the connection transparent for binary
638data).
Darren Tuckere7d4b192006-07-12 22:17:10 +1000639.It Cm ExitOnForwardFailure
640Specifies whether
641.Xr ssh 1
642should terminate the connection if it cannot set up all requested
djm@openbsd.orga954cdb2015-09-04 04:47:50 +0000643dynamic, tunnel, local, and remote port forwardings, (e.g.\&
jmc@openbsd.org5245bc12015-09-04 06:40:45 +0000644if either end is unable to bind and listen on a specified port).
djm@openbsd.orga954cdb2015-09-04 04:47:50 +0000645Note that
646.Cm ExitOnForwardFailure
647does not apply to connections made over port forwardings and will not,
648for example, cause
649.Xr ssh 1
650to exit if TCP connections to the ultimate forwarding destination fail.
Darren Tuckere7d4b192006-07-12 22:17:10 +1000651The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000652.Cm yes
Darren Tuckere7d4b192006-07-12 22:17:10 +1000653or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000654.Cm no
655(the default).
djm@openbsd.orgb79efde2014-12-21 23:12:42 +0000656.It Cm FingerprintHash
657Specifies the hash algorithm used when displaying key fingerprints.
658Valid options are:
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000659.Cm md5
djm@openbsd.orgb79efde2014-12-21 23:12:42 +0000660and
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000661.Cm sha256
662(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000663.It Cm ForwardAgent
664Specifies whether the connection to the authentication agent (if any)
665will be forwarded to the remote machine.
666The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000667.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000668or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000669.Cm no
670(the default).
Damien Milleraf653042002-09-04 16:40:37 +1000671.Pp
Damien Miller495dca32003-04-01 21:42:14 +1000672Agent forwarding should be enabled with caution.
673Users with the ability to bypass file permissions on the remote host
674(for the agent's Unix-domain socket)
675can access the local agent through the forwarded connection.
676An attacker cannot obtain key material from the agent,
Damien Milleraf653042002-09-04 16:40:37 +1000677however they can perform operations on the keys that enable them to
678authenticate using the identities loaded into the agent.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000679.It Cm ForwardX11
680Specifies whether X11 connections will be automatically redirected
681over the secure channel and
682.Ev DISPLAY
683set.
684The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000685.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000686or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000687.Cm no
688(the default).
Damien Milleraf653042002-09-04 16:40:37 +1000689.Pp
Damien Miller495dca32003-04-01 21:42:14 +1000690X11 forwarding should be enabled with caution.
691Users with the ability to bypass file permissions on the remote host
Darren Tucker0a118da2003-10-15 15:54:32 +1000692(for the user's X11 authorization database)
Damien Miller495dca32003-04-01 21:42:14 +1000693can access the local X11 display through the forwarded connection.
Darren Tucker0a118da2003-10-15 15:54:32 +1000694An attacker may then be able to perform activities such as keystroke monitoring
695if the
696.Cm ForwardX11Trusted
697option is also enabled.
Damien Miller1ab6a512010-06-26 10:02:24 +1000698.It Cm ForwardX11Timeout
Damien Millercede1db2010-07-02 13:33:48 +1000699Specify a timeout for untrusted X11 forwarding
700using the format described in the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000701.Sx TIME FORMATS
702section of
Damien Miller1ab6a512010-06-26 10:02:24 +1000703.Xr sshd_config 5 .
704X11 connections received by
705.Xr ssh 1
706after this time will be refused.
djm@openbsd.orgb5e412a2018-09-21 12:46:22 +0000707Setting
708.Cm ForwardX11Timeout
709to zero will disable the timeout and permit X11 forwarding for the life
710of the connection.
Damien Miller1ab6a512010-06-26 10:02:24 +1000711The default is to disable untrusted X11 forwarding after twenty minutes has
712elapsed.
Darren Tucker0a118da2003-10-15 15:54:32 +1000713.It Cm ForwardX11Trusted
Darren Tuckerdcf6ec42004-05-13 13:03:56 +1000714If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000715.Cm yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +1100716remote X11 clients will have full access to the original X11 display.
Damien Miller1717fd42005-03-01 21:17:31 +1100717.Pp
Darren Tucker0a118da2003-10-15 15:54:32 +1000718If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000719.Cm no
720(the default),
Damien Miller45ee2b92006-03-15 11:56:18 +1100721remote X11 clients will be considered untrusted and prevented
Darren Tucker0a118da2003-10-15 15:54:32 +1000722from stealing or tampering with data belonging to trusted X11
723clients.
Damien Miller1717fd42005-03-01 21:17:31 +1100724Furthermore, the
725.Xr xauth 1
726token used for the session will be set to expire after 20 minutes.
727Remote clients will be refused access after this time.
Darren Tucker0a118da2003-10-15 15:54:32 +1000728.Pp
Darren Tucker0a118da2003-10-15 15:54:32 +1000729See the X11 SECURITY extension specification for full details on
730the restrictions imposed on untrusted clients.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000731.It Cm GatewayPorts
732Specifies whether remote hosts are allowed to connect to local
733forwarded ports.
734By default,
Damien Miller45ee2b92006-03-15 11:56:18 +1100735.Xr ssh 1
Damien Miller495dca32003-04-01 21:42:14 +1000736binds local port forwardings to the loopback address.
737This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000738.Cm GatewayPorts
Damien Miller45ee2b92006-03-15 11:56:18 +1100739can be used to specify that ssh
Ben Lindstrom9f049032002-06-21 00:59:05 +0000740should bind local port forwardings to the wildcard address,
741thus allowing remote hosts to connect to forwarded ports.
742The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000743.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000744or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000745.Cm no
746(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000747.It Cm GlobalKnownHostsFile
Damien Miller295ee632011-05-29 21:42:31 +1000748Specifies one or more files to use for the global
749host key database, separated by whitespace.
750The default is
751.Pa /etc/ssh/ssh_known_hosts ,
752.Pa /etc/ssh/ssh_known_hosts2 .
Darren Tucker0efd1552003-08-26 11:49:55 +1000753.It Cm GSSAPIAuthentication
Damien Millerbaafb982003-12-17 16:32:23 +1100754Specifies whether user authentication based on GSSAPI is allowed.
Damien Millerc2b98272003-09-03 12:13:30 +1000755The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000756.Cm no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000757.It Cm GSSAPIDelegateCredentials
758Forward (delegate) credentials to the server.
759The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000760.Cm no .
Damien Millere1776152005-03-01 21:47:37 +1100761.It Cm HashKnownHosts
762Indicates that
Damien Miller45ee2b92006-03-15 11:56:18 +1100763.Xr ssh 1
Damien Millere1776152005-03-01 21:47:37 +1100764should hash host names and addresses when they are added to
Damien Miller167ea5d2005-05-26 12:04:02 +1000765.Pa ~/.ssh/known_hosts .
Damien Millere1776152005-03-01 21:47:37 +1100766These hashed names may be used normally by
Damien Miller45ee2b92006-03-15 11:56:18 +1100767.Xr ssh 1
Damien Millere1776152005-03-01 21:47:37 +1100768and
Damien Miller45ee2b92006-03-15 11:56:18 +1100769.Xr sshd 8 ,
Damien Millere1776152005-03-01 21:47:37 +1100770but they do not reveal identifying information should the file's contents
771be disclosed.
772The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000773.Cm no .
Damien Miller858bb7d2006-08-05 11:34:51 +1000774Note that existing names and addresses in known hosts files
775will not be converted automatically,
776but may be manually hashed using
Damien Miller4b42d7f2005-03-01 21:48:35 +1100777.Xr ssh-keygen 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000778.It Cm HostbasedAuthentication
779Specifies whether to try rhosts based authentication with public key
780authentication.
781The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000782.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000783or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000784.Cm no
785(the default).
djm@openbsd.org46347ed2015-01-30 11:43:14 +0000786.It Cm HostbasedKeyTypes
787Specifies the key types that will be used for hostbased authentication
djm@openbsd.org312d2f22018-07-04 13:49:31 +0000788as a comma-separated list of patterns.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000789Alternately if the specified value begins with a
790.Sq +
791character, then the specified key types will be appended to the default set
792instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000793If the specified value begins with a
794.Sq -
795character, then the specified key types (including wildcards) will be removed
796from the default set instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000797The default for this option is:
798.Bd -literal -offset 3n
799ecdsa-sha2-nistp256-cert-v01@openssh.com,
800ecdsa-sha2-nistp384-cert-v01@openssh.com,
801ecdsa-sha2-nistp521-cert-v01@openssh.com,
802ssh-ed25519-cert-v01@openssh.com,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +0000803rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000804ssh-rsa-cert-v01@openssh.com,
805ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +0000806ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000807.Ed
808.Pp
djm@openbsd.org46347ed2015-01-30 11:43:14 +0000809The
810.Fl Q
811option of
812.Xr ssh 1
813may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000814.It Cm HostKeyAlgorithms
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000815Specifies the host key algorithms
Ben Lindstrom9f049032002-06-21 00:59:05 +0000816that the client wants to use in order of preference.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000817Alternately if the specified value begins with a
818.Sq +
819character, then the specified key types will be appended to the default set
820instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000821If the specified value begins with a
822.Sq -
823character, then the specified key types (including wildcards) will be removed
824from the default set instead of replacing them.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000825The default for this option is:
Damien Millereb8b60e2010-08-31 22:41:14 +1000826.Bd -literal -offset 3n
827ecdsa-sha2-nistp256-cert-v01@openssh.com,
828ecdsa-sha2-nistp384-cert-v01@openssh.com,
829ecdsa-sha2-nistp521-cert-v01@openssh.com,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100830ssh-ed25519-cert-v01@openssh.com,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +0000831rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000832ssh-rsa-cert-v01@openssh.com,
Damien Millereb8b60e2010-08-31 22:41:14 +1000833ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +0000834ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
Damien Millereb8b60e2010-08-31 22:41:14 +1000835.Ed
Damien Millerd925dcd2010-12-01 12:21:51 +1100836.Pp
837If hostkeys are known for the destination host then this default is modified
838to prefer their algorithms.
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000839.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000840The list of available key types may also be obtained using
841.Qq ssh -Q key .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000842.It Cm HostKeyAlias
843Specifies an alias that should be used instead of the
844real host name when looking up or saving the host key
djm@openbsd.org6f8ca3b2017-06-24 05:35:05 +0000845in the host key database files and when validating host certificates.
Damien Miller45ee2b92006-03-15 11:56:18 +1100846This option is useful for tunneling SSH connections
Ben Lindstrom9f049032002-06-21 00:59:05 +0000847or for multiple servers running on a single host.
848.It Cm HostName
849Specifies the real host name to log into.
850This can be used to specify nicknames or abbreviations for hosts.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000851Arguments to
852.Cm HostName
853accept the tokens described in the
854.Sx TOKENS
855section.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000856Numeric IP addresses are also permitted (both on the command line and in
857.Cm HostName
858specifications).
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000859The default is the name given on the command line.
Damien Millerbd394c32004-03-08 23:12:36 +1100860.It Cm IdentitiesOnly
861Specifies that
Damien Miller45ee2b92006-03-15 11:56:18 +1100862.Xr ssh 1
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000863should only use the authentication identity and certificate files explicitly
864configured in the
Damien Miller1a812582004-04-20 20:13:32 +1000865.Nm
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000866files
867or passed on the
868.Xr ssh 1
869command-line,
Damien Miller45ee2b92006-03-15 11:56:18 +1100870even if
871.Xr ssh-agent 1
Damien Millercb6b68b2012-12-03 09:49:52 +1100872or a
873.Cm PKCS11Provider
Damien Millerbd394c32004-03-08 23:12:36 +1100874offers more identities.
875The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000876.Cm yes
Damien Millerbd394c32004-03-08 23:12:36 +1100877or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000878.Cm no
879(the default).
Damien Miller45ee2b92006-03-15 11:56:18 +1100880This option is intended for situations where ssh-agent
Damien Millerbd394c32004-03-08 23:12:36 +1100881offers many different identities.
markus@openbsd.orgb02ad1c2016-05-04 12:21:53 +0000882.It Cm IdentityAgent
883Specifies the
884.Ux Ns -domain
885socket used to communicate with the authentication agent.
886.Pp
887This option overrides the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000888.Ev SSH_AUTH_SOCK
markus@openbsd.orgb02ad1c2016-05-04 12:21:53 +0000889environment variable and can be used to select a specific agent.
890Setting the socket name to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000891.Cm none
markus@openbsd.orgb02ad1c2016-05-04 12:21:53 +0000892disables the use of an authentication agent.
markus@openbsd.org1a75d142016-05-04 14:29:58 +0000893If the string
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000894.Qq SSH_AUTH_SOCK
markus@openbsd.org1a75d142016-05-04 14:29:58 +0000895is specified, the location of the socket will be read from the
896.Ev SSH_AUTH_SOCK
897environment variable.
djm@openbsd.org5eff5b82018-10-03 06:38:35 +0000898Otherwise if the specified value begins with a
899.Sq $
900character, then it will be treated as an environment variable containing
901the location of the socket.
markus@openbsd.orgb02ad1c2016-05-04 12:21:53 +0000902.Pp
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000903Arguments to
904.Cm IdentityAgent
905may use the tilde syntax to refer to a user's home directory
906or the tokens described in the
907.Sx TOKENS
908section.
Damien Miller957d4e42005-12-13 19:30:45 +1100909.It Cm IdentityFile
sobrado@openbsd.orgf70b22b2014-08-30 15:33:50 +0000910Specifies a file from which the user's DSA, ECDSA, Ed25519 or RSA authentication
Damien Millereb8b60e2010-08-31 22:41:14 +1000911identity is read.
Damien Miller957d4e42005-12-13 19:30:45 +1100912The default is
Damien Millereb8b60e2010-08-31 22:41:14 +1000913.Pa ~/.ssh/id_dsa ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100914.Pa ~/.ssh/id_ecdsa ,
915.Pa ~/.ssh/id_ed25519
Damien Miller957d4e42005-12-13 19:30:45 +1100916and
djm@openbsd.org788ac792017-04-30 23:18:22 +0000917.Pa ~/.ssh/id_rsa .
Damien Miller957d4e42005-12-13 19:30:45 +1100918Additionally, any identities represented by the authentication agent
Damien Miller7f2b4382013-07-18 16:10:29 +1000919will be used for authentication unless
920.Cm IdentitiesOnly
921is set.
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000922If no certificates have been explicitly specified by
923.Cm CertificateFile ,
Damien Miller5059d8d2010-03-05 21:31:11 +1100924.Xr ssh 1
925will try to load certificate information from the filename obtained by
926appending
927.Pa -cert.pub
928to the path of a specified
929.Cm IdentityFile .
Damien Miller6b1d53c2006-03-31 23:13:21 +1100930.Pp
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000931Arguments to
932.Cm IdentityFile
933may use the tilde syntax to refer to a user's home directory
934or the tokens described in the
935.Sx TOKENS
936section.
Damien Miller6b1d53c2006-03-31 23:13:21 +1100937.Pp
Damien Miller957d4e42005-12-13 19:30:45 +1100938It is possible to have
939multiple identity files specified in configuration files; all these
940identities will be tried in sequence.
Damien Miller6029e072011-06-20 14:22:49 +1000941Multiple
942.Cm IdentityFile
943directives will add to the list of identities tried (this behaviour
944differs from that of other configuration directives).
Damien Miller7f2b4382013-07-18 16:10:29 +1000945.Pp
946.Cm IdentityFile
947may be used in conjunction with
948.Cm IdentitiesOnly
949to select which identities in an agent are offered during authentication.
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000950.Cm IdentityFile
951may also be used in conjunction with
952.Cm CertificateFile
953in order to provide any certificate also needed for authentication with
954the identity.
Darren Tucker63e0df22013-05-16 20:30:31 +1000955.It Cm IgnoreUnknown
956Specifies a pattern-list of unknown options to be ignored if they are
957encountered in configuration parsing.
958This may be used to suppress errors if
959.Nm
960contains options that are unrecognised by
961.Xr ssh 1 .
962It is recommended that
963.Cm IgnoreUnknown
964be listed early in the configuration file as it will not be applied
965to unknown options that appear before it.
djm@openbsd.orgdc7990b2016-04-15 00:30:19 +0000966.It Cm Include
967Include the specified configuration file(s).
jmc@openbsd.org6aaabc22016-04-17 14:34:46 +0000968Multiple pathnames may be specified and each pathname may contain
kn@openbsd.orgddf1b792018-07-23 19:02:49 +0000969.Xr glob 7
djm@openbsd.orgdc7990b2016-04-15 00:30:19 +0000970wildcards and, for user configurations, shell-like
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000971.Sq ~
djm@openbsd.orgdc7990b2016-04-15 00:30:19 +0000972references to user home directories.
973Files without absolute paths are assumed to be in
974.Pa ~/.ssh
jmc@openbsd.org6aaabc22016-04-17 14:34:46 +0000975if included in a user configuration file or
djm@openbsd.orgdc7990b2016-04-15 00:30:19 +0000976.Pa /etc/ssh
977if included from the system configuration file.
978.Cm Include
979directive may appear inside a
980.Cm Match
981or
982.Cm Host
983block
984to perform conditional inclusion.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100985.It Cm IPQoS
986Specifies the IPv4 type-of-service or DSCP class for connections.
987Accepted values are
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000988.Cm af11 ,
989.Cm af12 ,
990.Cm af13 ,
991.Cm af21 ,
992.Cm af22 ,
993.Cm af23 ,
994.Cm af31 ,
995.Cm af32 ,
996.Cm af33 ,
997.Cm af41 ,
998.Cm af42 ,
999.Cm af43 ,
1000.Cm cs0 ,
1001.Cm cs1 ,
1002.Cm cs2 ,
1003.Cm cs3 ,
1004.Cm cs4 ,
1005.Cm cs5 ,
1006.Cm cs6 ,
1007.Cm cs7 ,
1008.Cm ef ,
1009.Cm lowdelay ,
1010.Cm throughput ,
1011.Cm reliability ,
djm@openbsd.org51676ec2017-07-23 23:37:02 +00001012a numeric value, or
1013.Cm none
1014to use the operating system default.
Damien Miller928362d2010-12-26 14:26:45 +11001015This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +11001016If one argument is specified, it is used as the packet class unconditionally.
1017If two values are specified, the first is automatically selected for
1018interactive sessions and the second for non-interactive sessions.
1019The default is
job@openbsd.org5ee84482018-04-04 15:12:17 +00001020.Cm af21
jmc@openbsd.org83685712018-04-07 13:50:10 +00001021(Low-Latency Data)
Damien Miller0dac6fb2010-11-20 15:19:38 +11001022for interactive sessions and
job@openbsd.org5ee84482018-04-04 15:12:17 +00001023.Cm cs1
jmc@openbsd.org83685712018-04-07 13:50:10 +00001024(Lower Effort)
Damien Miller0dac6fb2010-11-20 15:19:38 +11001025for non-interactive sessions.
Damien Millercfb606c2007-10-26 14:24:48 +10001026.It Cm KbdInteractiveAuthentication
1027Specifies whether to use keyboard-interactive authentication.
1028The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001029.Cm yes
1030(the default)
Damien Millercfb606c2007-10-26 14:24:48 +10001031or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001032.Cm no .
Darren Tucker636ca902004-11-05 20:22:00 +11001033.It Cm KbdInteractiveDevices
1034Specifies the list of methods to use in keyboard-interactive authentication.
1035Multiple method names must be comma-separated.
1036The default is to use the server specified list.
Damien Miller9cfbaec2006-03-15 11:57:55 +11001037The methods available vary depending on what the server supports.
1038For an OpenSSH server,
1039it may be zero or more of:
Damien Miller87f08be2018-07-20 13:18:28 +10001040.Cm bsdauth
Damien Miller9cfbaec2006-03-15 11:57:55 +11001041and
Damien Miller87f08be2018-07-20 13:18:28 +10001042.Cm pam .
Damien Millerd5f62bf2010-09-24 22:11:14 +10001043.It Cm KexAlgorithms
1044Specifies the available KEX (Key Exchange) algorithms.
1045Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001046Alternately if the specified value begins with a
1047.Sq +
1048character, then the specified methods will be appended to the default set
1049instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +00001050If the specified value begins with a
1051.Sq -
1052character, then the specified methods (including wildcards) will be removed
1053from the default set instead of replacing them.
Damien Miller7fe2b1f2010-09-24 22:11:53 +10001054The default is:
1055.Bd -literal -offset indent
djm@openbsd.org16277fc2016-09-22 17:55:13 +00001056curve25519-sha256,curve25519-sha256@libssh.org,
Damien Miller7fe2b1f2010-09-24 22:11:53 +10001057ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
1058diffie-hellman-group-exchange-sha256,
djm@openbsd.org680321f2018-02-16 02:40:45 +00001059diffie-hellman-group16-sha512,
1060diffie-hellman-group18-sha512,
Damien Millerc1621c82014-04-20 13:22:46 +10001061diffie-hellman-group-exchange-sha1,
djm@openbsd.org680321f2018-02-16 02:40:45 +00001062diffie-hellman-group14-sha256,
djm@openbsd.orgbdfd29f2015-07-03 03:47:00 +00001063diffie-hellman-group14-sha1
Damien Miller7fe2b1f2010-09-24 22:11:53 +10001064.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001065.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001066The list of available key exchange algorithms may also be obtained using
1067.Qq ssh -Q kex .
Damien Millerd27b9472005-12-13 19:29:02 +11001068.It Cm LocalCommand
1069Specifies a command to execute on the local machine after successfully
1070connecting to the server.
1071The command string extends to the end of the line, and is executed with
Darren Tucker63b31cb2007-12-02 23:09:30 +11001072the user's shell.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001073Arguments to
1074.Cm LocalCommand
1075accept the tokens described in the
1076.Sx TOKENS
1077section.
Darren Tucker78be8c52010-01-08 17:05:59 +11001078.Pp
1079The command is run synchronously and does not have access to the
1080session of the
1081.Xr ssh 1
1082that spawned it.
1083It should not be used for interactive commands.
1084.Pp
Damien Millerd27b9472005-12-13 19:29:02 +11001085This directive is ignored unless
1086.Cm PermitLocalCommand
1087has been enabled.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001088.It Cm LocalForward
Damien Millere9d001e2006-01-14 10:10:17 +11001089Specifies that a TCP port on the local machine be forwarded over
Ben Lindstrom9f049032002-06-21 00:59:05 +00001090the secure channel to the specified host and port from the remote machine.
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001091The first argument must be
Damien Millerf91ee4c2005-03-01 21:24:33 +11001092.Sm off
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001093.Oo Ar bind_address : Oc Ar port
Damien Millerf91ee4c2005-03-01 21:24:33 +11001094.Sm on
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001095and the second argument must be
1096.Ar host : Ns Ar hostport .
Damien Miller7fa96602010-08-05 13:03:13 +10001097IPv6 addresses can be specified by enclosing addresses in square brackets.
Damien Millerf8c55462005-03-02 12:03:05 +11001098Multiple forwardings may be specified, and additional forwardings can be
Damien Millerf91ee4c2005-03-01 21:24:33 +11001099given on the command line.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001100Only the superuser can forward privileged ports.
Damien Millerf91ee4c2005-03-01 21:24:33 +11001101By default, the local port is bound in accordance with the
1102.Cm GatewayPorts
1103setting.
1104However, an explicit
1105.Ar bind_address
1106may be used to bind the connection to a specific address.
1107The
1108.Ar bind_address
1109of
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001110.Cm localhost
Damien Millerf8c55462005-03-02 12:03:05 +11001111indicates that the listening port be bound for local use only, while an
1112empty address or
1113.Sq *
Damien Millerf91ee4c2005-03-01 21:24:33 +11001114indicates that the port should be available from all interfaces.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001115.It Cm LogLevel
1116Gives the verbosity level that is used when logging messages from
Damien Miller45ee2b92006-03-15 11:56:18 +11001117.Xr ssh 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001118The possible values are:
Damien Miller45ee2b92006-03-15 11:56:18 +11001119QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +10001120The default is INFO.
1121DEBUG and DEBUG1 are equivalent.
1122DEBUG2 and DEBUG3 each specify higher levels of verbose output.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001123.It Cm MACs
1124Specifies the MAC (message authentication code) algorithms
1125in order of preference.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +00001126The MAC algorithm is used for data integrity protection.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001127Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001128If the specified value begins with a
1129.Sq +
1130character, then the specified algorithms will be appended to the default set
1131instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +00001132If the specified value begins with a
1133.Sq -
1134character, then the specified algorithms (including wildcards) will be removed
1135from the default set instead of replacing them.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001136.Pp
Damien Milleraf43a7a2012-12-12 10:46:31 +11001137The algorithms that contain
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001138.Qq -etm
Damien Milleraf43a7a2012-12-12 10:46:31 +11001139calculate the MAC after encryption (encrypt-then-mac).
1140These are considered safer and their use recommended.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001141.Pp
Damien Miller45ee2b92006-03-15 11:56:18 +11001142The default is:
Damien Miller5e7c30b2007-06-11 14:06:32 +10001143.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +11001144umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1145hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001146hmac-sha1-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +10001147umac-64@openssh.com,umac-128@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001148hmac-sha2-256,hmac-sha2-512,hmac-sha1
Damien Miller5e7c30b2007-06-11 14:06:32 +10001149.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001150.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001151The list of available MAC algorithms may also be obtained using
1152.Qq ssh -Q mac .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001153.It Cm NoHostAuthenticationForLocalhost
djm@openbsd.org4f011da2018-02-10 06:40:28 +00001154Disable host authentication for localhost (loopback addresses).
Ben Lindstrom9f049032002-06-21 00:59:05 +00001155The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001156.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +00001157or
jmc@openbsd.org78142e32017-02-27 14:30:33 +00001158.Cm no
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001159(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +00001160.It Cm NumberOfPasswordPrompts
1161Specifies the number of password prompts before giving up.
1162The argument to this keyword must be an integer.
Damien Miller45ee2b92006-03-15 11:56:18 +11001163The default is 3.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001164.It Cm PasswordAuthentication
1165Specifies whether to use password authentication.
1166The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001167.Cm yes
1168(the default)
Ben Lindstrom9f049032002-06-21 00:59:05 +00001169or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001170.Cm no .
Damien Millerd27b9472005-12-13 19:29:02 +11001171.It Cm PermitLocalCommand
1172Allow local command execution via the
1173.Ic LocalCommand
1174option or using the
Damien Miller4b2319f2005-12-13 19:30:27 +11001175.Ic !\& Ns Ar command
Damien Millerd27b9472005-12-13 19:29:02 +11001176escape sequence in
1177.Xr ssh 1 .
1178The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001179.Cm yes
Damien Millerd27b9472005-12-13 19:29:02 +11001180or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001181.Cm no
1182(the default).
Damien Miller7ea845e2010-02-12 09:21:02 +11001183.It Cm PKCS11Provider
1184Specifies which PKCS#11 provider to use.
Damien Miller8e1ea4e2010-11-20 15:20:10 +11001185The argument to this keyword is the PKCS#11 shared library
Damien Miller7ea845e2010-02-12 09:21:02 +11001186.Xr ssh 1
Damien Millera7618442010-02-12 09:26:02 +11001187should use to communicate with a PKCS#11 token providing the user's
Damien Miller7ea845e2010-02-12 09:21:02 +11001188private RSA key.
Damien Miller957d4e42005-12-13 19:30:45 +11001189.It Cm Port
1190Specifies the port number to connect on the remote host.
Damien Miller45ee2b92006-03-15 11:56:18 +11001191The default is 22.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001192.It Cm PreferredAuthentications
jmc@openbsd.orga685ae82016-02-17 07:38:19 +00001193Specifies the order in which the client should try authentication methods.
Darren Tucker1adc2bd2005-03-14 23:14:20 +11001194This allows a client to prefer one method (e.g.\&
Ben Lindstrom9f049032002-06-21 00:59:05 +00001195.Cm keyboard-interactive )
Darren Tucker1adc2bd2005-03-14 23:14:20 +11001196over another method (e.g.\&
Damien Miller544378d2010-04-16 15:52:24 +10001197.Cm password ) .
1198The default is:
1199.Bd -literal -offset indent
1200gssapi-with-mic,hostbased,publickey,
1201keyboard-interactive,password
1202.Ed
Ben Lindstrom9f049032002-06-21 00:59:05 +00001203.It Cm ProxyCommand
1204Specifies the command to use to connect to the server.
1205The command
Damien Miller079bac22014-07-09 13:06:25 +10001206string extends to the end of the line, and is executed
1207using the user's shell
1208.Ql exec
1209directive to avoid a lingering shell process.
1210.Pp
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001211Arguments to
1212.Cm ProxyCommand
1213accept the tokens described in the
1214.Sx TOKENS
1215section.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001216The command can be basically anything,
1217and should read from its standard input and write to its standard output.
1218It should eventually connect an
1219.Xr sshd 8
1220server running on some machine, or execute
1221.Ic sshd -i
1222somewhere.
1223Host key management will be done using the
1224HostName of the host being connected (defaulting to the name typed by
1225the user).
Damien Miller495dca32003-04-01 21:42:14 +10001226Setting the command to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001227.Cm none
Damien Miller9f1e33a2003-02-24 11:57:32 +11001228disables this option entirely.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001229Note that
1230.Cm CheckHostIP
1231is not available for connects with a proxy command.
1232.Pp
Damien Millerebcfedc2005-05-26 12:13:56 +10001233This directive is useful in conjunction with
1234.Xr nc 1
1235and its proxy support.
Damien Millerdfec2942005-05-26 12:14:32 +10001236For example, the following directive would connect via an HTTP proxy at
Damien Millerebcfedc2005-05-26 12:13:56 +10001237192.0.2.0:
1238.Bd -literal -offset 3n
1239ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p
1240.Ed
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001241.It Cm ProxyJump
millert@openbsd.org887669e2017-10-21 23:06:24 +00001242Specifies one or more jump proxies as either
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001243.Xo
1244.Sm off
jmc@openbsd.orge4eb7d92016-07-16 06:57:55 +00001245.Op Ar user No @
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001246.Ar host
jmc@openbsd.orge4eb7d92016-07-16 06:57:55 +00001247.Op : Ns Ar port
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001248.Sm on
millert@openbsd.org887669e2017-10-21 23:06:24 +00001249or an ssh URI
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001250.Xc .
djm@openbsd.org286f5a72016-07-22 03:35:11 +00001251Multiple proxies may be separated by comma characters and will be visited
djm@openbsd.orgf00211e2016-07-22 07:00:46 +00001252sequentially.
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001253Setting this option will cause
1254.Xr ssh 1
1255to connect to the target host by first making a
1256.Xr ssh 1
1257connection to the specified
1258.Cm ProxyJump
1259host and then establishing a
jmc@openbsd.orge4eb7d92016-07-16 06:57:55 +00001260TCP forwarding to the ultimate target from there.
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001261.Pp
1262Note that this option will compete with the
1263.Cm ProxyCommand
1264option - whichever is specified first will prevent later instances of the
1265other from taking effect.
Damien Miller1262b662013-08-21 02:44:24 +10001266.It Cm ProxyUseFdpass
Damien Millerf2f6c312013-08-21 02:44:58 +10001267Specifies that
Damien Miller1262b662013-08-21 02:44:24 +10001268.Cm ProxyCommand
1269will pass a connected file descriptor back to
Damien Millerf2f6c312013-08-21 02:44:58 +10001270.Xr ssh 1
Damien Miller1262b662013-08-21 02:44:24 +10001271instead of continuing to execute and pass data.
1272The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001273.Cm no .
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001274.It Cm PubkeyAcceptedKeyTypes
1275Specifies the key types that will be used for public key authentication
djm@openbsd.org312d2f22018-07-04 13:49:31 +00001276as a comma-separated list of patterns.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001277Alternately if the specified value begins with a
1278.Sq +
1279character, then the key types after it will be appended to the default
1280instead of replacing it.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +00001281If the specified value begins with a
1282.Sq -
1283character, then the specified key types (including wildcards) will be removed
1284from the default set instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001285The default for this option is:
1286.Bd -literal -offset 3n
1287ecdsa-sha2-nistp256-cert-v01@openssh.com,
1288ecdsa-sha2-nistp384-cert-v01@openssh.com,
1289ecdsa-sha2-nistp521-cert-v01@openssh.com,
1290ssh-ed25519-cert-v01@openssh.com,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +00001291rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001292ssh-rsa-cert-v01@openssh.com,
1293ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +00001294ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001295.Ed
1296.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001297The list of available key types may also be obtained using
1298.Qq ssh -Q key .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001299.It Cm PubkeyAuthentication
1300Specifies whether to try public key authentication.
1301The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001302.Cm yes
1303(the default)
Ben Lindstrom9f049032002-06-21 00:59:05 +00001304or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001305.Cm no .
Darren Tucker62388b22006-01-20 11:31:47 +11001306.It Cm RekeyLimit
1307Specifies the maximum amount of data that may be transmitted before the
Darren Tuckerc53c2af2013-05-16 20:28:16 +10001308session key is renegotiated, optionally followed a maximum amount of
1309time that may pass before the session key is renegotiated.
1310The first argument is specified in bytes and may have a suffix of
Damien Millerddfddf12006-01-31 21:39:03 +11001311.Sq K ,
1312.Sq M ,
Darren Tucker62388b22006-01-20 11:31:47 +11001313or
Damien Millerddfddf12006-01-31 21:39:03 +11001314.Sq G
Darren Tucker62388b22006-01-20 11:31:47 +11001315to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1316The default is between
Damien Miller45ee2b92006-03-15 11:56:18 +11001317.Sq 1G
Darren Tucker62388b22006-01-20 11:31:47 +11001318and
Damien Miller45ee2b92006-03-15 11:56:18 +11001319.Sq 4G ,
Darren Tucker62388b22006-01-20 11:31:47 +11001320depending on the cipher.
Darren Tuckerc53c2af2013-05-16 20:28:16 +10001321The optional second value is specified in seconds and may use any of the
1322units documented in the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001323.Sx TIME FORMATS
1324section of
Darren Tuckerc53c2af2013-05-16 20:28:16 +10001325.Xr sshd_config 5 .
1326The default value for
1327.Cm RekeyLimit
1328is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001329.Cm default none ,
Darren Tuckerc53c2af2013-05-16 20:28:16 +10001330which means that rekeying is performed after the cipher's default amount
1331of data has been sent or received and no time based rekeying is done.
bluhm@openbsd.org1112b532017-05-30 18:58:37 +00001332.It Cm RemoteCommand
1333Specifies a command to execute on the remote machine after successfully
1334connecting to the server.
1335The command string extends to the end of the line, and is executed with
1336the user's shell.
jmc@openbsd.orga3bb2502017-05-30 19:38:17 +00001337Arguments to
1338.Cm RemoteCommand
1339accept the tokens described in the
1340.Sx TOKENS
1341section.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001342.It Cm RemoteForward
Damien Millere9d001e2006-01-14 10:10:17 +11001343Specifies that a TCP port on the remote machine be forwarded over
markus@openbsd.org609d7a62017-09-21 19:16:53 +00001344the secure channel.
djm@openbsd.org001aa552018-04-10 00:10:49 +00001345The remote port may either be forwarded to a specified host and port
markus@openbsd.org609d7a62017-09-21 19:16:53 +00001346from the local machine, or may act as a SOCKS 4/5 proxy that allows a remote
1347client to connect to arbitrary destinations from the local machine.
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001348The first argument must be
Damien Millerf91ee4c2005-03-01 21:24:33 +11001349.Sm off
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001350.Oo Ar bind_address : Oc Ar port
Damien Millerf91ee4c2005-03-01 21:24:33 +11001351.Sm on
markus@openbsd.org609d7a62017-09-21 19:16:53 +00001352If forwarding to a specific destination then the second argument must be
1353.Ar host : Ns Ar hostport ,
1354otherwise if no destination argument is specified then the remote forwarding
1355will be established as a SOCKS proxy.
1356.Pp
Damien Miller7fa96602010-08-05 13:03:13 +10001357IPv6 addresses can be specified by enclosing addresses in square brackets.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001358Multiple forwardings may be specified, and additional
1359forwardings can be given on the command line.
Damien Millerde7532e2008-11-03 19:24:45 +11001360Privileged ports can be forwarded only when
1361logging in as root on the remote machine.
Damien Millere379e102009-02-14 16:34:39 +11001362.Pp
Damien Miller85c6d8a2009-02-14 16:34:21 +11001363If the
1364.Ar port
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001365argument is 0,
Damien Miller85c6d8a2009-02-14 16:34:21 +11001366the listen port will be dynamically allocated on the server and reported
1367to the client at run time.
Damien Millerf91ee4c2005-03-01 21:24:33 +11001368.Pp
1369If the
1370.Ar bind_address
1371is not specified, the default is to only bind to loopback addresses.
1372If the
1373.Ar bind_address
1374is
1375.Ql *
1376or an empty string, then the forwarding is requested to listen on all
1377interfaces.
1378Specifying a remote
1379.Ar bind_address
Damien Millerf8c55462005-03-02 12:03:05 +11001380will only succeed if the server's
1381.Cm GatewayPorts
Damien Millerf91ee4c2005-03-01 21:24:33 +11001382option is enabled (see
Damien Millerf8c55462005-03-02 12:03:05 +11001383.Xr sshd_config 5 ) .
Damien Miller21771e22011-05-15 08:45:50 +10001384.It Cm RequestTTY
1385Specifies whether to request a pseudo-tty for the session.
1386The argument may be one of:
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001387.Cm no
Damien Miller21771e22011-05-15 08:45:50 +10001388(never request a TTY),
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001389.Cm yes
Damien Miller21771e22011-05-15 08:45:50 +10001390(always request a TTY when standard input is a TTY),
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001391.Cm force
Damien Miller21771e22011-05-15 08:45:50 +10001392(always request a TTY) or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001393.Cm auto
Damien Miller21771e22011-05-15 08:45:50 +10001394(request a TTY when opening a login session).
1395This option mirrors the
1396.Fl t
1397and
1398.Fl T
1399flags for
1400.Xr ssh 1 .
djm@openbsd.org5e39a492014-12-04 02:24:32 +00001401.It Cm RevokedHostKeys
1402Specifies revoked host public keys.
1403Keys listed in this file will be refused for host authentication.
1404Note that if this file does not exist or is not readable,
1405then host authentication will be refused for all hosts.
1406Keys may be specified as a text file, listing one public key per line, or as
1407an OpenSSH Key Revocation List (KRL) as generated by
1408.Xr ssh-keygen 1 .
1409For more information on KRLs, see the KEY REVOCATION LISTS section in
1410.Xr ssh-keygen 1 .
Darren Tucker46bc0752004-05-02 22:11:30 +10001411.It Cm SendEnv
1412Specifies what variables from the local
1413.Xr environ 7
1414should be sent to the server.
Damien Miller45ee2b92006-03-15 11:56:18 +11001415The server must also support it, and the server must be configured to
Darren Tucker1e0c9bf2004-05-02 22:12:48 +10001416accept these environment variables.
dtucker@openbsd.org85b96ef2015-04-28 10:17:58 +00001417Note that the
1418.Ev TERM
jmc@openbsd.orgc1d5bcf2015-04-28 13:47:38 +00001419environment variable is always sent whenever a
dtucker@openbsd.org85b96ef2015-04-28 10:17:58 +00001420pseudo-terminal is requested as it is required by the protocol.
Darren Tucker46bc0752004-05-02 22:11:30 +10001421Refer to
1422.Cm AcceptEnv
1423in
1424.Xr sshd_config 5
1425for how to configure the server.
Damien Miller6def5512006-03-15 11:54:05 +11001426Variables are specified by name, which may contain wildcard characters.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +10001427Multiple environment variables may be separated by whitespace or spread
Darren Tucker46bc0752004-05-02 22:11:30 +10001428across multiple
1429.Cm SendEnv
1430directives.
Damien Millerf54a4b92006-03-15 11:54:36 +11001431.Pp
1432See
1433.Sx PATTERNS
1434for more information on patterns.
djm@openbsd.org555294a2018-04-06 13:02:39 +00001435.Pp
jmc@openbsd.org83685712018-04-07 13:50:10 +00001436It is possible to clear previously set
djm@openbsd.org555294a2018-04-06 13:02:39 +00001437.Cm SendEnv
1438variable names by prefixing patterns with
1439.Pa - .
1440The default is not to send any environment variables.
Damien Miller509b0102003-12-17 16:33:10 +11001441.It Cm ServerAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +11001442Sets the number of server alive messages (see below) which may be
Damien Miller509b0102003-12-17 16:33:10 +11001443sent without
Damien Miller45ee2b92006-03-15 11:56:18 +11001444.Xr ssh 1
Damien Miller509b0102003-12-17 16:33:10 +11001445receiving any messages back from the server.
1446If this threshold is reached while server alive messages are being sent,
Damien Miller45ee2b92006-03-15 11:56:18 +11001447ssh will disconnect from the server, terminating the session.
Damien Miller509b0102003-12-17 16:33:10 +11001448It is important to note that the use of server alive messages is very
1449different from
1450.Cm TCPKeepAlive
1451(below).
1452The server alive messages are sent through the encrypted channel
1453and therefore will not be spoofable.
1454The TCP keepalive option enabled by
1455.Cm TCPKeepAlive
1456is spoofable.
1457The server alive mechanism is valuable when the client or
1458server depend on knowing when a connection has become inactive.
1459.Pp
1460The default value is 3.
1461If, for example,
1462.Cm ServerAliveInterval
Damien Miller45ee2b92006-03-15 11:56:18 +11001463(see below) is set to 15 and
Damien Miller509b0102003-12-17 16:33:10 +11001464.Cm ServerAliveCountMax
Damien Miller45ee2b92006-03-15 11:56:18 +11001465is left at the default, if the server becomes unresponsive,
1466ssh will disconnect after approximately 45 seconds.
Damien Miller957d4e42005-12-13 19:30:45 +11001467.It Cm ServerAliveInterval
1468Sets a timeout interval in seconds after which if no data has been received
1469from the server,
Damien Miller45ee2b92006-03-15 11:56:18 +11001470.Xr ssh 1
Damien Miller957d4e42005-12-13 19:30:45 +11001471will send a message through the encrypted
1472channel to request a response from the server.
1473The default
1474is 0, indicating that these messages will not be sent to the server.
jmc@openbsd.orgacf42602018-06-09 06:36:31 +00001475.It Cm SetEnv
1476Directly specify one or more environment variables and their contents to
1477be sent to the server.
1478Similarly to
1479.Cm SendEnv ,
1480the server must be prepared to accept the environment variable.
Damien Miller7acefbb2014-07-18 14:11:24 +10001481.It Cm StreamLocalBindMask
1482Sets the octal file creation mode mask
1483.Pq umask
1484used when creating a Unix-domain socket file for local or remote
1485port forwarding.
1486This option is only used for port forwarding to a Unix-domain socket file.
1487.Pp
1488The default value is 0177, which creates a Unix-domain socket file that is
1489readable and writable only by the owner.
1490Note that not all operating systems honor the file mode on Unix-domain
1491socket files.
1492.It Cm StreamLocalBindUnlink
1493Specifies whether to remove an existing Unix-domain socket file for local
1494or remote port forwarding before creating a new one.
1495If the socket file already exists and
1496.Cm StreamLocalBindUnlink
1497is not enabled,
1498.Nm ssh
1499will be unable to forward the port to the Unix-domain socket file.
1500This option is only used for port forwarding to a Unix-domain socket file.
1501.Pp
1502The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001503.Cm yes
Damien Miller7acefbb2014-07-18 14:11:24 +10001504or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001505.Cm no
1506(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +00001507.It Cm StrictHostKeyChecking
1508If this flag is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001509.Cm yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +11001510.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001511will never automatically add host keys to the
Damien Miller167ea5d2005-05-26 12:04:02 +10001512.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +00001513file, and refuses to connect to hosts whose host key has changed.
dtucker@openbsd.org3e615092018-02-06 06:01:54 +00001514This provides maximum protection against man-in-the-middle (MITM) attacks,
Damien Miller45ee2b92006-03-15 11:56:18 +11001515though it can be annoying when the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001516.Pa /etc/ssh/ssh_known_hosts
Damien Miller45ee2b92006-03-15 11:56:18 +11001517file is poorly maintained or when connections to new hosts are
Ben Lindstrom9f049032002-06-21 00:59:05 +00001518frequently made.
1519This option forces the user to manually
1520add all new hosts.
jmc@openbsd.org149a8cd2017-09-04 06:34:43 +00001521.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001522If this flag is set to
djm@openbsd.org22376d22017-09-03 23:33:13 +00001523.Dq accept-new
jmc@openbsd.org149a8cd2017-09-04 06:34:43 +00001524then ssh will automatically add new host keys to the user
djm@openbsd.org22376d22017-09-03 23:33:13 +00001525known hosts files, but will not permit connections to hosts with
1526changed host keys.
1527If this flag is set to
1528.Dq no
1529or
1530.Dq off ,
jmc@openbsd.org149a8cd2017-09-04 06:34:43 +00001531ssh will automatically add new host keys to the user known hosts files
1532and allow connections to hosts with changed hostkeys to proceed,
1533subject to some restrictions.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001534If this flag is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001535.Cm ask
1536(the default),
Ben Lindstrom9f049032002-06-21 00:59:05 +00001537new host keys
1538will be added to the user known host files only after the user
1539has confirmed that is what they really want to do, and
Damien Miller45ee2b92006-03-15 11:56:18 +11001540ssh will refuse to connect to hosts whose host key has changed.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001541The host keys of
1542known hosts will be verified automatically in all cases.
jmc@openbsd.org47a287b2017-04-28 06:15:03 +00001543.It Cm SyslogFacility
1544Gives the facility code that is used when logging messages from
1545.Xr ssh 1 .
1546The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1547LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1548The default is USER.
Damien Miller12c150e2003-12-17 16:31:10 +11001549.It Cm TCPKeepAlive
1550Specifies whether the system should send TCP keepalive messages to the
1551other side.
1552If they are sent, death of the connection or crash of one
1553of the machines will be properly noticed.
1554However, this means that
1555connections will die if the route is down temporarily, and some people
1556find it annoying.
1557.Pp
1558The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001559.Cm yes
Damien Miller12c150e2003-12-17 16:31:10 +11001560(to send TCP keepalive messages), and the client will notice
1561if the network goes down or the remote host dies.
1562This is important in scripts, and many users want it too.
1563.Pp
1564To disable TCP keepalive messages, the value should be set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001565.Cm no .
djm@openbsd.orga7c38212018-02-10 09:03:54 +00001566See also
1567.Cm ServerAliveInterval
1568for protocol-level keepalives.
Damien Millerd27b9472005-12-13 19:29:02 +11001569.It Cm Tunnel
Damien Miller991dba42006-07-10 20:16:27 +10001570Request
Damien Millerd27b9472005-12-13 19:29:02 +11001571.Xr tun 4
Damien Miller7746c392005-12-13 19:33:37 +11001572device forwarding between the client and the server.
Damien Millerd27b9472005-12-13 19:29:02 +11001573The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001574.Cm yes ,
1575.Cm point-to-point
Damien Miller991dba42006-07-10 20:16:27 +10001576(layer 3),
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001577.Cm ethernet
Damien Miller991dba42006-07-10 20:16:27 +10001578(layer 2),
Damien Millerd27b9472005-12-13 19:29:02 +11001579or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001580.Cm no
1581(the default).
Damien Miller991dba42006-07-10 20:16:27 +10001582Specifying
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001583.Cm yes
Damien Miller991dba42006-07-10 20:16:27 +10001584requests the default tunnel mode, which is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001585.Cm point-to-point .
Damien Millerd27b9472005-12-13 19:29:02 +11001586.It Cm TunnelDevice
Damien Miller991dba42006-07-10 20:16:27 +10001587Specifies the
Damien Millerd27b9472005-12-13 19:29:02 +11001588.Xr tun 4
Damien Miller991dba42006-07-10 20:16:27 +10001589devices to open on the client
1590.Pq Ar local_tun
1591and the server
1592.Pq Ar remote_tun .
1593.Pp
1594The argument must be
1595.Sm off
1596.Ar local_tun Op : Ar remote_tun .
1597.Sm on
1598The devices may be specified by numerical ID or the keyword
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001599.Cm any ,
Damien Miller991dba42006-07-10 20:16:27 +10001600which uses the next available tunnel device.
1601If
1602.Ar remote_tun
1603is not specified, it defaults to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001604.Cm any .
Damien Miller991dba42006-07-10 20:16:27 +10001605The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001606.Cm any:any .
djm@openbsd.org1d1092b2015-01-26 12:16:36 +00001607.It Cm UpdateHostKeys
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001608Specifies whether
1609.Xr ssh 1
1610should accept notifications of additional hostkeys from the server sent
1611after authentication has completed and add them to
1612.Cm UserKnownHostsFile .
1613The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001614.Cm yes ,
1615.Cm no
djm@openbsd.org523463a2015-02-16 22:13:32 +00001616(the default) or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001617.Cm ask .
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001618Enabling this option allows learning alternate hostkeys for a server
djm@openbsd.org1d1092b2015-01-26 12:16:36 +00001619and supports graceful key rotation by allowing a server to send replacement
1620public keys before old ones are removed.
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001621Additional hostkeys are only accepted if the key used to authenticate the
sobrado@openbsd.orge3cbb062015-09-22 08:33:23 +00001622host was already trusted or explicitly accepted by the user.
djm@openbsd.org523463a2015-02-16 22:13:32 +00001623If
1624.Cm UpdateHostKeys
1625is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001626.Cm ask ,
djm@openbsd.org523463a2015-02-16 22:13:32 +00001627then the user is asked to confirm the modifications to the known_hosts file.
djm@openbsd.org44732de2015-02-20 22:17:21 +00001628Confirmation is currently incompatible with
1629.Cm ControlPersist ,
1630and will be disabled if it is enabled.
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001631.Pp
1632Presently, only
1633.Xr sshd 8
1634from OpenSSH 6.8 and greater support the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001635.Qq hostkeys@openssh.com
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001636protocol extension used to inform the client of all the server's hostkeys.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001637.It Cm User
1638Specifies the user to log in as.
1639This can be useful when a different user name is used on different machines.
1640This saves the trouble of
1641having to remember to give the user name on the command line.
1642.It Cm UserKnownHostsFile
Damien Miller295ee632011-05-29 21:42:31 +10001643Specifies one or more files to use for the user
1644host key database, separated by whitespace.
1645The default is
1646.Pa ~/.ssh/known_hosts ,
1647.Pa ~/.ssh/known_hosts2 .
Damien Miller37876e92003-05-15 10:19:46 +10001648.It Cm VerifyHostKeyDNS
1649Specifies whether to verify the remote key using DNS and SSHFP resource
1650records.
Damien Miller150b5572003-11-17 21:19:29 +11001651If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001652.Cm yes ,
Damien Millerfe448472003-11-17 21:19:49 +11001653the client will implicitly trust keys that match a secure fingerprint
Damien Miller150b5572003-11-17 21:19:29 +11001654from DNS.
1655Insecure fingerprints will be handled as if this option was set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001656.Cm ask .
Damien Miller150b5572003-11-17 21:19:29 +11001657If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001658.Cm ask ,
Damien Miller150b5572003-11-17 21:19:29 +11001659information on fingerprint match will be displayed, but the user will still
1660need to confirm new host keys according to the
1661.Cm StrictHostKeyChecking
1662option.
Damien Miller37876e92003-05-15 10:19:46 +10001663The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001664.Cm no .
Damien Miller45ee2b92006-03-15 11:56:18 +11001665.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001666See also
1667.Sx VERIFYING HOST KEYS
1668in
Damien Miller45ee2b92006-03-15 11:56:18 +11001669.Xr ssh 1 .
Damien Miller10288242008-06-30 00:04:03 +10001670.It Cm VisualHostKey
1671If this flag is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001672.Cm yes ,
Damien Miller10288242008-06-30 00:04:03 +10001673an ASCII art representation of the remote host key fingerprint is
djm@openbsd.orgb79efde2014-12-21 23:12:42 +00001674printed in addition to the fingerprint string at login and
Damien Millera414cd32008-11-03 19:25:21 +11001675for unknown host keys.
Damien Miller10288242008-06-30 00:04:03 +10001676If this flag is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001677.Cm no
1678(the default),
Damien Millera414cd32008-11-03 19:25:21 +11001679no fingerprint strings are printed at login and
djm@openbsd.orgb79efde2014-12-21 23:12:42 +00001680only the fingerprint string will be printed for unknown host keys.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001681.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001682Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001683.Xr xauth 1
1684program.
1685The default is
1686.Pa /usr/X11R6/bin/xauth .
1687.El
Damien Millerb5282c22006-03-15 11:59:08 +11001688.Sh PATTERNS
1689A
1690.Em pattern
1691consists of zero or more non-whitespace characters,
1692.Sq *
1693(a wildcard that matches zero or more characters),
1694or
1695.Sq ?\&
1696(a wildcard that matches exactly one character).
1697For example, to specify a set of declarations for any host in the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001698.Qq .co.uk
Damien Millerb5282c22006-03-15 11:59:08 +11001699set of domains,
1700the following pattern could be used:
1701.Pp
1702.Dl Host *.co.uk
1703.Pp
1704The following pattern
1705would match any host in the 192.168.0.[0-9] network range:
1706.Pp
1707.Dl Host 192.168.0.?
1708.Pp
1709A
1710.Em pattern-list
1711is a comma-separated list of patterns.
1712Patterns within pattern-lists may be negated
1713by preceding them with an exclamation mark
1714.Pq Sq !\& .
1715For example,
Damien Miller51682fa2013-10-17 11:48:31 +11001716to allow a key to be used from anywhere within an organization
Damien Millerb5282c22006-03-15 11:59:08 +11001717except from the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001718.Qq dialup
Damien Millerb5282c22006-03-15 11:59:08 +11001719pool,
1720the following entry (in authorized_keys) could be used:
1721.Pp
1722.Dl from=\&"!*.dialup.example.com,*.example.com\&"
djm@openbsd.org05b69e92017-10-18 02:49:44 +00001723.Pp
1724Note that a negated match will never produce a positive result by itself.
1725For example, attempting to match
1726.Qq host3
1727against the following pattern-list will fail:
1728.Pp
1729.Dl from=\&"!host1,!host2\&"
1730.Pp
1731The solution here is to include a term that will yield a positive match,
1732such as a wildcard:
1733.Pp
1734.Dl from=\&"!host1,!host2,*\&"
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001735.Sh TOKENS
1736Arguments to some keywords can make use of tokens,
1737which are expanded at runtime:
1738.Pp
1739.Bl -tag -width XXXX -offset indent -compact
1740.It %%
1741A literal
1742.Sq % .
1743.It \&%C
jmc@openbsd.org2b4f3ab2017-10-05 12:56:50 +00001744Hash of %l%h%p%r.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001745.It %d
1746Local user's home directory.
1747.It %h
1748The remote hostname.
1749.It %i
1750The local user ID.
1751.It %L
1752The local hostname.
1753.It %l
1754The local hostname, including the domain name.
1755.It %n
1756The original remote hostname, as given on the command line.
1757.It %p
1758The remote port.
1759.It %r
1760The remote username.
djm@openbsd.orgb7548b12017-10-23 05:08:00 +00001761.It \&%T
1762The local
1763.Xr tun 4
1764or
1765.Xr tap 4
1766network interface assigned if
jmc@openbsd.org08696272017-10-24 06:27:42 +00001767tunnel forwarding was requested, or
1768.Qq NONE
djm@openbsd.orgb7548b12017-10-23 05:08:00 +00001769otherwise.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001770.It %u
1771The local username.
1772.El
1773.Pp
1774.Cm Match exec
djm@openbsd.org9c935dd2018-06-01 03:33:53 +00001775accepts the tokens %%, %h, %i, %L, %l, %n, %p, %r, and %u.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001776.Pp
1777.Cm CertificateFile
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001778accepts the tokens %%, %d, %h, %i, %l, %r, and %u.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001779.Pp
1780.Cm ControlPath
1781accepts the tokens %%, %C, %h, %i, %L, %l, %n, %p, %r, and %u.
1782.Pp
1783.Cm HostName
1784accepts the tokens %% and %h.
1785.Pp
1786.Cm IdentityAgent
1787and
1788.Cm IdentityFile
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001789accept the tokens %%, %d, %h, %i, %l, %r, and %u.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001790.Pp
1791.Cm LocalCommand
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001792accepts the tokens %%, %C, %d, %h, %i, %l, %n, %p, %r, %T, and %u.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001793.Pp
1794.Cm ProxyCommand
1795accepts the tokens %%, %h, %p, and %r.
jmc@openbsd.orga3bb2502017-05-30 19:38:17 +00001796.Pp
1797.Cm RemoteCommand
djm@openbsd.org9c935dd2018-06-01 03:33:53 +00001798accepts the tokens %%, %C, %d, %h, %i, %l, %n, %p, %r, and %u.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001799.Sh FILES
1800.Bl -tag -width Ds
Damien Miller167ea5d2005-05-26 12:04:02 +10001801.It Pa ~/.ssh/config
Ben Lindstrom9f049032002-06-21 00:59:05 +00001802This is the per-user configuration file.
1803The format of this file is described above.
Damien Miller45ee2b92006-03-15 11:56:18 +11001804This file is used by the SSH client.
Damien Millerc970cb92004-04-20 20:12:53 +10001805Because of the potential for abuse, this file must have strict permissions:
1806read/write for the user, and not accessible by others.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001807.It Pa /etc/ssh/ssh_config
1808Systemwide configuration file.
1809This file provides defaults for those
1810values that are not specified in the user's configuration file, and
1811for those users who do not have a configuration file.
1812This file must be world-readable.
1813.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001814.Sh SEE ALSO
1815.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001816.Sh AUTHORS
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001817.An -nosplit
Ben Lindstrom9f049032002-06-21 00:59:05 +00001818OpenSSH is a derivative of the original and free
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001819ssh 1.2.12 release by
1820.An Tatu Ylonen .
1821.An Aaron Campbell , Bob Beck , Markus Friedl ,
1822.An Niels Provos , Theo de Raadt
1823and
1824.An Dug Song
Ben Lindstrom9f049032002-06-21 00:59:05 +00001825removed many bugs, re-added newer features and
1826created OpenSSH.
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001827.An Markus Friedl
1828contributed the support for SSH protocol versions 1.5 and 2.0.