blob: 4d5b01d3eaceea637d478cc6dfbe09f52bd162a5 [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.\"
djm@openbsd.org5eff5b82018-10-03 06:38:35 +000036.\" $OpenBSD: ssh_config.5,v 1.286 2018/10/03 06:38:35 djm Exp $
37.Dd $Mdocdate: October 3 2018 $
Ben Lindstrom9f049032002-06-21 00:59:05 +000038.Dt SSH_CONFIG 5
39.Os
40.Sh NAME
41.Nm ssh_config
42.Nd OpenSSH SSH client configuration files
Ben Lindstrom9f049032002-06-21 00:59:05 +000043.Sh DESCRIPTION
Damien Miller45ee2b92006-03-15 11:56:18 +110044.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +000045obtains configuration data from the following sources in
46the following order:
Damien Miller5c853b52006-03-15 11:37:02 +110047.Pp
Ben Lindstrom479b4762002-08-20 19:04:51 +000048.Bl -enum -offset indent -compact
49.It
50command-line options
51.It
52user's configuration file
Damien Miller167ea5d2005-05-26 12:04:02 +100053.Pq Pa ~/.ssh/config
Ben Lindstrom479b4762002-08-20 19:04:51 +000054.It
55system-wide configuration file
56.Pq Pa /etc/ssh/ssh_config
57.El
Ben Lindstrom9f049032002-06-21 00:59:05 +000058.Pp
59For each parameter, the first obtained value
60will be used.
Darren Tucker43d8e282005-02-09 09:51:08 +110061The configuration files contain sections separated by
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +000062.Cm Host
Ben Lindstrom9f049032002-06-21 00:59:05 +000063specifications, and that section is only applied for hosts that
64match one of the patterns given in the specification.
djm@openbsd.org957fbce2014-10-08 22:20:25 +000065The matched host name is usually the one given on the command line
66(see the
67.Cm CanonicalizeHostname
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +000068option for exceptions).
Ben Lindstrom9f049032002-06-21 00:59:05 +000069.Pp
70Since the first obtained value for each parameter is used, more
71host-specific declarations should be given near the beginning of the
72file, and general defaults at the end.
73.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +000074The file contains keyword-argument pairs, one per line.
75Lines starting with
Ben Lindstrom9f049032002-06-21 00:59:05 +000076.Ql #
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +000077and empty lines are interpreted as comments.
78Arguments may optionally be enclosed in double quotes
79.Pq \&"
80in order to represent arguments containing spaces.
Ben Lindstrom9f049032002-06-21 00:59:05 +000081Configuration options may be separated by whitespace or
82optional whitespace and exactly one
83.Ql = ;
84the latter format is useful to avoid the need to quote whitespace
85when specifying configuration options using the
86.Nm ssh ,
Damien Miller4aea9742006-03-15 11:59:39 +110087.Nm scp ,
Ben Lindstrom9f049032002-06-21 00:59:05 +000088and
89.Nm sftp
90.Fl o
91option.
92.Pp
93The possible
94keywords and their meanings are as follows (note that
95keywords are case-insensitive and arguments are case-sensitive):
96.Bl -tag -width Ds
97.It Cm Host
98Restricts the following declarations (up to the next
99.Cm Host
Damien Miller194fd902013-10-15 12:13:05 +1100100or
101.Cm Match
Ben Lindstrom9f049032002-06-21 00:59:05 +0000102keyword) to be only for those hosts that match one of the patterns
103given after the keyword.
Damien Millerfa51b162008-11-03 19:17:33 +1100104If more than one pattern is provided, they should be separated by whitespace.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000105A single
Damien Miller208f1ed2006-03-15 11:56:03 +1100106.Ql *
Ben Lindstrom9f049032002-06-21 00:59:05 +0000107as a pattern can be used to provide global
108defaults for all hosts.
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000109The host is usually the
Ben Lindstrom9f049032002-06-21 00:59:05 +0000110.Ar hostname
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000111argument given on the command line
112(see the
113.Cm CanonicalizeHostname
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000114keyword for exceptions).
Damien Millerf54a4b92006-03-15 11:54:36 +1100115.Pp
Damien Millerfe924212011-05-15 08:44:45 +1000116A pattern entry may be negated by prefixing it with an exclamation mark
117.Pq Sq !\& .
118If a negated entry is matched, then the
119.Cm Host
120entry is ignored, regardless of whether any other patterns on the line
121match.
122Negated matches are therefore useful to provide exceptions for wildcard
123matches.
124.Pp
Damien Millerf54a4b92006-03-15 11:54:36 +1100125See
126.Sx PATTERNS
127for more information on patterns.
Damien Millerd77b81f2013-10-17 11:39:00 +1100128.It Cm Match
Damien Miller194fd902013-10-15 12:13:05 +1100129Restricts the following declarations (up to the next
130.Cm Host
131or
132.Cm Match
133keyword) to be used only when the conditions following the
134.Cm Match
135keyword are satisfied.
sobrado@openbsd.orge3cbb062015-09-22 08:33:23 +0000136Match conditions are specified using one or more criteria
Damien Millercf31f382013-10-24 21:02:56 +1100137or the single token
138.Cm all
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000139which always matches.
140The available criteria keywords are:
141.Cm canonical ,
Damien Miller8a04be72013-10-23 16:29:40 +1100142.Cm exec ,
Damien Miller194fd902013-10-15 12:13:05 +1100143.Cm host ,
144.Cm originalhost ,
145.Cm user ,
146and
147.Cm localuser .
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000148The
149.Cm all
150criteria must appear alone or immediately after
jmc@openbsd.orgb1ba15f2014-10-09 06:21:31 +0000151.Cm canonical .
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000152Other criteria may be combined arbitrarily.
153All criteria but
154.Cm all
155and
156.Cm canonical
157require an argument.
158Criteria may be negated by prepending an exclamation mark
159.Pq Sq !\& .
Damien Miller194fd902013-10-15 12:13:05 +1100160.Pp
Damien Miller8e5a67f2013-10-23 16:30:25 +1100161The
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000162.Cm canonical
dtucker@openbsd.orgdd2cfeb2015-05-28 05:09:45 +0000163keyword matches only when the configuration file is being re-parsed
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000164after hostname canonicalization (see the
165.Cm CanonicalizeHostname
166option.)
167This may be useful to specify conditions that work with canonical host
168names only.
169The
Damien Miller8a04be72013-10-23 16:29:40 +1100170.Cm exec
Damien Miller8e5a67f2013-10-23 16:30:25 +1100171keyword executes the specified command under the user's shell.
Damien Miller194fd902013-10-15 12:13:05 +1100172If the command returns a zero exit status then the condition is considered true.
173Commands containing whitespace characters must be quoted.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000174Arguments to
175.Cm exec
176accept the tokens described in the
177.Sx TOKENS
178section.
Damien Miller194fd902013-10-15 12:13:05 +1100179.Pp
180The other keywords' criteria must be single entries or comma-separated
181lists and may use the wildcard and negation operators described in the
182.Sx PATTERNS
183section.
184The criteria for the
185.Cm host
186keyword are matched against the target hostname, after any substitution
187by the
188.Cm Hostname
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000189or
190.Cm CanonicalizeHostname
191options.
Damien Miller194fd902013-10-15 12:13:05 +1100192The
193.Cm originalhost
194keyword matches against the hostname as it was specified on the command-line.
195The
196.Cm user
197keyword matches against the target username on the remote host.
198The
199.Cm localuser
200keyword matches against the name of the local user running
201.Xr ssh 1
202(this keyword may be useful in system-wide
203.Nm
204files).
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000205.It Cm AddKeysToAgent
206Specifies whether keys should be automatically added to a running
jmc@openbsd.orge41a0712015-11-15 23:58:04 +0000207.Xr ssh-agent 1 .
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000208If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000209.Cm yes
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000210and a key is loaded from a file, the key and its passphrase are added to
211the agent with the default lifetime, as if by
212.Xr ssh-add 1 .
213If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000214.Cm ask ,
215.Xr ssh 1
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000216will require confirmation using the
217.Ev SSH_ASKPASS
218program before adding a key (see
219.Xr ssh-add 1
220for details).
221If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000222.Cm confirm ,
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000223each use of the key must be confirmed, as if the
224.Fl c
225option was specified to
226.Xr ssh-add 1 .
227If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000228.Cm no ,
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000229no keys are added to the agent.
230The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000231.Cm yes ,
232.Cm confirm ,
233.Cm ask ,
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000234or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000235.Cm no
236(the default).
Damien Miller20a8f972003-05-18 20:50:30 +1000237.It Cm AddressFamily
Damien Millerfbf486b2003-05-23 18:44:23 +1000238Specifies which address family to use when connecting.
239Valid arguments are
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000240.Cm any
241(the default),
242.Cm inet
Damien Miller45ee2b92006-03-15 11:56:18 +1100243(use IPv4 only), or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000244.Cm inet6
Darren Tucker79a7acf2005-02-09 09:48:57 +1100245(use IPv6 only).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000246.It Cm BatchMode
247If set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000248.Cm yes ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000249passphrase/password querying will be disabled.
250This option is useful in scripts and other batch jobs where no user
251is present to supply the password.
252The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000253.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000254or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000255.Cm no
256(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000257.It Cm BindAddress
Darren Tucker89f4d472005-07-14 17:06:21 +1000258Use the specified address on the local machine as the source address of
Darren Tucker6c71d202005-07-14 17:06:50 +1000259the connection.
260Only useful on systems with more than one address.
jmc@openbsd.org7d330a12018-02-23 07:38:09 +0000261.It Cm BindInterface
262Use the address of the specified interface on the local machine as the
263source address of the connection.
Damien Miller0faf7472013-10-17 11:47:23 +1100264.It Cm CanonicalDomains
Damien Miller607af342013-10-17 11:47:51 +1100265When
Damien Miller38505592013-10-17 11:48:13 +1100266.Cm CanonicalizeHostname
Damien Miller0faf7472013-10-17 11:47:23 +1100267is enabled, this option specifies the list of domain suffixes in which to
268search for the specified destination host.
Damien Miller38505592013-10-17 11:48:13 +1100269.It Cm CanonicalizeFallbackLocal
Damien Miller51682fa2013-10-17 11:48:31 +1100270Specifies whether to fail with an error when hostname canonicalization fails.
Damien Miller607af342013-10-17 11:47:51 +1100271The default,
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000272.Cm yes ,
Damien Miller607af342013-10-17 11:47:51 +1100273will attempt to look up the unqualified hostname using the system resolver's
Damien Miller0faf7472013-10-17 11:47:23 +1100274search rules.
275A value of
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000276.Cm no
Damien Miller0faf7472013-10-17 11:47:23 +1100277will cause
278.Xr ssh 1
279to fail instantly if
Damien Miller38505592013-10-17 11:48:13 +1100280.Cm CanonicalizeHostname
Damien Miller0faf7472013-10-17 11:47:23 +1100281is enabled and the target hostname cannot be found in any of the domains
282specified by
283.Cm CanonicalDomains .
Damien Miller38505592013-10-17 11:48:13 +1100284.It Cm CanonicalizeHostname
Damien Miller51682fa2013-10-17 11:48:31 +1100285Controls whether explicit hostname canonicalization is performed.
Damien Miller607af342013-10-17 11:47:51 +1100286The default,
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000287.Cm no ,
Damien Miller0faf7472013-10-17 11:47:23 +1100288is not to perform any name rewriting and let the system resolver handle all
289hostname lookups.
290If set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000291.Cm yes
Damien Miller0faf7472013-10-17 11:47:23 +1100292then, for connections that do not use a
djm@openbsd.org383a33d2018-09-21 03:11:36 +0000293.Cm ProxyCommand
294or
295.Cm ProxyJump ,
Damien Miller0faf7472013-10-17 11:47:23 +1100296.Xr ssh 1
Damien Miller38505592013-10-17 11:48:13 +1100297will attempt to canonicalize the hostname specified on the command line
Damien Miller0faf7472013-10-17 11:47:23 +1100298using the
299.Cm CanonicalDomains
300suffixes and
Damien Miller38505592013-10-17 11:48:13 +1100301.Cm CanonicalizePermittedCNAMEs
Damien Miller0faf7472013-10-17 11:47:23 +1100302rules.
303If
Damien Miller38505592013-10-17 11:48:13 +1100304.Cm CanonicalizeHostname
Damien Miller0faf7472013-10-17 11:47:23 +1100305is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000306.Cm always ,
Damien Miller51682fa2013-10-17 11:48:31 +1100307then canonicalization is applied to proxied connections too.
Damien Miller13f97b22014-02-24 15:57:55 +1100308.Pp
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000309If this option is enabled, then the configuration files are processed
310again using the new target name to pick up any new configuration in matching
Damien Miller13f97b22014-02-24 15:57:55 +1100311.Cm Host
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000312and
313.Cm Match
Damien Miller13f97b22014-02-24 15:57:55 +1100314stanzas.
Damien Miller38505592013-10-17 11:48:13 +1100315.It Cm CanonicalizeMaxDots
Damien Miller607af342013-10-17 11:47:51 +1100316Specifies the maximum number of dot characters in a hostname before
Damien Miller51682fa2013-10-17 11:48:31 +1100317canonicalization is disabled.
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000318The default, 1,
Damien Miller607af342013-10-17 11:47:51 +1100319allows a single dot (i.e. hostname.subdomain).
Damien Miller38505592013-10-17 11:48:13 +1100320.It Cm CanonicalizePermittedCNAMEs
Damien Miller607af342013-10-17 11:47:51 +1100321Specifies rules to determine whether CNAMEs should be followed when
Damien Miller38505592013-10-17 11:48:13 +1100322canonicalizing hostnames.
Damien Miller0faf7472013-10-17 11:47:23 +1100323The rules consist of one or more arguments of
Damien Miller607af342013-10-17 11:47:51 +1100324.Ar source_domain_list : Ns Ar target_domain_list ,
Damien Miller0faf7472013-10-17 11:47:23 +1100325where
326.Ar source_domain_list
Damien Miller51682fa2013-10-17 11:48:31 +1100327is a pattern-list of domains that may follow CNAMEs in canonicalization,
Damien Miller0faf7472013-10-17 11:47:23 +1100328and
329.Ar target_domain_list
Damien Miller607af342013-10-17 11:47:51 +1100330is a pattern-list of domains that they may resolve to.
Damien Miller0faf7472013-10-17 11:47:23 +1100331.Pp
332For example,
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000333.Qq *.a.example.com:*.b.example.com,*.c.example.com
Damien Miller0faf7472013-10-17 11:47:23 +1100334will allow hostnames matching
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000335.Qq *.a.example.com
Damien Miller38505592013-10-17 11:48:13 +1100336to be canonicalized to names in the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000337.Qq *.b.example.com
Damien Miller0faf7472013-10-17 11:47:23 +1100338or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000339.Qq *.c.example.com
Damien Miller0faf7472013-10-17 11:47:23 +1100340domains.
jmc@openbsd.orge6933a22018-09-20 06:58:48 +0000341.It Cm CASignatureAlgorithms
342Specifies which algorithms are allowed for signing of certificates
343by certificate authorities (CAs).
344The default is:
345.Bd -literal -offset indent
346ecdsa-sha2-nistp256.ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
347ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
348.Ed
349.Pp
350.Xr ssh 1
351will not accept host certificates signed using algorithms other than those
352specified.
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000353.It Cm CertificateFile
354Specifies a file from which the user's certificate is read.
355A corresponding private key must be provided separately in order
356to use this certificate either
357from an
358.Cm IdentityFile
359directive or
360.Fl i
361flag to
362.Xr ssh 1 ,
363via
364.Xr ssh-agent 1 ,
365or via a
366.Cm PKCS11Provider .
367.Pp
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000368Arguments to
369.Cm CertificateFile
370may use the tilde syntax to refer to a user's home directory
371or the tokens described in the
372.Sx TOKENS
373section.
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000374.Pp
375It is possible to have multiple certificate files specified in
376configuration files; these certificates will be tried in sequence.
377Multiple
378.Cm CertificateFile
379directives will add to the list of certificates used for
380authentication.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000381.It Cm ChallengeResponseAuthentication
Damien Miller1faa7132006-03-15 11:55:31 +1100382Specifies whether to use challenge-response authentication.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000383The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000384.Cm yes
385(the default)
Ben Lindstrom9f049032002-06-21 00:59:05 +0000386or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000387.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000388.It Cm CheckHostIP
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000389If set to
390.Cm yes
391(the default),
Damien Miller45ee2b92006-03-15 11:56:18 +1100392.Xr ssh 1
393will additionally check the host IP address in the
Ben Lindstrom9f049032002-06-21 00:59:05 +0000394.Pa known_hosts
395file.
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000396This allows it to detect if a host key changed due to DNS spoofing
djm@openbsd.org5e678592015-06-02 09:10:40 +0000397and will add addresses of destination hosts to
398.Pa ~/.ssh/known_hosts
399in the process, regardless of the setting of
400.Cm StrictHostKeyChecking .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000401If the option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000402.Cm no ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000403the check will not be executed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000404.It Cm Ciphers
djm@openbsd.org788ac792017-04-30 23:18:22 +0000405Specifies the ciphers allowed and their order of preference.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000406Multiple ciphers must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000407If the specified value begins with a
408.Sq +
409character, then the specified ciphers will be appended to the default set
410instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000411If the specified value begins with a
412.Sq -
413character, then the specified ciphers (including wildcards) will be removed
414from the default set instead of replacing them.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000415.Pp
Damien Miller0fde8ac2013-11-21 14:12:23 +1100416The supported ciphers are:
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000417.Bd -literal -offset indent
Damien Millerc1621c82014-04-20 13:22:46 +10004183des-cbc
Damien Millerc1621c82014-04-20 13:22:46 +1000419aes128-cbc
Damien Millerc1621c82014-04-20 13:22:46 +1000420aes192-cbc
Damien Millerc1621c82014-04-20 13:22:46 +1000421aes256-cbc
Damien Millerc1621c82014-04-20 13:22:46 +1000422aes128-ctr
Damien Millerc1621c82014-04-20 13:22:46 +1000423aes192-ctr
Damien Millerc1621c82014-04-20 13:22:46 +1000424aes256-ctr
Damien Millerc1621c82014-04-20 13:22:46 +1000425aes128-gcm@openssh.com
Damien Millerc1621c82014-04-20 13:22:46 +1000426aes256-gcm@openssh.com
Damien Millerc1621c82014-04-20 13:22:46 +1000427chacha20-poly1305@openssh.com
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000428.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100429.Pp
Damien Miller45ee2b92006-03-15 11:56:18 +1100430The default is:
Damien Millerc1621c82014-04-20 13:22:46 +1000431.Bd -literal -offset indent
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000432chacha20-poly1305@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000433aes128-ctr,aes192-ctr,aes256-ctr,
djm@openbsd.org00c52222018-04-05 22:54:28 +0000434aes128-gcm@openssh.com,aes256-gcm@openssh.com
Ben Lindstrom9f049032002-06-21 00:59:05 +0000435.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100436.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000437The list of available ciphers may also be obtained using
438.Qq ssh -Q cipher .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000439.It Cm ClearAllForwardings
Damien Miller45ee2b92006-03-15 11:56:18 +1100440Specifies that all local, remote, and dynamic port forwardings
Ben Lindstrom9f049032002-06-21 00:59:05 +0000441specified in the configuration files or on the command line be
Damien Miller495dca32003-04-01 21:42:14 +1000442cleared.
443This option is primarily useful when used from the
Damien Miller45ee2b92006-03-15 11:56:18 +1100444.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000445command line to clear port forwardings set in
446configuration files, and is automatically set by
447.Xr scp 1
448and
449.Xr sftp 1 .
450The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000451.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000452or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000453.Cm no
454(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000455.It Cm Compression
456Specifies whether to use compression.
457The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000458.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000459or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000460.Cm no
461(the default).
naddy@openbsd.org9a82e242017-05-03 21:49:18 +0000462.It Cm ConnectionAttempts
463Specifies the number of tries (one per second) to make before exiting.
464The argument must be an integer.
465This may be useful in scripts if the connection sometimes fails.
466The default is 1.
Damien Millerb78d5eb2003-05-16 11:39:04 +1000467.It Cm ConnectTimeout
Damien Miller45ee2b92006-03-15 11:56:18 +1100468Specifies the timeout (in seconds) used when connecting to the
469SSH server, instead of using the default system TCP timeout.
Damien Millerfbf486b2003-05-23 18:44:23 +1000470This value is used only when the target is down or really unreachable,
471not when it refuses the connection.
Damien Miller0e220db2004-06-15 10:34:08 +1000472.It Cm ControlMaster
473Enables the sharing of multiple sessions over a single network connection.
474When set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000475.Cm yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +1100476.Xr ssh 1
Damien Miller0e220db2004-06-15 10:34:08 +1000477will listen for connections on a control socket specified using the
478.Cm ControlPath
479argument.
480Additional sessions can connect to this socket using the same
481.Cm ControlPath
482with
483.Cm ControlMaster
484set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000485.Cm no
Damien Miller2234bac2004-06-30 22:38:52 +1000486(the default).
Damien Miller713de762005-11-05 15:13:49 +1100487These sessions will try to reuse the master instance's network connection
Damien Millerb3bfbb72005-11-05 15:11:48 +1100488rather than initiating new ones, but will fall back to connecting normally
489if the control socket does not exist, or is not listening.
490.Pp
Damien Miller23f07702004-06-18 01:19:03 +1000491Setting this to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000492.Cm ask
493will cause
494.Xr ssh 1
jmc@openbsd.org78de1672015-03-30 18:28:37 +0000495to listen for control connections, but require confirmation using
496.Xr ssh-askpass 1 .
Damien Millerdadfd4d2005-05-26 12:07:13 +1000497If the
498.Cm ControlPath
Damien Miller45ee2b92006-03-15 11:56:18 +1100499cannot be opened,
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000500.Xr ssh 1
501will continue without connecting to a master instance.
Damien Millerd14b1e72005-06-16 13:19:41 +1000502.Pp
Damien Miller13390022005-07-06 09:44:19 +1000503X11 and
Damien Millerfd94fba2005-07-06 09:44:59 +1000504.Xr ssh-agent 1
Damien Miller13390022005-07-06 09:44:19 +1000505forwarding is supported over these multiplexed connections, however the
Darren Tucker63551872005-12-20 16:14:15 +1100506display and agent forwarded will be the one belonging to the master
Damien Millerfd94fba2005-07-06 09:44:59 +1000507connection i.e. it is not possible to forward multiple displays or agents.
Damien Miller13390022005-07-06 09:44:19 +1000508.Pp
Damien Millerd14b1e72005-06-16 13:19:41 +1000509Two additional options allow for opportunistic multiplexing: try to use a
510master connection but fall back to creating a new one if one does not already
511exist.
512These options are:
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000513.Cm auto
Damien Millerd14b1e72005-06-16 13:19:41 +1000514and
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000515.Cm autoask .
Damien Millerd14b1e72005-06-16 13:19:41 +1000516The latter requires confirmation like the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000517.Cm ask
Damien Millerd14b1e72005-06-16 13:19:41 +1000518option.
Damien Miller0e220db2004-06-15 10:34:08 +1000519.It Cm ControlPath
Damien Miller6476cad2005-06-16 13:18:34 +1000520Specify the path to the control socket used for connection sharing as described
521in the
Damien Miller0e220db2004-06-15 10:34:08 +1000522.Cm ControlMaster
Damien Miller8f74c8f2005-06-26 08:56:03 +1000523section above or the string
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000524.Cm none
Damien Miller8f74c8f2005-06-26 08:56:03 +1000525to disable connection sharing.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000526Arguments to
527.Cm ControlPath
528may use the tilde syntax to refer to a user's home directory
529or the tokens described in the
530.Sx TOKENS
531section.
Damien Millerd14b1e72005-06-16 13:19:41 +1000532It is recommended that any
533.Cm ControlPath
534used for opportunistic connection sharing include
djm@openbsd.orgfc302562014-11-10 22:25:49 +0000535at least %h, %p, and %r (or alternatively %C) and be placed in a directory
536that is not writable by other users.
Damien Millerd14b1e72005-06-16 13:19:41 +1000537This ensures that shared connections are uniquely identified.
Damien Millere11e1ea2010-08-03 16:04:46 +1000538.It Cm ControlPersist
539When used in conjunction with
540.Cm ControlMaster ,
541specifies that the master connection should remain open
542in the background (waiting for future client connections)
543after the initial client connection has been closed.
544If set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000545.Cm no ,
Damien Millere11e1ea2010-08-03 16:04:46 +1000546then the master connection will not be placed into the background,
547and will close as soon as the initial client connection is closed.
548If set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000549.Cm yes
550or 0,
Damien Millere11e1ea2010-08-03 16:04:46 +1000551then the master connection will remain in the background indefinitely
552(until killed or closed via a mechanism such as the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000553.Qq ssh -O exit ) .
Damien Millere11e1ea2010-08-03 16:04:46 +1000554If set to a time in seconds, or a time in any of the formats documented in
555.Xr sshd_config 5 ,
556then the backgrounded master connection will automatically terminate
557after it has remained idle (with no client connections) for the
558specified time.
Damien Miller2234bac2004-06-30 22:38:52 +1000559.It Cm DynamicForward
Damien Millere9d001e2006-01-14 10:10:17 +1100560Specifies that a TCP port on the local machine be forwarded
Damien Miller2234bac2004-06-30 22:38:52 +1000561over the secure channel, and the application
562protocol is then used to determine where to connect to from the
563remote machine.
Darren Tuckerc8d64212005-10-03 18:13:42 +1000564.Pp
565The argument must be
566.Sm off
567.Oo Ar bind_address : Oc Ar port .
568.Sm on
Damien Miller7fa96602010-08-05 13:03:13 +1000569IPv6 addresses can be specified by enclosing addresses in square brackets.
Darren Tuckerc8d64212005-10-03 18:13:42 +1000570By default, the local port is bound in accordance with the
571.Cm GatewayPorts
572setting.
573However, an explicit
574.Ar bind_address
575may be used to bind the connection to a specific address.
576The
577.Ar bind_address
578of
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000579.Cm localhost
Darren Tuckerc8d64212005-10-03 18:13:42 +1000580indicates that the listening port be bound for local use only, while an
581empty address or
582.Sq *
583indicates that the port should be available from all interfaces.
584.Pp
Damien Miller2234bac2004-06-30 22:38:52 +1000585Currently the SOCKS4 and SOCKS5 protocols are supported, and
Damien Miller45ee2b92006-03-15 11:56:18 +1100586.Xr ssh 1
Damien Miller2234bac2004-06-30 22:38:52 +1000587will act as a SOCKS server.
588Multiple forwardings may be specified, and
589additional forwardings can be given on the command line.
590Only the superuser can forward privileged ports.
Darren Tucker674f71d2003-06-28 12:33:12 +1000591.It Cm EnableSSHKeysign
592Setting this option to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000593.Cm yes
Darren Tucker674f71d2003-06-28 12:33:12 +1000594in the global client configuration file
595.Pa /etc/ssh/ssh_config
596enables the use of the helper program
597.Xr ssh-keysign 8
598during
599.Cm HostbasedAuthentication .
600The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000601.Cm yes
Darren Tucker674f71d2003-06-28 12:33:12 +1000602or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000603.Cm no
604(the default).
Darren Tuckerf132c672003-10-15 15:58:18 +1000605This option should be placed in the non-hostspecific section.
Darren Tucker674f71d2003-06-28 12:33:12 +1000606See
607.Xr ssh-keysign 8
608for more information.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000609.It Cm EscapeChar
610Sets the escape character (default:
611.Ql ~ ) .
612The escape character can also
613be set on the command line.
614The argument should be a single character,
615.Ql ^
616followed by a letter, or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000617.Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +0000618to disable the escape
619character entirely (making the connection transparent for binary
620data).
Darren Tuckere7d4b192006-07-12 22:17:10 +1000621.It Cm ExitOnForwardFailure
622Specifies whether
623.Xr ssh 1
624should terminate the connection if it cannot set up all requested
djm@openbsd.orga954cdb2015-09-04 04:47:50 +0000625dynamic, tunnel, local, and remote port forwardings, (e.g.\&
jmc@openbsd.org5245bc12015-09-04 06:40:45 +0000626if either end is unable to bind and listen on a specified port).
djm@openbsd.orga954cdb2015-09-04 04:47:50 +0000627Note that
628.Cm ExitOnForwardFailure
629does not apply to connections made over port forwardings and will not,
630for example, cause
631.Xr ssh 1
632to exit if TCP connections to the ultimate forwarding destination fail.
Darren Tuckere7d4b192006-07-12 22:17:10 +1000633The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000634.Cm yes
Darren Tuckere7d4b192006-07-12 22:17:10 +1000635or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000636.Cm no
637(the default).
djm@openbsd.orgb79efde2014-12-21 23:12:42 +0000638.It Cm FingerprintHash
639Specifies the hash algorithm used when displaying key fingerprints.
640Valid options are:
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000641.Cm md5
djm@openbsd.orgb79efde2014-12-21 23:12:42 +0000642and
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000643.Cm sha256
644(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000645.It Cm ForwardAgent
646Specifies whether the connection to the authentication agent (if any)
647will be forwarded to the remote machine.
648The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000649.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000650or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000651.Cm no
652(the default).
Damien Milleraf653042002-09-04 16:40:37 +1000653.Pp
Damien Miller495dca32003-04-01 21:42:14 +1000654Agent forwarding should be enabled with caution.
655Users with the ability to bypass file permissions on the remote host
656(for the agent's Unix-domain socket)
657can access the local agent through the forwarded connection.
658An attacker cannot obtain key material from the agent,
Damien Milleraf653042002-09-04 16:40:37 +1000659however they can perform operations on the keys that enable them to
660authenticate using the identities loaded into the agent.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000661.It Cm ForwardX11
662Specifies whether X11 connections will be automatically redirected
663over the secure channel and
664.Ev DISPLAY
665set.
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 +1000672X11 forwarding should be enabled with caution.
673Users with the ability to bypass file permissions on the remote host
Darren Tucker0a118da2003-10-15 15:54:32 +1000674(for the user's X11 authorization database)
Damien Miller495dca32003-04-01 21:42:14 +1000675can access the local X11 display through the forwarded connection.
Darren Tucker0a118da2003-10-15 15:54:32 +1000676An attacker may then be able to perform activities such as keystroke monitoring
677if the
678.Cm ForwardX11Trusted
679option is also enabled.
Damien Miller1ab6a512010-06-26 10:02:24 +1000680.It Cm ForwardX11Timeout
Damien Millercede1db2010-07-02 13:33:48 +1000681Specify a timeout for untrusted X11 forwarding
682using the format described in the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000683.Sx TIME FORMATS
684section of
Damien Miller1ab6a512010-06-26 10:02:24 +1000685.Xr sshd_config 5 .
686X11 connections received by
687.Xr ssh 1
688after this time will be refused.
djm@openbsd.orgb5e412a2018-09-21 12:46:22 +0000689Setting
690.Cm ForwardX11Timeout
691to zero will disable the timeout and permit X11 forwarding for the life
692of the connection.
Damien Miller1ab6a512010-06-26 10:02:24 +1000693The default is to disable untrusted X11 forwarding after twenty minutes has
694elapsed.
Darren Tucker0a118da2003-10-15 15:54:32 +1000695.It Cm ForwardX11Trusted
Darren Tuckerdcf6ec42004-05-13 13:03:56 +1000696If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000697.Cm yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +1100698remote X11 clients will have full access to the original X11 display.
Damien Miller1717fd42005-03-01 21:17:31 +1100699.Pp
Darren Tucker0a118da2003-10-15 15:54:32 +1000700If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000701.Cm no
702(the default),
Damien Miller45ee2b92006-03-15 11:56:18 +1100703remote X11 clients will be considered untrusted and prevented
Darren Tucker0a118da2003-10-15 15:54:32 +1000704from stealing or tampering with data belonging to trusted X11
705clients.
Damien Miller1717fd42005-03-01 21:17:31 +1100706Furthermore, the
707.Xr xauth 1
708token used for the session will be set to expire after 20 minutes.
709Remote clients will be refused access after this time.
Darren Tucker0a118da2003-10-15 15:54:32 +1000710.Pp
Darren Tucker0a118da2003-10-15 15:54:32 +1000711See the X11 SECURITY extension specification for full details on
712the restrictions imposed on untrusted clients.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000713.It Cm GatewayPorts
714Specifies whether remote hosts are allowed to connect to local
715forwarded ports.
716By default,
Damien Miller45ee2b92006-03-15 11:56:18 +1100717.Xr ssh 1
Damien Miller495dca32003-04-01 21:42:14 +1000718binds local port forwardings to the loopback address.
719This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000720.Cm GatewayPorts
Damien Miller45ee2b92006-03-15 11:56:18 +1100721can be used to specify that ssh
Ben Lindstrom9f049032002-06-21 00:59:05 +0000722should bind local port forwardings to the wildcard address,
723thus allowing remote hosts to connect to forwarded ports.
724The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000725.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000726or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000727.Cm no
728(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000729.It Cm GlobalKnownHostsFile
Damien Miller295ee632011-05-29 21:42:31 +1000730Specifies one or more files to use for the global
731host key database, separated by whitespace.
732The default is
733.Pa /etc/ssh/ssh_known_hosts ,
734.Pa /etc/ssh/ssh_known_hosts2 .
Darren Tucker0efd1552003-08-26 11:49:55 +1000735.It Cm GSSAPIAuthentication
Damien Millerbaafb982003-12-17 16:32:23 +1100736Specifies whether user authentication based on GSSAPI is allowed.
Damien Millerc2b98272003-09-03 12:13:30 +1000737The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000738.Cm no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000739.It Cm GSSAPIDelegateCredentials
740Forward (delegate) credentials to the server.
741The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000742.Cm no .
Damien Millere1776152005-03-01 21:47:37 +1100743.It Cm HashKnownHosts
744Indicates that
Damien Miller45ee2b92006-03-15 11:56:18 +1100745.Xr ssh 1
Damien Millere1776152005-03-01 21:47:37 +1100746should hash host names and addresses when they are added to
Damien Miller167ea5d2005-05-26 12:04:02 +1000747.Pa ~/.ssh/known_hosts .
Damien Millere1776152005-03-01 21:47:37 +1100748These hashed names may be used normally by
Damien Miller45ee2b92006-03-15 11:56:18 +1100749.Xr ssh 1
Damien Millere1776152005-03-01 21:47:37 +1100750and
Damien Miller45ee2b92006-03-15 11:56:18 +1100751.Xr sshd 8 ,
Damien Millere1776152005-03-01 21:47:37 +1100752but they do not reveal identifying information should the file's contents
753be disclosed.
754The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000755.Cm no .
Damien Miller858bb7d2006-08-05 11:34:51 +1000756Note that existing names and addresses in known hosts files
757will not be converted automatically,
758but may be manually hashed using
Damien Miller4b42d7f2005-03-01 21:48:35 +1100759.Xr ssh-keygen 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000760.It Cm HostbasedAuthentication
761Specifies whether to try rhosts based authentication with public key
762authentication.
763The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000764.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000765or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000766.Cm no
767(the default).
djm@openbsd.org46347ed2015-01-30 11:43:14 +0000768.It Cm HostbasedKeyTypes
769Specifies the key types that will be used for hostbased authentication
djm@openbsd.org312d2f22018-07-04 13:49:31 +0000770as a comma-separated list of patterns.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000771Alternately if the specified value begins with a
772.Sq +
773character, then the specified key types will be appended to the default set
774instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000775If the specified value begins with a
776.Sq -
777character, then the specified key types (including wildcards) will be removed
778from the default set instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000779The default for this option is:
780.Bd -literal -offset 3n
781ecdsa-sha2-nistp256-cert-v01@openssh.com,
782ecdsa-sha2-nistp384-cert-v01@openssh.com,
783ecdsa-sha2-nistp521-cert-v01@openssh.com,
784ssh-ed25519-cert-v01@openssh.com,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +0000785rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000786ssh-rsa-cert-v01@openssh.com,
787ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +0000788ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000789.Ed
790.Pp
djm@openbsd.org46347ed2015-01-30 11:43:14 +0000791The
792.Fl Q
793option of
794.Xr ssh 1
795may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000796.It Cm HostKeyAlgorithms
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000797Specifies the host key algorithms
Ben Lindstrom9f049032002-06-21 00:59:05 +0000798that the client wants to use in order of preference.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000799Alternately if the specified value begins with a
800.Sq +
801character, then the specified key types will be appended to the default set
802instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000803If the specified value begins with a
804.Sq -
805character, then the specified key types (including wildcards) will be removed
806from the default set instead of replacing them.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000807The default for this option is:
Damien Millereb8b60e2010-08-31 22:41:14 +1000808.Bd -literal -offset 3n
809ecdsa-sha2-nistp256-cert-v01@openssh.com,
810ecdsa-sha2-nistp384-cert-v01@openssh.com,
811ecdsa-sha2-nistp521-cert-v01@openssh.com,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100812ssh-ed25519-cert-v01@openssh.com,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +0000813rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000814ssh-rsa-cert-v01@openssh.com,
Damien Millereb8b60e2010-08-31 22:41:14 +1000815ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +0000816ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
Damien Millereb8b60e2010-08-31 22:41:14 +1000817.Ed
Damien Millerd925dcd2010-12-01 12:21:51 +1100818.Pp
819If hostkeys are known for the destination host then this default is modified
820to prefer their algorithms.
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000821.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000822The list of available key types may also be obtained using
823.Qq ssh -Q key .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000824.It Cm HostKeyAlias
825Specifies an alias that should be used instead of the
826real host name when looking up or saving the host key
djm@openbsd.org6f8ca3b2017-06-24 05:35:05 +0000827in the host key database files and when validating host certificates.
Damien Miller45ee2b92006-03-15 11:56:18 +1100828This option is useful for tunneling SSH connections
Ben Lindstrom9f049032002-06-21 00:59:05 +0000829or for multiple servers running on a single host.
830.It Cm HostName
831Specifies the real host name to log into.
832This can be used to specify nicknames or abbreviations for hosts.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000833Arguments to
834.Cm HostName
835accept the tokens described in the
836.Sx TOKENS
837section.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000838Numeric IP addresses are also permitted (both on the command line and in
839.Cm HostName
840specifications).
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000841The default is the name given on the command line.
Damien Millerbd394c32004-03-08 23:12:36 +1100842.It Cm IdentitiesOnly
843Specifies that
Damien Miller45ee2b92006-03-15 11:56:18 +1100844.Xr ssh 1
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000845should only use the authentication identity and certificate files explicitly
846configured in the
Damien Miller1a812582004-04-20 20:13:32 +1000847.Nm
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000848files
849or passed on the
850.Xr ssh 1
851command-line,
Damien Miller45ee2b92006-03-15 11:56:18 +1100852even if
853.Xr ssh-agent 1
Damien Millercb6b68b2012-12-03 09:49:52 +1100854or a
855.Cm PKCS11Provider
Damien Millerbd394c32004-03-08 23:12:36 +1100856offers more identities.
857The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000858.Cm yes
Damien Millerbd394c32004-03-08 23:12:36 +1100859or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000860.Cm no
861(the default).
Damien Miller45ee2b92006-03-15 11:56:18 +1100862This option is intended for situations where ssh-agent
Damien Millerbd394c32004-03-08 23:12:36 +1100863offers many different identities.
markus@openbsd.orgb02ad1c2016-05-04 12:21:53 +0000864.It Cm IdentityAgent
865Specifies the
866.Ux Ns -domain
867socket used to communicate with the authentication agent.
868.Pp
869This option overrides the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000870.Ev SSH_AUTH_SOCK
markus@openbsd.orgb02ad1c2016-05-04 12:21:53 +0000871environment variable and can be used to select a specific agent.
872Setting the socket name to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000873.Cm none
markus@openbsd.orgb02ad1c2016-05-04 12:21:53 +0000874disables the use of an authentication agent.
markus@openbsd.org1a75d142016-05-04 14:29:58 +0000875If the string
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000876.Qq SSH_AUTH_SOCK
markus@openbsd.org1a75d142016-05-04 14:29:58 +0000877is specified, the location of the socket will be read from the
878.Ev SSH_AUTH_SOCK
879environment variable.
djm@openbsd.org5eff5b82018-10-03 06:38:35 +0000880Otherwise if the specified value begins with a
881.Sq $
882character, then it will be treated as an environment variable containing
883the location of the socket.
markus@openbsd.orgb02ad1c2016-05-04 12:21:53 +0000884.Pp
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000885Arguments to
886.Cm IdentityAgent
887may use the tilde syntax to refer to a user's home directory
888or the tokens described in the
889.Sx TOKENS
890section.
Damien Miller957d4e42005-12-13 19:30:45 +1100891.It Cm IdentityFile
sobrado@openbsd.orgf70b22b2014-08-30 15:33:50 +0000892Specifies a file from which the user's DSA, ECDSA, Ed25519 or RSA authentication
Damien Millereb8b60e2010-08-31 22:41:14 +1000893identity is read.
Damien Miller957d4e42005-12-13 19:30:45 +1100894The default is
Damien Millereb8b60e2010-08-31 22:41:14 +1000895.Pa ~/.ssh/id_dsa ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100896.Pa ~/.ssh/id_ecdsa ,
897.Pa ~/.ssh/id_ed25519
Damien Miller957d4e42005-12-13 19:30:45 +1100898and
djm@openbsd.org788ac792017-04-30 23:18:22 +0000899.Pa ~/.ssh/id_rsa .
Damien Miller957d4e42005-12-13 19:30:45 +1100900Additionally, any identities represented by the authentication agent
Damien Miller7f2b4382013-07-18 16:10:29 +1000901will be used for authentication unless
902.Cm IdentitiesOnly
903is set.
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000904If no certificates have been explicitly specified by
905.Cm CertificateFile ,
Damien Miller5059d8d2010-03-05 21:31:11 +1100906.Xr ssh 1
907will try to load certificate information from the filename obtained by
908appending
909.Pa -cert.pub
910to the path of a specified
911.Cm IdentityFile .
Damien Miller6b1d53c2006-03-31 23:13:21 +1100912.Pp
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000913Arguments to
914.Cm IdentityFile
915may use the tilde syntax to refer to a user's home directory
916or the tokens described in the
917.Sx TOKENS
918section.
Damien Miller6b1d53c2006-03-31 23:13:21 +1100919.Pp
Damien Miller957d4e42005-12-13 19:30:45 +1100920It is possible to have
921multiple identity files specified in configuration files; all these
922identities will be tried in sequence.
Damien Miller6029e072011-06-20 14:22:49 +1000923Multiple
924.Cm IdentityFile
925directives will add to the list of identities tried (this behaviour
926differs from that of other configuration directives).
Damien Miller7f2b4382013-07-18 16:10:29 +1000927.Pp
928.Cm IdentityFile
929may be used in conjunction with
930.Cm IdentitiesOnly
931to select which identities in an agent are offered during authentication.
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000932.Cm IdentityFile
933may also be used in conjunction with
934.Cm CertificateFile
935in order to provide any certificate also needed for authentication with
936the identity.
Darren Tucker63e0df22013-05-16 20:30:31 +1000937.It Cm IgnoreUnknown
938Specifies a pattern-list of unknown options to be ignored if they are
939encountered in configuration parsing.
940This may be used to suppress errors if
941.Nm
942contains options that are unrecognised by
943.Xr ssh 1 .
944It is recommended that
945.Cm IgnoreUnknown
946be listed early in the configuration file as it will not be applied
947to unknown options that appear before it.
djm@openbsd.orgdc7990b2016-04-15 00:30:19 +0000948.It Cm Include
949Include the specified configuration file(s).
jmc@openbsd.org6aaabc22016-04-17 14:34:46 +0000950Multiple pathnames may be specified and each pathname may contain
kn@openbsd.orgddf1b792018-07-23 19:02:49 +0000951.Xr glob 7
djm@openbsd.orgdc7990b2016-04-15 00:30:19 +0000952wildcards and, for user configurations, shell-like
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000953.Sq ~
djm@openbsd.orgdc7990b2016-04-15 00:30:19 +0000954references to user home directories.
955Files without absolute paths are assumed to be in
956.Pa ~/.ssh
jmc@openbsd.org6aaabc22016-04-17 14:34:46 +0000957if included in a user configuration file or
djm@openbsd.orgdc7990b2016-04-15 00:30:19 +0000958.Pa /etc/ssh
959if included from the system configuration file.
960.Cm Include
961directive may appear inside a
962.Cm Match
963or
964.Cm Host
965block
966to perform conditional inclusion.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100967.It Cm IPQoS
968Specifies the IPv4 type-of-service or DSCP class for connections.
969Accepted values are
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000970.Cm af11 ,
971.Cm af12 ,
972.Cm af13 ,
973.Cm af21 ,
974.Cm af22 ,
975.Cm af23 ,
976.Cm af31 ,
977.Cm af32 ,
978.Cm af33 ,
979.Cm af41 ,
980.Cm af42 ,
981.Cm af43 ,
982.Cm cs0 ,
983.Cm cs1 ,
984.Cm cs2 ,
985.Cm cs3 ,
986.Cm cs4 ,
987.Cm cs5 ,
988.Cm cs6 ,
989.Cm cs7 ,
990.Cm ef ,
991.Cm lowdelay ,
992.Cm throughput ,
993.Cm reliability ,
djm@openbsd.org51676ec2017-07-23 23:37:02 +0000994a numeric value, or
995.Cm none
996to use the operating system default.
Damien Miller928362d2010-12-26 14:26:45 +1100997This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100998If one argument is specified, it is used as the packet class unconditionally.
999If two values are specified, the first is automatically selected for
1000interactive sessions and the second for non-interactive sessions.
1001The default is
job@openbsd.org5ee84482018-04-04 15:12:17 +00001002.Cm af21
jmc@openbsd.org83685712018-04-07 13:50:10 +00001003(Low-Latency Data)
Damien Miller0dac6fb2010-11-20 15:19:38 +11001004for interactive sessions and
job@openbsd.org5ee84482018-04-04 15:12:17 +00001005.Cm cs1
jmc@openbsd.org83685712018-04-07 13:50:10 +00001006(Lower Effort)
Damien Miller0dac6fb2010-11-20 15:19:38 +11001007for non-interactive sessions.
Damien Millercfb606c2007-10-26 14:24:48 +10001008.It Cm KbdInteractiveAuthentication
1009Specifies whether to use keyboard-interactive authentication.
1010The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001011.Cm yes
1012(the default)
Damien Millercfb606c2007-10-26 14:24:48 +10001013or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001014.Cm no .
Darren Tucker636ca902004-11-05 20:22:00 +11001015.It Cm KbdInteractiveDevices
1016Specifies the list of methods to use in keyboard-interactive authentication.
1017Multiple method names must be comma-separated.
1018The default is to use the server specified list.
Damien Miller9cfbaec2006-03-15 11:57:55 +11001019The methods available vary depending on what the server supports.
1020For an OpenSSH server,
1021it may be zero or more of:
Damien Miller87f08be2018-07-20 13:18:28 +10001022.Cm bsdauth
Damien Miller9cfbaec2006-03-15 11:57:55 +11001023and
Damien Miller87f08be2018-07-20 13:18:28 +10001024.Cm pam .
Damien Millerd5f62bf2010-09-24 22:11:14 +10001025.It Cm KexAlgorithms
1026Specifies the available KEX (Key Exchange) algorithms.
1027Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001028Alternately if the specified value begins with a
1029.Sq +
1030character, then the specified methods will be appended to the default set
1031instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +00001032If the specified value begins with a
1033.Sq -
1034character, then the specified methods (including wildcards) will be removed
1035from the default set instead of replacing them.
Damien Miller7fe2b1f2010-09-24 22:11:53 +10001036The default is:
1037.Bd -literal -offset indent
djm@openbsd.org16277fc2016-09-22 17:55:13 +00001038curve25519-sha256,curve25519-sha256@libssh.org,
Damien Miller7fe2b1f2010-09-24 22:11:53 +10001039ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
1040diffie-hellman-group-exchange-sha256,
djm@openbsd.org680321f2018-02-16 02:40:45 +00001041diffie-hellman-group16-sha512,
1042diffie-hellman-group18-sha512,
Damien Millerc1621c82014-04-20 13:22:46 +10001043diffie-hellman-group-exchange-sha1,
djm@openbsd.org680321f2018-02-16 02:40:45 +00001044diffie-hellman-group14-sha256,
djm@openbsd.orgbdfd29f2015-07-03 03:47:00 +00001045diffie-hellman-group14-sha1
Damien Miller7fe2b1f2010-09-24 22:11:53 +10001046.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001047.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001048The list of available key exchange algorithms may also be obtained using
1049.Qq ssh -Q kex .
Damien Millerd27b9472005-12-13 19:29:02 +11001050.It Cm LocalCommand
1051Specifies a command to execute on the local machine after successfully
1052connecting to the server.
1053The command string extends to the end of the line, and is executed with
Darren Tucker63b31cb2007-12-02 23:09:30 +11001054the user's shell.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001055Arguments to
1056.Cm LocalCommand
1057accept the tokens described in the
1058.Sx TOKENS
1059section.
Darren Tucker78be8c52010-01-08 17:05:59 +11001060.Pp
1061The command is run synchronously and does not have access to the
1062session of the
1063.Xr ssh 1
1064that spawned it.
1065It should not be used for interactive commands.
1066.Pp
Damien Millerd27b9472005-12-13 19:29:02 +11001067This directive is ignored unless
1068.Cm PermitLocalCommand
1069has been enabled.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001070.It Cm LocalForward
Damien Millere9d001e2006-01-14 10:10:17 +11001071Specifies that a TCP port on the local machine be forwarded over
Ben Lindstrom9f049032002-06-21 00:59:05 +00001072the secure channel to the specified host and port from the remote machine.
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001073The first argument must be
Damien Millerf91ee4c2005-03-01 21:24:33 +11001074.Sm off
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001075.Oo Ar bind_address : Oc Ar port
Damien Millerf91ee4c2005-03-01 21:24:33 +11001076.Sm on
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001077and the second argument must be
1078.Ar host : Ns Ar hostport .
Damien Miller7fa96602010-08-05 13:03:13 +10001079IPv6 addresses can be specified by enclosing addresses in square brackets.
Damien Millerf8c55462005-03-02 12:03:05 +11001080Multiple forwardings may be specified, and additional forwardings can be
Damien Millerf91ee4c2005-03-01 21:24:33 +11001081given on the command line.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001082Only the superuser can forward privileged ports.
Damien Millerf91ee4c2005-03-01 21:24:33 +11001083By default, the local port is bound in accordance with the
1084.Cm GatewayPorts
1085setting.
1086However, an explicit
1087.Ar bind_address
1088may be used to bind the connection to a specific address.
1089The
1090.Ar bind_address
1091of
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001092.Cm localhost
Damien Millerf8c55462005-03-02 12:03:05 +11001093indicates that the listening port be bound for local use only, while an
1094empty address or
1095.Sq *
Damien Millerf91ee4c2005-03-01 21:24:33 +11001096indicates that the port should be available from all interfaces.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001097.It Cm LogLevel
1098Gives the verbosity level that is used when logging messages from
Damien Miller45ee2b92006-03-15 11:56:18 +11001099.Xr ssh 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001100The possible values are:
Damien Miller45ee2b92006-03-15 11:56:18 +11001101QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +10001102The default is INFO.
1103DEBUG and DEBUG1 are equivalent.
1104DEBUG2 and DEBUG3 each specify higher levels of verbose output.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001105.It Cm MACs
1106Specifies the MAC (message authentication code) algorithms
1107in order of preference.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +00001108The MAC algorithm is used for data integrity protection.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001109Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001110If the specified value begins with a
1111.Sq +
1112character, then the specified algorithms will be appended to the default set
1113instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +00001114If the specified value begins with a
1115.Sq -
1116character, then the specified algorithms (including wildcards) will be removed
1117from the default set instead of replacing them.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001118.Pp
Damien Milleraf43a7a2012-12-12 10:46:31 +11001119The algorithms that contain
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001120.Qq -etm
Damien Milleraf43a7a2012-12-12 10:46:31 +11001121calculate the MAC after encryption (encrypt-then-mac).
1122These are considered safer and their use recommended.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001123.Pp
Damien Miller45ee2b92006-03-15 11:56:18 +11001124The default is:
Damien Miller5e7c30b2007-06-11 14:06:32 +10001125.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +11001126umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1127hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001128hmac-sha1-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +10001129umac-64@openssh.com,umac-128@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001130hmac-sha2-256,hmac-sha2-512,hmac-sha1
Damien Miller5e7c30b2007-06-11 14:06:32 +10001131.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001132.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001133The list of available MAC algorithms may also be obtained using
1134.Qq ssh -Q mac .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001135.It Cm NoHostAuthenticationForLocalhost
djm@openbsd.org4f011da2018-02-10 06:40:28 +00001136Disable host authentication for localhost (loopback addresses).
Ben Lindstrom9f049032002-06-21 00:59:05 +00001137The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001138.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +00001139or
jmc@openbsd.org78142e32017-02-27 14:30:33 +00001140.Cm no
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001141(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +00001142.It Cm NumberOfPasswordPrompts
1143Specifies the number of password prompts before giving up.
1144The argument to this keyword must be an integer.
Damien Miller45ee2b92006-03-15 11:56:18 +11001145The default is 3.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001146.It Cm PasswordAuthentication
1147Specifies whether to use password authentication.
1148The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001149.Cm yes
1150(the default)
Ben Lindstrom9f049032002-06-21 00:59:05 +00001151or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001152.Cm no .
Damien Millerd27b9472005-12-13 19:29:02 +11001153.It Cm PermitLocalCommand
1154Allow local command execution via the
1155.Ic LocalCommand
1156option or using the
Damien Miller4b2319f2005-12-13 19:30:27 +11001157.Ic !\& Ns Ar command
Damien Millerd27b9472005-12-13 19:29:02 +11001158escape sequence in
1159.Xr ssh 1 .
1160The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001161.Cm yes
Damien Millerd27b9472005-12-13 19:29:02 +11001162or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001163.Cm no
1164(the default).
Damien Miller7ea845e2010-02-12 09:21:02 +11001165.It Cm PKCS11Provider
1166Specifies which PKCS#11 provider to use.
Damien Miller8e1ea4e2010-11-20 15:20:10 +11001167The argument to this keyword is the PKCS#11 shared library
Damien Miller7ea845e2010-02-12 09:21:02 +11001168.Xr ssh 1
Damien Millera7618442010-02-12 09:26:02 +11001169should use to communicate with a PKCS#11 token providing the user's
Damien Miller7ea845e2010-02-12 09:21:02 +11001170private RSA key.
Damien Miller957d4e42005-12-13 19:30:45 +11001171.It Cm Port
1172Specifies the port number to connect on the remote host.
Damien Miller45ee2b92006-03-15 11:56:18 +11001173The default is 22.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001174.It Cm PreferredAuthentications
jmc@openbsd.orga685ae82016-02-17 07:38:19 +00001175Specifies the order in which the client should try authentication methods.
Darren Tucker1adc2bd2005-03-14 23:14:20 +11001176This allows a client to prefer one method (e.g.\&
Ben Lindstrom9f049032002-06-21 00:59:05 +00001177.Cm keyboard-interactive )
Darren Tucker1adc2bd2005-03-14 23:14:20 +11001178over another method (e.g.\&
Damien Miller544378d2010-04-16 15:52:24 +10001179.Cm password ) .
1180The default is:
1181.Bd -literal -offset indent
1182gssapi-with-mic,hostbased,publickey,
1183keyboard-interactive,password
1184.Ed
Ben Lindstrom9f049032002-06-21 00:59:05 +00001185.It Cm ProxyCommand
1186Specifies the command to use to connect to the server.
1187The command
Damien Miller079bac22014-07-09 13:06:25 +10001188string extends to the end of the line, and is executed
1189using the user's shell
1190.Ql exec
1191directive to avoid a lingering shell process.
1192.Pp
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001193Arguments to
1194.Cm ProxyCommand
1195accept the tokens described in the
1196.Sx TOKENS
1197section.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001198The command can be basically anything,
1199and should read from its standard input and write to its standard output.
1200It should eventually connect an
1201.Xr sshd 8
1202server running on some machine, or execute
1203.Ic sshd -i
1204somewhere.
1205Host key management will be done using the
1206HostName of the host being connected (defaulting to the name typed by
1207the user).
Damien Miller495dca32003-04-01 21:42:14 +10001208Setting the command to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001209.Cm none
Damien Miller9f1e33a2003-02-24 11:57:32 +11001210disables this option entirely.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001211Note that
1212.Cm CheckHostIP
1213is not available for connects with a proxy command.
1214.Pp
Damien Millerebcfedc2005-05-26 12:13:56 +10001215This directive is useful in conjunction with
1216.Xr nc 1
1217and its proxy support.
Damien Millerdfec2942005-05-26 12:14:32 +10001218For example, the following directive would connect via an HTTP proxy at
Damien Millerebcfedc2005-05-26 12:13:56 +10001219192.0.2.0:
1220.Bd -literal -offset 3n
1221ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p
1222.Ed
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001223.It Cm ProxyJump
millert@openbsd.org887669e2017-10-21 23:06:24 +00001224Specifies one or more jump proxies as either
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001225.Xo
1226.Sm off
jmc@openbsd.orge4eb7d92016-07-16 06:57:55 +00001227.Op Ar user No @
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001228.Ar host
jmc@openbsd.orge4eb7d92016-07-16 06:57:55 +00001229.Op : Ns Ar port
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001230.Sm on
millert@openbsd.org887669e2017-10-21 23:06:24 +00001231or an ssh URI
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001232.Xc .
djm@openbsd.org286f5a72016-07-22 03:35:11 +00001233Multiple proxies may be separated by comma characters and will be visited
djm@openbsd.orgf00211e2016-07-22 07:00:46 +00001234sequentially.
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001235Setting this option will cause
1236.Xr ssh 1
1237to connect to the target host by first making a
1238.Xr ssh 1
1239connection to the specified
1240.Cm ProxyJump
1241host and then establishing a
jmc@openbsd.orge4eb7d92016-07-16 06:57:55 +00001242TCP forwarding to the ultimate target from there.
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001243.Pp
1244Note that this option will compete with the
1245.Cm ProxyCommand
1246option - whichever is specified first will prevent later instances of the
1247other from taking effect.
Damien Miller1262b662013-08-21 02:44:24 +10001248.It Cm ProxyUseFdpass
Damien Millerf2f6c312013-08-21 02:44:58 +10001249Specifies that
Damien Miller1262b662013-08-21 02:44:24 +10001250.Cm ProxyCommand
1251will pass a connected file descriptor back to
Damien Millerf2f6c312013-08-21 02:44:58 +10001252.Xr ssh 1
Damien Miller1262b662013-08-21 02:44:24 +10001253instead of continuing to execute and pass data.
1254The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001255.Cm no .
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001256.It Cm PubkeyAcceptedKeyTypes
1257Specifies the key types that will be used for public key authentication
djm@openbsd.org312d2f22018-07-04 13:49:31 +00001258as a comma-separated list of patterns.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001259Alternately if the specified value begins with a
1260.Sq +
1261character, then the key types after it will be appended to the default
1262instead of replacing it.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +00001263If the specified value begins with a
1264.Sq -
1265character, then the specified key types (including wildcards) will be removed
1266from the default set instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001267The default for this option is:
1268.Bd -literal -offset 3n
1269ecdsa-sha2-nistp256-cert-v01@openssh.com,
1270ecdsa-sha2-nistp384-cert-v01@openssh.com,
1271ecdsa-sha2-nistp521-cert-v01@openssh.com,
1272ssh-ed25519-cert-v01@openssh.com,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +00001273rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001274ssh-rsa-cert-v01@openssh.com,
1275ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +00001276ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001277.Ed
1278.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001279The list of available key types may also be obtained using
1280.Qq ssh -Q key .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001281.It Cm PubkeyAuthentication
1282Specifies whether to try public key authentication.
1283The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001284.Cm yes
1285(the default)
Ben Lindstrom9f049032002-06-21 00:59:05 +00001286or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001287.Cm no .
Darren Tucker62388b22006-01-20 11:31:47 +11001288.It Cm RekeyLimit
1289Specifies the maximum amount of data that may be transmitted before the
Darren Tuckerc53c2af2013-05-16 20:28:16 +10001290session key is renegotiated, optionally followed a maximum amount of
1291time that may pass before the session key is renegotiated.
1292The first argument is specified in bytes and may have a suffix of
Damien Millerddfddf12006-01-31 21:39:03 +11001293.Sq K ,
1294.Sq M ,
Darren Tucker62388b22006-01-20 11:31:47 +11001295or
Damien Millerddfddf12006-01-31 21:39:03 +11001296.Sq G
Darren Tucker62388b22006-01-20 11:31:47 +11001297to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1298The default is between
Damien Miller45ee2b92006-03-15 11:56:18 +11001299.Sq 1G
Darren Tucker62388b22006-01-20 11:31:47 +11001300and
Damien Miller45ee2b92006-03-15 11:56:18 +11001301.Sq 4G ,
Darren Tucker62388b22006-01-20 11:31:47 +11001302depending on the cipher.
Darren Tuckerc53c2af2013-05-16 20:28:16 +10001303The optional second value is specified in seconds and may use any of the
1304units documented in the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001305.Sx TIME FORMATS
1306section of
Darren Tuckerc53c2af2013-05-16 20:28:16 +10001307.Xr sshd_config 5 .
1308The default value for
1309.Cm RekeyLimit
1310is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001311.Cm default none ,
Darren Tuckerc53c2af2013-05-16 20:28:16 +10001312which means that rekeying is performed after the cipher's default amount
1313of data has been sent or received and no time based rekeying is done.
bluhm@openbsd.org1112b532017-05-30 18:58:37 +00001314.It Cm RemoteCommand
1315Specifies a command to execute on the remote machine after successfully
1316connecting to the server.
1317The command string extends to the end of the line, and is executed with
1318the user's shell.
jmc@openbsd.orga3bb2502017-05-30 19:38:17 +00001319Arguments to
1320.Cm RemoteCommand
1321accept the tokens described in the
1322.Sx TOKENS
1323section.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001324.It Cm RemoteForward
Damien Millere9d001e2006-01-14 10:10:17 +11001325Specifies that a TCP port on the remote machine be forwarded over
markus@openbsd.org609d7a62017-09-21 19:16:53 +00001326the secure channel.
djm@openbsd.org001aa552018-04-10 00:10:49 +00001327The remote port may either be forwarded to a specified host and port
markus@openbsd.org609d7a62017-09-21 19:16:53 +00001328from the local machine, or may act as a SOCKS 4/5 proxy that allows a remote
1329client to connect to arbitrary destinations from the local machine.
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001330The first argument must be
Damien Millerf91ee4c2005-03-01 21:24:33 +11001331.Sm off
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001332.Oo Ar bind_address : Oc Ar port
Damien Millerf91ee4c2005-03-01 21:24:33 +11001333.Sm on
markus@openbsd.org609d7a62017-09-21 19:16:53 +00001334If forwarding to a specific destination then the second argument must be
1335.Ar host : Ns Ar hostport ,
1336otherwise if no destination argument is specified then the remote forwarding
1337will be established as a SOCKS proxy.
1338.Pp
Damien Miller7fa96602010-08-05 13:03:13 +10001339IPv6 addresses can be specified by enclosing addresses in square brackets.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001340Multiple forwardings may be specified, and additional
1341forwardings can be given on the command line.
Damien Millerde7532e2008-11-03 19:24:45 +11001342Privileged ports can be forwarded only when
1343logging in as root on the remote machine.
Damien Millere379e102009-02-14 16:34:39 +11001344.Pp
Damien Miller85c6d8a2009-02-14 16:34:21 +11001345If the
1346.Ar port
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001347argument is 0,
Damien Miller85c6d8a2009-02-14 16:34:21 +11001348the listen port will be dynamically allocated on the server and reported
1349to the client at run time.
Damien Millerf91ee4c2005-03-01 21:24:33 +11001350.Pp
1351If the
1352.Ar bind_address
1353is not specified, the default is to only bind to loopback addresses.
1354If the
1355.Ar bind_address
1356is
1357.Ql *
1358or an empty string, then the forwarding is requested to listen on all
1359interfaces.
1360Specifying a remote
1361.Ar bind_address
Damien Millerf8c55462005-03-02 12:03:05 +11001362will only succeed if the server's
1363.Cm GatewayPorts
Damien Millerf91ee4c2005-03-01 21:24:33 +11001364option is enabled (see
Damien Millerf8c55462005-03-02 12:03:05 +11001365.Xr sshd_config 5 ) .
Damien Miller21771e22011-05-15 08:45:50 +10001366.It Cm RequestTTY
1367Specifies whether to request a pseudo-tty for the session.
1368The argument may be one of:
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001369.Cm no
Damien Miller21771e22011-05-15 08:45:50 +10001370(never request a TTY),
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001371.Cm yes
Damien Miller21771e22011-05-15 08:45:50 +10001372(always request a TTY when standard input is a TTY),
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001373.Cm force
Damien Miller21771e22011-05-15 08:45:50 +10001374(always request a TTY) or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001375.Cm auto
Damien Miller21771e22011-05-15 08:45:50 +10001376(request a TTY when opening a login session).
1377This option mirrors the
1378.Fl t
1379and
1380.Fl T
1381flags for
1382.Xr ssh 1 .
djm@openbsd.org5e39a492014-12-04 02:24:32 +00001383.It Cm RevokedHostKeys
1384Specifies revoked host public keys.
1385Keys listed in this file will be refused for host authentication.
1386Note that if this file does not exist or is not readable,
1387then host authentication will be refused for all hosts.
1388Keys may be specified as a text file, listing one public key per line, or as
1389an OpenSSH Key Revocation List (KRL) as generated by
1390.Xr ssh-keygen 1 .
1391For more information on KRLs, see the KEY REVOCATION LISTS section in
1392.Xr ssh-keygen 1 .
Darren Tucker46bc0752004-05-02 22:11:30 +10001393.It Cm SendEnv
1394Specifies what variables from the local
1395.Xr environ 7
1396should be sent to the server.
Damien Miller45ee2b92006-03-15 11:56:18 +11001397The server must also support it, and the server must be configured to
Darren Tucker1e0c9bf2004-05-02 22:12:48 +10001398accept these environment variables.
dtucker@openbsd.org85b96ef2015-04-28 10:17:58 +00001399Note that the
1400.Ev TERM
jmc@openbsd.orgc1d5bcf2015-04-28 13:47:38 +00001401environment variable is always sent whenever a
dtucker@openbsd.org85b96ef2015-04-28 10:17:58 +00001402pseudo-terminal is requested as it is required by the protocol.
Darren Tucker46bc0752004-05-02 22:11:30 +10001403Refer to
1404.Cm AcceptEnv
1405in
1406.Xr sshd_config 5
1407for how to configure the server.
Damien Miller6def5512006-03-15 11:54:05 +11001408Variables are specified by name, which may contain wildcard characters.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +10001409Multiple environment variables may be separated by whitespace or spread
Darren Tucker46bc0752004-05-02 22:11:30 +10001410across multiple
1411.Cm SendEnv
1412directives.
Damien Millerf54a4b92006-03-15 11:54:36 +11001413.Pp
1414See
1415.Sx PATTERNS
1416for more information on patterns.
djm@openbsd.org555294a2018-04-06 13:02:39 +00001417.Pp
jmc@openbsd.org83685712018-04-07 13:50:10 +00001418It is possible to clear previously set
djm@openbsd.org555294a2018-04-06 13:02:39 +00001419.Cm SendEnv
1420variable names by prefixing patterns with
1421.Pa - .
1422The default is not to send any environment variables.
Damien Miller509b0102003-12-17 16:33:10 +11001423.It Cm ServerAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +11001424Sets the number of server alive messages (see below) which may be
Damien Miller509b0102003-12-17 16:33:10 +11001425sent without
Damien Miller45ee2b92006-03-15 11:56:18 +11001426.Xr ssh 1
Damien Miller509b0102003-12-17 16:33:10 +11001427receiving any messages back from the server.
1428If this threshold is reached while server alive messages are being sent,
Damien Miller45ee2b92006-03-15 11:56:18 +11001429ssh will disconnect from the server, terminating the session.
Damien Miller509b0102003-12-17 16:33:10 +11001430It is important to note that the use of server alive messages is very
1431different from
1432.Cm TCPKeepAlive
1433(below).
1434The server alive messages are sent through the encrypted channel
1435and therefore will not be spoofable.
1436The TCP keepalive option enabled by
1437.Cm TCPKeepAlive
1438is spoofable.
1439The server alive mechanism is valuable when the client or
1440server depend on knowing when a connection has become inactive.
1441.Pp
1442The default value is 3.
1443If, for example,
1444.Cm ServerAliveInterval
Damien Miller45ee2b92006-03-15 11:56:18 +11001445(see below) is set to 15 and
Damien Miller509b0102003-12-17 16:33:10 +11001446.Cm ServerAliveCountMax
Damien Miller45ee2b92006-03-15 11:56:18 +11001447is left at the default, if the server becomes unresponsive,
1448ssh will disconnect after approximately 45 seconds.
Damien Miller957d4e42005-12-13 19:30:45 +11001449.It Cm ServerAliveInterval
1450Sets a timeout interval in seconds after which if no data has been received
1451from the server,
Damien Miller45ee2b92006-03-15 11:56:18 +11001452.Xr ssh 1
Damien Miller957d4e42005-12-13 19:30:45 +11001453will send a message through the encrypted
1454channel to request a response from the server.
1455The default
1456is 0, indicating that these messages will not be sent to the server.
jmc@openbsd.orgacf42602018-06-09 06:36:31 +00001457.It Cm SetEnv
1458Directly specify one or more environment variables and their contents to
1459be sent to the server.
1460Similarly to
1461.Cm SendEnv ,
1462the server must be prepared to accept the environment variable.
Damien Miller7acefbb2014-07-18 14:11:24 +10001463.It Cm StreamLocalBindMask
1464Sets the octal file creation mode mask
1465.Pq umask
1466used when creating a Unix-domain socket file for local or remote
1467port forwarding.
1468This option is only used for port forwarding to a Unix-domain socket file.
1469.Pp
1470The default value is 0177, which creates a Unix-domain socket file that is
1471readable and writable only by the owner.
1472Note that not all operating systems honor the file mode on Unix-domain
1473socket files.
1474.It Cm StreamLocalBindUnlink
1475Specifies whether to remove an existing Unix-domain socket file for local
1476or remote port forwarding before creating a new one.
1477If the socket file already exists and
1478.Cm StreamLocalBindUnlink
1479is not enabled,
1480.Nm ssh
1481will be unable to forward the port to the Unix-domain socket file.
1482This option is only used for port forwarding to a Unix-domain socket file.
1483.Pp
1484The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001485.Cm yes
Damien Miller7acefbb2014-07-18 14:11:24 +10001486or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001487.Cm no
1488(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +00001489.It Cm StrictHostKeyChecking
1490If this flag is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001491.Cm yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +11001492.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001493will never automatically add host keys to the
Damien Miller167ea5d2005-05-26 12:04:02 +10001494.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +00001495file, and refuses to connect to hosts whose host key has changed.
dtucker@openbsd.org3e615092018-02-06 06:01:54 +00001496This provides maximum protection against man-in-the-middle (MITM) attacks,
Damien Miller45ee2b92006-03-15 11:56:18 +11001497though it can be annoying when the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001498.Pa /etc/ssh/ssh_known_hosts
Damien Miller45ee2b92006-03-15 11:56:18 +11001499file is poorly maintained or when connections to new hosts are
Ben Lindstrom9f049032002-06-21 00:59:05 +00001500frequently made.
1501This option forces the user to manually
1502add all new hosts.
jmc@openbsd.org149a8cd2017-09-04 06:34:43 +00001503.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001504If this flag is set to
djm@openbsd.org22376d22017-09-03 23:33:13 +00001505.Dq accept-new
jmc@openbsd.org149a8cd2017-09-04 06:34:43 +00001506then ssh will automatically add new host keys to the user
djm@openbsd.org22376d22017-09-03 23:33:13 +00001507known hosts files, but will not permit connections to hosts with
1508changed host keys.
1509If this flag is set to
1510.Dq no
1511or
1512.Dq off ,
jmc@openbsd.org149a8cd2017-09-04 06:34:43 +00001513ssh will automatically add new host keys to the user known hosts files
1514and allow connections to hosts with changed hostkeys to proceed,
1515subject to some restrictions.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001516If this flag is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001517.Cm ask
1518(the default),
Ben Lindstrom9f049032002-06-21 00:59:05 +00001519new host keys
1520will be added to the user known host files only after the user
1521has confirmed that is what they really want to do, and
Damien Miller45ee2b92006-03-15 11:56:18 +11001522ssh will refuse to connect to hosts whose host key has changed.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001523The host keys of
1524known hosts will be verified automatically in all cases.
jmc@openbsd.org47a287b2017-04-28 06:15:03 +00001525.It Cm SyslogFacility
1526Gives the facility code that is used when logging messages from
1527.Xr ssh 1 .
1528The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1529LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1530The default is USER.
Damien Miller12c150e2003-12-17 16:31:10 +11001531.It Cm TCPKeepAlive
1532Specifies whether the system should send TCP keepalive messages to the
1533other side.
1534If they are sent, death of the connection or crash of one
1535of the machines will be properly noticed.
1536However, this means that
1537connections will die if the route is down temporarily, and some people
1538find it annoying.
1539.Pp
1540The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001541.Cm yes
Damien Miller12c150e2003-12-17 16:31:10 +11001542(to send TCP keepalive messages), and the client will notice
1543if the network goes down or the remote host dies.
1544This is important in scripts, and many users want it too.
1545.Pp
1546To disable TCP keepalive messages, the value should be set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001547.Cm no .
djm@openbsd.orga7c38212018-02-10 09:03:54 +00001548See also
1549.Cm ServerAliveInterval
1550for protocol-level keepalives.
Damien Millerd27b9472005-12-13 19:29:02 +11001551.It Cm Tunnel
Damien Miller991dba42006-07-10 20:16:27 +10001552Request
Damien Millerd27b9472005-12-13 19:29:02 +11001553.Xr tun 4
Damien Miller7746c392005-12-13 19:33:37 +11001554device forwarding between the client and the server.
Damien Millerd27b9472005-12-13 19:29:02 +11001555The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001556.Cm yes ,
1557.Cm point-to-point
Damien Miller991dba42006-07-10 20:16:27 +10001558(layer 3),
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001559.Cm ethernet
Damien Miller991dba42006-07-10 20:16:27 +10001560(layer 2),
Damien Millerd27b9472005-12-13 19:29:02 +11001561or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001562.Cm no
1563(the default).
Damien Miller991dba42006-07-10 20:16:27 +10001564Specifying
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001565.Cm yes
Damien Miller991dba42006-07-10 20:16:27 +10001566requests the default tunnel mode, which is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001567.Cm point-to-point .
Damien Millerd27b9472005-12-13 19:29:02 +11001568.It Cm TunnelDevice
Damien Miller991dba42006-07-10 20:16:27 +10001569Specifies the
Damien Millerd27b9472005-12-13 19:29:02 +11001570.Xr tun 4
Damien Miller991dba42006-07-10 20:16:27 +10001571devices to open on the client
1572.Pq Ar local_tun
1573and the server
1574.Pq Ar remote_tun .
1575.Pp
1576The argument must be
1577.Sm off
1578.Ar local_tun Op : Ar remote_tun .
1579.Sm on
1580The devices may be specified by numerical ID or the keyword
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001581.Cm any ,
Damien Miller991dba42006-07-10 20:16:27 +10001582which uses the next available tunnel device.
1583If
1584.Ar remote_tun
1585is not specified, it defaults to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001586.Cm any .
Damien Miller991dba42006-07-10 20:16:27 +10001587The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001588.Cm any:any .
djm@openbsd.org1d1092b2015-01-26 12:16:36 +00001589.It Cm UpdateHostKeys
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001590Specifies whether
1591.Xr ssh 1
1592should accept notifications of additional hostkeys from the server sent
1593after authentication has completed and add them to
1594.Cm UserKnownHostsFile .
1595The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001596.Cm yes ,
1597.Cm no
djm@openbsd.org523463a2015-02-16 22:13:32 +00001598(the default) or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001599.Cm ask .
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001600Enabling this option allows learning alternate hostkeys for a server
djm@openbsd.org1d1092b2015-01-26 12:16:36 +00001601and supports graceful key rotation by allowing a server to send replacement
1602public keys before old ones are removed.
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001603Additional hostkeys are only accepted if the key used to authenticate the
sobrado@openbsd.orge3cbb062015-09-22 08:33:23 +00001604host was already trusted or explicitly accepted by the user.
djm@openbsd.org523463a2015-02-16 22:13:32 +00001605If
1606.Cm UpdateHostKeys
1607is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001608.Cm ask ,
djm@openbsd.org523463a2015-02-16 22:13:32 +00001609then the user is asked to confirm the modifications to the known_hosts file.
djm@openbsd.org44732de2015-02-20 22:17:21 +00001610Confirmation is currently incompatible with
1611.Cm ControlPersist ,
1612and will be disabled if it is enabled.
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001613.Pp
1614Presently, only
1615.Xr sshd 8
1616from OpenSSH 6.8 and greater support the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001617.Qq hostkeys@openssh.com
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001618protocol extension used to inform the client of all the server's hostkeys.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001619.It Cm User
1620Specifies the user to log in as.
1621This can be useful when a different user name is used on different machines.
1622This saves the trouble of
1623having to remember to give the user name on the command line.
1624.It Cm UserKnownHostsFile
Damien Miller295ee632011-05-29 21:42:31 +10001625Specifies one or more files to use for the user
1626host key database, separated by whitespace.
1627The default is
1628.Pa ~/.ssh/known_hosts ,
1629.Pa ~/.ssh/known_hosts2 .
Damien Miller37876e92003-05-15 10:19:46 +10001630.It Cm VerifyHostKeyDNS
1631Specifies whether to verify the remote key using DNS and SSHFP resource
1632records.
Damien Miller150b5572003-11-17 21:19:29 +11001633If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001634.Cm yes ,
Damien Millerfe448472003-11-17 21:19:49 +11001635the client will implicitly trust keys that match a secure fingerprint
Damien Miller150b5572003-11-17 21:19:29 +11001636from DNS.
1637Insecure fingerprints will be handled as if this option was set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001638.Cm ask .
Damien Miller150b5572003-11-17 21:19:29 +11001639If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001640.Cm ask ,
Damien Miller150b5572003-11-17 21:19:29 +11001641information on fingerprint match will be displayed, but the user will still
1642need to confirm new host keys according to the
1643.Cm StrictHostKeyChecking
1644option.
Damien Miller37876e92003-05-15 10:19:46 +10001645The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001646.Cm no .
Damien Miller45ee2b92006-03-15 11:56:18 +11001647.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001648See also
1649.Sx VERIFYING HOST KEYS
1650in
Damien Miller45ee2b92006-03-15 11:56:18 +11001651.Xr ssh 1 .
Damien Miller10288242008-06-30 00:04:03 +10001652.It Cm VisualHostKey
1653If this flag is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001654.Cm yes ,
Damien Miller10288242008-06-30 00:04:03 +10001655an ASCII art representation of the remote host key fingerprint is
djm@openbsd.orgb79efde2014-12-21 23:12:42 +00001656printed in addition to the fingerprint string at login and
Damien Millera414cd32008-11-03 19:25:21 +11001657for unknown host keys.
Damien Miller10288242008-06-30 00:04:03 +10001658If this flag is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001659.Cm no
1660(the default),
Damien Millera414cd32008-11-03 19:25:21 +11001661no fingerprint strings are printed at login and
djm@openbsd.orgb79efde2014-12-21 23:12:42 +00001662only the fingerprint string will be printed for unknown host keys.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001663.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001664Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001665.Xr xauth 1
1666program.
1667The default is
1668.Pa /usr/X11R6/bin/xauth .
1669.El
Damien Millerb5282c22006-03-15 11:59:08 +11001670.Sh PATTERNS
1671A
1672.Em pattern
1673consists of zero or more non-whitespace characters,
1674.Sq *
1675(a wildcard that matches zero or more characters),
1676or
1677.Sq ?\&
1678(a wildcard that matches exactly one character).
1679For example, to specify a set of declarations for any host in the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001680.Qq .co.uk
Damien Millerb5282c22006-03-15 11:59:08 +11001681set of domains,
1682the following pattern could be used:
1683.Pp
1684.Dl Host *.co.uk
1685.Pp
1686The following pattern
1687would match any host in the 192.168.0.[0-9] network range:
1688.Pp
1689.Dl Host 192.168.0.?
1690.Pp
1691A
1692.Em pattern-list
1693is a comma-separated list of patterns.
1694Patterns within pattern-lists may be negated
1695by preceding them with an exclamation mark
1696.Pq Sq !\& .
1697For example,
Damien Miller51682fa2013-10-17 11:48:31 +11001698to allow a key to be used from anywhere within an organization
Damien Millerb5282c22006-03-15 11:59:08 +11001699except from the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001700.Qq dialup
Damien Millerb5282c22006-03-15 11:59:08 +11001701pool,
1702the following entry (in authorized_keys) could be used:
1703.Pp
1704.Dl from=\&"!*.dialup.example.com,*.example.com\&"
djm@openbsd.org05b69e92017-10-18 02:49:44 +00001705.Pp
1706Note that a negated match will never produce a positive result by itself.
1707For example, attempting to match
1708.Qq host3
1709against the following pattern-list will fail:
1710.Pp
1711.Dl from=\&"!host1,!host2\&"
1712.Pp
1713The solution here is to include a term that will yield a positive match,
1714such as a wildcard:
1715.Pp
1716.Dl from=\&"!host1,!host2,*\&"
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001717.Sh TOKENS
1718Arguments to some keywords can make use of tokens,
1719which are expanded at runtime:
1720.Pp
1721.Bl -tag -width XXXX -offset indent -compact
1722.It %%
1723A literal
1724.Sq % .
1725.It \&%C
jmc@openbsd.org2b4f3ab2017-10-05 12:56:50 +00001726Hash of %l%h%p%r.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001727.It %d
1728Local user's home directory.
1729.It %h
1730The remote hostname.
1731.It %i
1732The local user ID.
1733.It %L
1734The local hostname.
1735.It %l
1736The local hostname, including the domain name.
1737.It %n
1738The original remote hostname, as given on the command line.
1739.It %p
1740The remote port.
1741.It %r
1742The remote username.
djm@openbsd.orgb7548b12017-10-23 05:08:00 +00001743.It \&%T
1744The local
1745.Xr tun 4
1746or
1747.Xr tap 4
1748network interface assigned if
jmc@openbsd.org08696272017-10-24 06:27:42 +00001749tunnel forwarding was requested, or
1750.Qq NONE
djm@openbsd.orgb7548b12017-10-23 05:08:00 +00001751otherwise.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001752.It %u
1753The local username.
1754.El
1755.Pp
1756.Cm Match exec
djm@openbsd.org9c935dd2018-06-01 03:33:53 +00001757accepts the tokens %%, %h, %i, %L, %l, %n, %p, %r, and %u.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001758.Pp
1759.Cm CertificateFile
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001760accepts the tokens %%, %d, %h, %i, %l, %r, and %u.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001761.Pp
1762.Cm ControlPath
1763accepts the tokens %%, %C, %h, %i, %L, %l, %n, %p, %r, and %u.
1764.Pp
1765.Cm HostName
1766accepts the tokens %% and %h.
1767.Pp
1768.Cm IdentityAgent
1769and
1770.Cm IdentityFile
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001771accept the tokens %%, %d, %h, %i, %l, %r, and %u.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001772.Pp
1773.Cm LocalCommand
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001774accepts the tokens %%, %C, %d, %h, %i, %l, %n, %p, %r, %T, and %u.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001775.Pp
1776.Cm ProxyCommand
1777accepts the tokens %%, %h, %p, and %r.
jmc@openbsd.orga3bb2502017-05-30 19:38:17 +00001778.Pp
1779.Cm RemoteCommand
djm@openbsd.org9c935dd2018-06-01 03:33:53 +00001780accepts the tokens %%, %C, %d, %h, %i, %l, %n, %p, %r, and %u.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001781.Sh FILES
1782.Bl -tag -width Ds
Damien Miller167ea5d2005-05-26 12:04:02 +10001783.It Pa ~/.ssh/config
Ben Lindstrom9f049032002-06-21 00:59:05 +00001784This is the per-user configuration file.
1785The format of this file is described above.
Damien Miller45ee2b92006-03-15 11:56:18 +11001786This file is used by the SSH client.
Damien Millerc970cb92004-04-20 20:12:53 +10001787Because of the potential for abuse, this file must have strict permissions:
1788read/write for the user, and not accessible by others.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001789.It Pa /etc/ssh/ssh_config
1790Systemwide configuration file.
1791This file provides defaults for those
1792values that are not specified in the user's configuration file, and
1793for those users who do not have a configuration file.
1794This file must be world-readable.
1795.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001796.Sh SEE ALSO
1797.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001798.Sh AUTHORS
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001799.An -nosplit
Ben Lindstrom9f049032002-06-21 00:59:05 +00001800OpenSSH is a derivative of the original and free
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001801ssh 1.2.12 release by
1802.An Tatu Ylonen .
1803.An Aaron Campbell , Bob Beck , Markus Friedl ,
1804.An Niels Provos , Theo de Raadt
1805and
1806.An Dug Song
Ben Lindstrom9f049032002-06-21 00:59:05 +00001807removed many bugs, re-added newer features and
1808created OpenSSH.
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001809.An Markus Friedl
1810contributed the support for SSH protocol versions 1.5 and 2.0.