blob: 71705cabddaabcb816fd9f3b353acb1e5f4cc8eb [file] [log] [blame]
Ben Lindstrom9f049032002-06-21 00:59:05 +00001.\"
2.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
3.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4.\" All rights reserved
5.\"
6.\" As far as I am concerned, the code I have written for this software
7.\" can be used freely for any purpose. Any derived versions of this
8.\" software must be clearly marked as such, and if the derived work is
9.\" incompatible with the protocol description in the RFC file, it must be
10.\" called by a name other than "ssh" or "Secure Shell".
11.\"
12.\" Copyright (c) 1999,2000 Markus Friedl. All rights reserved.
13.\" Copyright (c) 1999 Aaron Campbell. All rights reserved.
14.\" Copyright (c) 1999 Theo de Raadt. All rights reserved.
15.\"
16.\" Redistribution and use in source and binary forms, with or without
17.\" modification, are permitted provided that the following conditions
18.\" are met:
19.\" 1. Redistributions of source code must retain the above copyright
20.\" notice, this list of conditions and the following disclaimer.
21.\" 2. Redistributions in binary form must reproduce the above copyright
22.\" notice, this list of conditions and the following disclaimer in the
23.\" documentation and/or other materials provided with the distribution.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
26.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
29.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35.\"
jmc@openbsd.org7d330a12018-02-23 07:38:09 +000036.\" $OpenBSD: ssh_config.5,v 1.268 2018/02/23 07:38:09 jmc Exp $
djm@openbsd.orgac2e3022018-02-23 02:34:33 +000037.Dd $Mdocdate: February 23 2018 $
Ben Lindstrom9f049032002-06-21 00:59:05 +000038.Dt SSH_CONFIG 5
39.Os
40.Sh NAME
41.Nm ssh_config
42.Nd OpenSSH SSH client configuration files
Ben Lindstrom9f049032002-06-21 00:59:05 +000043.Sh DESCRIPTION
Damien Miller45ee2b92006-03-15 11:56:18 +110044.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +000045obtains configuration data from the following sources in
46the following order:
Damien Miller5c853b52006-03-15 11:37:02 +110047.Pp
Ben Lindstrom479b4762002-08-20 19:04:51 +000048.Bl -enum -offset indent -compact
49.It
50command-line options
51.It
52user's configuration file
Damien Miller167ea5d2005-05-26 12:04:02 +100053.Pq Pa ~/.ssh/config
Ben Lindstrom479b4762002-08-20 19:04:51 +000054.It
55system-wide configuration file
56.Pq Pa /etc/ssh/ssh_config
57.El
Ben Lindstrom9f049032002-06-21 00:59:05 +000058.Pp
59For each parameter, the first obtained value
60will be used.
Darren Tucker43d8e282005-02-09 09:51:08 +110061The configuration files contain sections separated by
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +000062.Cm Host
Ben Lindstrom9f049032002-06-21 00:59:05 +000063specifications, and that section is only applied for hosts that
64match one of the patterns given in the specification.
djm@openbsd.org957fbce2014-10-08 22:20:25 +000065The matched host name is usually the one given on the command line
66(see the
67.Cm CanonicalizeHostname
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +000068option for exceptions).
Ben Lindstrom9f049032002-06-21 00:59:05 +000069.Pp
70Since the first obtained value for each parameter is used, more
71host-specific declarations should be given near the beginning of the
72file, and general defaults at the end.
73.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +000074The file contains keyword-argument pairs, one per line.
75Lines starting with
Ben Lindstrom9f049032002-06-21 00:59:05 +000076.Ql #
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +000077and empty lines are interpreted as comments.
78Arguments may optionally be enclosed in double quotes
79.Pq \&"
80in order to represent arguments containing spaces.
Ben Lindstrom9f049032002-06-21 00:59:05 +000081Configuration options may be separated by whitespace or
82optional whitespace and exactly one
83.Ql = ;
84the latter format is useful to avoid the need to quote whitespace
85when specifying configuration options using the
86.Nm ssh ,
Damien Miller4aea9742006-03-15 11:59:39 +110087.Nm scp ,
Ben Lindstrom9f049032002-06-21 00:59:05 +000088and
89.Nm sftp
90.Fl o
91option.
92.Pp
93The possible
94keywords and their meanings are as follows (note that
95keywords are case-insensitive and arguments are case-sensitive):
96.Bl -tag -width Ds
97.It Cm Host
98Restricts the following declarations (up to the next
99.Cm Host
Damien Miller194fd902013-10-15 12:13:05 +1100100or
101.Cm Match
Ben Lindstrom9f049032002-06-21 00:59:05 +0000102keyword) to be only for those hosts that match one of the patterns
103given after the keyword.
Damien Millerfa51b162008-11-03 19:17:33 +1100104If more than one pattern is provided, they should be separated by whitespace.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000105A single
Damien Miller208f1ed2006-03-15 11:56:03 +1100106.Ql *
Ben Lindstrom9f049032002-06-21 00:59:05 +0000107as a pattern can be used to provide global
108defaults for all hosts.
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000109The host is usually the
Ben Lindstrom9f049032002-06-21 00:59:05 +0000110.Ar hostname
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000111argument given on the command line
112(see the
113.Cm CanonicalizeHostname
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000114keyword for exceptions).
Damien Millerf54a4b92006-03-15 11:54:36 +1100115.Pp
Damien Millerfe924212011-05-15 08:44:45 +1000116A pattern entry may be negated by prefixing it with an exclamation mark
117.Pq Sq !\& .
118If a negated entry is matched, then the
119.Cm Host
120entry is ignored, regardless of whether any other patterns on the line
121match.
122Negated matches are therefore useful to provide exceptions for wildcard
123matches.
124.Pp
Damien Millerf54a4b92006-03-15 11:54:36 +1100125See
126.Sx PATTERNS
127for more information on patterns.
Damien Millerd77b81f2013-10-17 11:39:00 +1100128.It Cm Match
Damien Miller194fd902013-10-15 12:13:05 +1100129Restricts the following declarations (up to the next
130.Cm Host
131or
132.Cm Match
133keyword) to be used only when the conditions following the
134.Cm Match
135keyword are satisfied.
sobrado@openbsd.orge3cbb062015-09-22 08:33:23 +0000136Match conditions are specified using one or more criteria
Damien Millercf31f382013-10-24 21:02:56 +1100137or the single token
138.Cm all
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000139which always matches.
140The available criteria keywords are:
141.Cm canonical ,
Damien Miller8a04be72013-10-23 16:29:40 +1100142.Cm exec ,
Damien Miller194fd902013-10-15 12:13:05 +1100143.Cm host ,
144.Cm originalhost ,
145.Cm user ,
146and
147.Cm localuser .
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000148The
149.Cm all
150criteria must appear alone or immediately after
jmc@openbsd.orgb1ba15f2014-10-09 06:21:31 +0000151.Cm canonical .
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000152Other criteria may be combined arbitrarily.
153All criteria but
154.Cm all
155and
156.Cm canonical
157require an argument.
158Criteria may be negated by prepending an exclamation mark
159.Pq Sq !\& .
Damien Miller194fd902013-10-15 12:13:05 +1100160.Pp
Damien Miller8e5a67f2013-10-23 16:30:25 +1100161The
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000162.Cm canonical
dtucker@openbsd.orgdd2cfeb2015-05-28 05:09:45 +0000163keyword matches only when the configuration file is being re-parsed
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000164after hostname canonicalization (see the
165.Cm CanonicalizeHostname
166option.)
167This may be useful to specify conditions that work with canonical host
168names only.
169The
Damien Miller8a04be72013-10-23 16:29:40 +1100170.Cm exec
Damien Miller8e5a67f2013-10-23 16:30:25 +1100171keyword executes the specified command under the user's shell.
Damien Miller194fd902013-10-15 12:13:05 +1100172If the command returns a zero exit status then the condition is considered true.
173Commands containing whitespace characters must be quoted.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000174Arguments to
175.Cm exec
176accept the tokens described in the
177.Sx TOKENS
178section.
Damien Miller194fd902013-10-15 12:13:05 +1100179.Pp
180The other keywords' criteria must be single entries or comma-separated
181lists and may use the wildcard and negation operators described in the
182.Sx PATTERNS
183section.
184The criteria for the
185.Cm host
186keyword are matched against the target hostname, after any substitution
187by the
188.Cm Hostname
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000189or
190.Cm CanonicalizeHostname
191options.
Damien Miller194fd902013-10-15 12:13:05 +1100192The
193.Cm originalhost
194keyword matches against the hostname as it was specified on the command-line.
195The
196.Cm user
197keyword matches against the target username on the remote host.
198The
199.Cm localuser
200keyword matches against the name of the local user running
201.Xr ssh 1
202(this keyword may be useful in system-wide
203.Nm
204files).
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000205.It Cm AddKeysToAgent
206Specifies whether keys should be automatically added to a running
jmc@openbsd.orge41a0712015-11-15 23:58:04 +0000207.Xr ssh-agent 1 .
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000208If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000209.Cm yes
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000210and a key is loaded from a file, the key and its passphrase are added to
211the agent with the default lifetime, as if by
212.Xr ssh-add 1 .
213If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000214.Cm ask ,
215.Xr ssh 1
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000216will require confirmation using the
217.Ev SSH_ASKPASS
218program before adding a key (see
219.Xr ssh-add 1
220for details).
221If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000222.Cm confirm ,
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000223each use of the key must be confirmed, as if the
224.Fl c
225option was specified to
226.Xr ssh-add 1 .
227If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000228.Cm no ,
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000229no keys are added to the agent.
230The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000231.Cm yes ,
232.Cm confirm ,
233.Cm ask ,
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000234or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000235.Cm no
236(the default).
Damien Miller20a8f972003-05-18 20:50:30 +1000237.It Cm AddressFamily
Damien Millerfbf486b2003-05-23 18:44:23 +1000238Specifies which address family to use when connecting.
239Valid arguments are
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000240.Cm any
241(the default),
242.Cm inet
Damien Miller45ee2b92006-03-15 11:56:18 +1100243(use IPv4 only), or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000244.Cm inet6
Darren Tucker79a7acf2005-02-09 09:48:57 +1100245(use IPv6 only).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000246.It Cm BatchMode
247If set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000248.Cm yes ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000249passphrase/password querying will be disabled.
250This option is useful in scripts and other batch jobs where no user
251is present to supply the password.
252The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000253.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000254or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000255.Cm no
256(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000257.It Cm BindAddress
Darren Tucker89f4d472005-07-14 17:06:21 +1000258Use the specified address on the local machine as the source address of
Darren Tucker6c71d202005-07-14 17:06:50 +1000259the connection.
260Only useful on systems with more than one address.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000261Note that this option does not work if
262.Cm UsePrivilegedPort
263is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000264.Cm yes .
jmc@openbsd.org7d330a12018-02-23 07:38:09 +0000265.It Cm BindInterface
266Use the address of the specified interface on the local machine as the
267source address of the connection.
268Note that this option does not work if
269.Cm UsePrivilegedPort
270is set to
271.Cm yes .
Damien Miller0faf7472013-10-17 11:47:23 +1100272.It Cm CanonicalDomains
Damien Miller607af342013-10-17 11:47:51 +1100273When
Damien Miller38505592013-10-17 11:48:13 +1100274.Cm CanonicalizeHostname
Damien Miller0faf7472013-10-17 11:47:23 +1100275is enabled, this option specifies the list of domain suffixes in which to
276search for the specified destination host.
Damien Miller38505592013-10-17 11:48:13 +1100277.It Cm CanonicalizeFallbackLocal
Damien Miller51682fa2013-10-17 11:48:31 +1100278Specifies whether to fail with an error when hostname canonicalization fails.
Damien Miller607af342013-10-17 11:47:51 +1100279The default,
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000280.Cm yes ,
Damien Miller607af342013-10-17 11:47:51 +1100281will attempt to look up the unqualified hostname using the system resolver's
Damien Miller0faf7472013-10-17 11:47:23 +1100282search rules.
283A value of
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000284.Cm no
Damien Miller0faf7472013-10-17 11:47:23 +1100285will cause
286.Xr ssh 1
287to fail instantly if
Damien Miller38505592013-10-17 11:48:13 +1100288.Cm CanonicalizeHostname
Damien Miller0faf7472013-10-17 11:47:23 +1100289is enabled and the target hostname cannot be found in any of the domains
290specified by
291.Cm CanonicalDomains .
Damien Miller38505592013-10-17 11:48:13 +1100292.It Cm CanonicalizeHostname
Damien Miller51682fa2013-10-17 11:48:31 +1100293Controls whether explicit hostname canonicalization is performed.
Damien Miller607af342013-10-17 11:47:51 +1100294The default,
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000295.Cm no ,
Damien Miller0faf7472013-10-17 11:47:23 +1100296is not to perform any name rewriting and let the system resolver handle all
297hostname lookups.
298If set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000299.Cm yes
Damien Miller0faf7472013-10-17 11:47:23 +1100300then, for connections that do not use a
301.Cm ProxyCommand ,
302.Xr ssh 1
Damien Miller38505592013-10-17 11:48:13 +1100303will attempt to canonicalize the hostname specified on the command line
Damien Miller0faf7472013-10-17 11:47:23 +1100304using the
305.Cm CanonicalDomains
306suffixes and
Damien Miller38505592013-10-17 11:48:13 +1100307.Cm CanonicalizePermittedCNAMEs
Damien Miller0faf7472013-10-17 11:47:23 +1100308rules.
309If
Damien Miller38505592013-10-17 11:48:13 +1100310.Cm CanonicalizeHostname
Damien Miller0faf7472013-10-17 11:47:23 +1100311is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000312.Cm always ,
Damien Miller51682fa2013-10-17 11:48:31 +1100313then canonicalization is applied to proxied connections too.
Damien Miller13f97b22014-02-24 15:57:55 +1100314.Pp
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000315If this option is enabled, then the configuration files are processed
316again using the new target name to pick up any new configuration in matching
Damien Miller13f97b22014-02-24 15:57:55 +1100317.Cm Host
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000318and
319.Cm Match
Damien Miller13f97b22014-02-24 15:57:55 +1100320stanzas.
Damien Miller38505592013-10-17 11:48:13 +1100321.It Cm CanonicalizeMaxDots
Damien Miller607af342013-10-17 11:47:51 +1100322Specifies the maximum number of dot characters in a hostname before
Damien Miller51682fa2013-10-17 11:48:31 +1100323canonicalization is disabled.
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000324The default, 1,
Damien Miller607af342013-10-17 11:47:51 +1100325allows a single dot (i.e. hostname.subdomain).
Damien Miller38505592013-10-17 11:48:13 +1100326.It Cm CanonicalizePermittedCNAMEs
Damien Miller607af342013-10-17 11:47:51 +1100327Specifies rules to determine whether CNAMEs should be followed when
Damien Miller38505592013-10-17 11:48:13 +1100328canonicalizing hostnames.
Damien Miller0faf7472013-10-17 11:47:23 +1100329The rules consist of one or more arguments of
Damien Miller607af342013-10-17 11:47:51 +1100330.Ar source_domain_list : Ns Ar target_domain_list ,
Damien Miller0faf7472013-10-17 11:47:23 +1100331where
332.Ar source_domain_list
Damien Miller51682fa2013-10-17 11:48:31 +1100333is a pattern-list of domains that may follow CNAMEs in canonicalization,
Damien Miller0faf7472013-10-17 11:47:23 +1100334and
335.Ar target_domain_list
Damien Miller607af342013-10-17 11:47:51 +1100336is a pattern-list of domains that they may resolve to.
Damien Miller0faf7472013-10-17 11:47:23 +1100337.Pp
338For example,
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000339.Qq *.a.example.com:*.b.example.com,*.c.example.com
Damien Miller0faf7472013-10-17 11:47:23 +1100340will allow hostnames matching
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000341.Qq *.a.example.com
Damien Miller38505592013-10-17 11:48:13 +1100342to be canonicalized to names in the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000343.Qq *.b.example.com
Damien Miller0faf7472013-10-17 11:47:23 +1100344or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000345.Qq *.c.example.com
Damien Miller0faf7472013-10-17 11:47:23 +1100346domains.
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000347.It Cm CertificateFile
348Specifies a file from which the user's certificate is read.
349A corresponding private key must be provided separately in order
350to use this certificate either
351from an
352.Cm IdentityFile
353directive or
354.Fl i
355flag to
356.Xr ssh 1 ,
357via
358.Xr ssh-agent 1 ,
359or via a
360.Cm PKCS11Provider .
361.Pp
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000362Arguments to
363.Cm CertificateFile
364may use the tilde syntax to refer to a user's home directory
365or the tokens described in the
366.Sx TOKENS
367section.
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000368.Pp
369It is possible to have multiple certificate files specified in
370configuration files; these certificates will be tried in sequence.
371Multiple
372.Cm CertificateFile
373directives will add to the list of certificates used for
374authentication.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000375.It Cm ChallengeResponseAuthentication
Damien Miller1faa7132006-03-15 11:55:31 +1100376Specifies whether to use challenge-response authentication.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000377The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000378.Cm yes
379(the default)
Ben Lindstrom9f049032002-06-21 00:59:05 +0000380or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000381.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000382.It Cm CheckHostIP
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000383If set to
384.Cm yes
385(the default),
Damien Miller45ee2b92006-03-15 11:56:18 +1100386.Xr ssh 1
387will additionally check the host IP address in the
Ben Lindstrom9f049032002-06-21 00:59:05 +0000388.Pa known_hosts
389file.
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000390This allows it to detect if a host key changed due to DNS spoofing
djm@openbsd.org5e678592015-06-02 09:10:40 +0000391and will add addresses of destination hosts to
392.Pa ~/.ssh/known_hosts
393in the process, regardless of the setting of
394.Cm StrictHostKeyChecking .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000395If the option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000396.Cm no ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000397the check will not be executed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000398.It Cm Ciphers
djm@openbsd.org788ac792017-04-30 23:18:22 +0000399Specifies the ciphers allowed and their order of preference.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000400Multiple ciphers must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000401If the specified value begins with a
402.Sq +
403character, then the specified ciphers will be appended to the default set
404instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000405If the specified value begins with a
406.Sq -
407character, then the specified ciphers (including wildcards) will be removed
408from the default set instead of replacing them.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000409.Pp
Damien Miller0fde8ac2013-11-21 14:12:23 +1100410The supported ciphers are:
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000411.Bd -literal -offset indent
Damien Millerc1621c82014-04-20 13:22:46 +10004123des-cbc
Damien Millerc1621c82014-04-20 13:22:46 +1000413aes128-cbc
Damien Millerc1621c82014-04-20 13:22:46 +1000414aes192-cbc
Damien Millerc1621c82014-04-20 13:22:46 +1000415aes256-cbc
Damien Millerc1621c82014-04-20 13:22:46 +1000416aes128-ctr
Damien Millerc1621c82014-04-20 13:22:46 +1000417aes192-ctr
Damien Millerc1621c82014-04-20 13:22:46 +1000418aes256-ctr
Damien Millerc1621c82014-04-20 13:22:46 +1000419aes128-gcm@openssh.com
Damien Millerc1621c82014-04-20 13:22:46 +1000420aes256-gcm@openssh.com
Damien Millerc1621c82014-04-20 13:22:46 +1000421chacha20-poly1305@openssh.com
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000422.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100423.Pp
Damien Miller45ee2b92006-03-15 11:56:18 +1100424The default is:
Damien Millerc1621c82014-04-20 13:22:46 +1000425.Bd -literal -offset indent
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000426chacha20-poly1305@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000427aes128-ctr,aes192-ctr,aes256-ctr,
Damien Miller1d75abf2013-01-09 16:12:19 +1100428aes128-gcm@openssh.com,aes256-gcm@openssh.com,
djm@openbsd.orgda953182016-09-05 14:02:42 +0000429aes128-cbc,aes192-cbc,aes256-cbc
Ben Lindstrom9f049032002-06-21 00:59:05 +0000430.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100431.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000432The list of available ciphers may also be obtained using
433.Qq ssh -Q cipher .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000434.It Cm ClearAllForwardings
Damien Miller45ee2b92006-03-15 11:56:18 +1100435Specifies that all local, remote, and dynamic port forwardings
Ben Lindstrom9f049032002-06-21 00:59:05 +0000436specified in the configuration files or on the command line be
Damien Miller495dca32003-04-01 21:42:14 +1000437cleared.
438This option is primarily useful when used from the
Damien Miller45ee2b92006-03-15 11:56:18 +1100439.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000440command line to clear port forwardings set in
441configuration files, and is automatically set by
442.Xr scp 1
443and
444.Xr sftp 1 .
445The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000446.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000447or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000448.Cm no
449(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000450.It Cm Compression
451Specifies whether to use compression.
452The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000453.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000454or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000455.Cm no
456(the default).
naddy@openbsd.org9a82e242017-05-03 21:49:18 +0000457.It Cm ConnectionAttempts
458Specifies the number of tries (one per second) to make before exiting.
459The argument must be an integer.
460This may be useful in scripts if the connection sometimes fails.
461The default is 1.
Damien Millerb78d5eb2003-05-16 11:39:04 +1000462.It Cm ConnectTimeout
Damien Miller45ee2b92006-03-15 11:56:18 +1100463Specifies the timeout (in seconds) used when connecting to the
464SSH server, instead of using the default system TCP timeout.
Damien Millerfbf486b2003-05-23 18:44:23 +1000465This value is used only when the target is down or really unreachable,
466not when it refuses the connection.
Damien Miller0e220db2004-06-15 10:34:08 +1000467.It Cm ControlMaster
468Enables the sharing of multiple sessions over a single network connection.
469When set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000470.Cm yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +1100471.Xr ssh 1
Damien Miller0e220db2004-06-15 10:34:08 +1000472will listen for connections on a control socket specified using the
473.Cm ControlPath
474argument.
475Additional sessions can connect to this socket using the same
476.Cm ControlPath
477with
478.Cm ControlMaster
479set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000480.Cm no
Damien Miller2234bac2004-06-30 22:38:52 +1000481(the default).
Damien Miller713de762005-11-05 15:13:49 +1100482These sessions will try to reuse the master instance's network connection
Damien Millerb3bfbb72005-11-05 15:11:48 +1100483rather than initiating new ones, but will fall back to connecting normally
484if the control socket does not exist, or is not listening.
485.Pp
Damien Miller23f07702004-06-18 01:19:03 +1000486Setting this to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000487.Cm ask
488will cause
489.Xr ssh 1
jmc@openbsd.org78de1672015-03-30 18:28:37 +0000490to listen for control connections, but require confirmation using
491.Xr ssh-askpass 1 .
Damien Millerdadfd4d2005-05-26 12:07:13 +1000492If the
493.Cm ControlPath
Damien Miller45ee2b92006-03-15 11:56:18 +1100494cannot be opened,
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000495.Xr ssh 1
496will continue without connecting to a master instance.
Damien Millerd14b1e72005-06-16 13:19:41 +1000497.Pp
Damien Miller13390022005-07-06 09:44:19 +1000498X11 and
Damien Millerfd94fba2005-07-06 09:44:59 +1000499.Xr ssh-agent 1
Damien Miller13390022005-07-06 09:44:19 +1000500forwarding is supported over these multiplexed connections, however the
Darren Tucker63551872005-12-20 16:14:15 +1100501display and agent forwarded will be the one belonging to the master
Damien Millerfd94fba2005-07-06 09:44:59 +1000502connection i.e. it is not possible to forward multiple displays or agents.
Damien Miller13390022005-07-06 09:44:19 +1000503.Pp
Damien Millerd14b1e72005-06-16 13:19:41 +1000504Two additional options allow for opportunistic multiplexing: try to use a
505master connection but fall back to creating a new one if one does not already
506exist.
507These options are:
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000508.Cm auto
Damien Millerd14b1e72005-06-16 13:19:41 +1000509and
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000510.Cm autoask .
Damien Millerd14b1e72005-06-16 13:19:41 +1000511The latter requires confirmation like the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000512.Cm ask
Damien Millerd14b1e72005-06-16 13:19:41 +1000513option.
Damien Miller0e220db2004-06-15 10:34:08 +1000514.It Cm ControlPath
Damien Miller6476cad2005-06-16 13:18:34 +1000515Specify the path to the control socket used for connection sharing as described
516in the
Damien Miller0e220db2004-06-15 10:34:08 +1000517.Cm ControlMaster
Damien Miller8f74c8f2005-06-26 08:56:03 +1000518section above or the string
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000519.Cm none
Damien Miller8f74c8f2005-06-26 08:56:03 +1000520to disable connection sharing.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000521Arguments to
522.Cm ControlPath
523may use the tilde syntax to refer to a user's home directory
524or the tokens described in the
525.Sx TOKENS
526section.
Damien Millerd14b1e72005-06-16 13:19:41 +1000527It is recommended that any
528.Cm ControlPath
529used for opportunistic connection sharing include
djm@openbsd.orgfc302562014-11-10 22:25:49 +0000530at least %h, %p, and %r (or alternatively %C) and be placed in a directory
531that is not writable by other users.
Damien Millerd14b1e72005-06-16 13:19:41 +1000532This ensures that shared connections are uniquely identified.
Damien Millere11e1ea2010-08-03 16:04:46 +1000533.It Cm ControlPersist
534When used in conjunction with
535.Cm ControlMaster ,
536specifies that the master connection should remain open
537in the background (waiting for future client connections)
538after the initial client connection has been closed.
539If set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000540.Cm no ,
Damien Millere11e1ea2010-08-03 16:04:46 +1000541then the master connection will not be placed into the background,
542and will close as soon as the initial client connection is closed.
543If set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000544.Cm yes
545or 0,
Damien Millere11e1ea2010-08-03 16:04:46 +1000546then the master connection will remain in the background indefinitely
547(until killed or closed via a mechanism such as the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000548.Qq ssh -O exit ) .
Damien Millere11e1ea2010-08-03 16:04:46 +1000549If set to a time in seconds, or a time in any of the formats documented in
550.Xr sshd_config 5 ,
551then the backgrounded master connection will automatically terminate
552after it has remained idle (with no client connections) for the
553specified time.
Damien Miller2234bac2004-06-30 22:38:52 +1000554.It Cm DynamicForward
Damien Millere9d001e2006-01-14 10:10:17 +1100555Specifies that a TCP port on the local machine be forwarded
Damien Miller2234bac2004-06-30 22:38:52 +1000556over the secure channel, and the application
557protocol is then used to determine where to connect to from the
558remote machine.
Darren Tuckerc8d64212005-10-03 18:13:42 +1000559.Pp
560The argument must be
561.Sm off
562.Oo Ar bind_address : Oc Ar port .
563.Sm on
Damien Miller7fa96602010-08-05 13:03:13 +1000564IPv6 addresses can be specified by enclosing addresses in square brackets.
Darren Tuckerc8d64212005-10-03 18:13:42 +1000565By default, the local port is bound in accordance with the
566.Cm GatewayPorts
567setting.
568However, an explicit
569.Ar bind_address
570may be used to bind the connection to a specific address.
571The
572.Ar bind_address
573of
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000574.Cm localhost
Darren Tuckerc8d64212005-10-03 18:13:42 +1000575indicates that the listening port be bound for local use only, while an
576empty address or
577.Sq *
578indicates that the port should be available from all interfaces.
579.Pp
Damien Miller2234bac2004-06-30 22:38:52 +1000580Currently the SOCKS4 and SOCKS5 protocols are supported, and
Damien Miller45ee2b92006-03-15 11:56:18 +1100581.Xr ssh 1
Damien Miller2234bac2004-06-30 22:38:52 +1000582will act as a SOCKS server.
583Multiple forwardings may be specified, and
584additional forwardings can be given on the command line.
585Only the superuser can forward privileged ports.
Darren Tucker674f71d2003-06-28 12:33:12 +1000586.It Cm EnableSSHKeysign
587Setting this option to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000588.Cm yes
Darren Tucker674f71d2003-06-28 12:33:12 +1000589in the global client configuration file
590.Pa /etc/ssh/ssh_config
591enables the use of the helper program
592.Xr ssh-keysign 8
593during
594.Cm HostbasedAuthentication .
595The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000596.Cm yes
Darren Tucker674f71d2003-06-28 12:33:12 +1000597or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000598.Cm no
599(the default).
Darren Tuckerf132c672003-10-15 15:58:18 +1000600This option should be placed in the non-hostspecific section.
Darren Tucker674f71d2003-06-28 12:33:12 +1000601See
602.Xr ssh-keysign 8
603for more information.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000604.It Cm EscapeChar
605Sets the escape character (default:
606.Ql ~ ) .
607The escape character can also
608be set on the command line.
609The argument should be a single character,
610.Ql ^
611followed by a letter, or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000612.Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +0000613to disable the escape
614character entirely (making the connection transparent for binary
615data).
Darren Tuckere7d4b192006-07-12 22:17:10 +1000616.It Cm ExitOnForwardFailure
617Specifies whether
618.Xr ssh 1
619should terminate the connection if it cannot set up all requested
djm@openbsd.orga954cdb2015-09-04 04:47:50 +0000620dynamic, tunnel, local, and remote port forwardings, (e.g.\&
jmc@openbsd.org5245bc12015-09-04 06:40:45 +0000621if either end is unable to bind and listen on a specified port).
djm@openbsd.orga954cdb2015-09-04 04:47:50 +0000622Note that
623.Cm ExitOnForwardFailure
624does not apply to connections made over port forwardings and will not,
625for example, cause
626.Xr ssh 1
627to exit if TCP connections to the ultimate forwarding destination fail.
Darren Tuckere7d4b192006-07-12 22:17:10 +1000628The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000629.Cm yes
Darren Tuckere7d4b192006-07-12 22:17:10 +1000630or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000631.Cm no
632(the default).
djm@openbsd.orgb79efde2014-12-21 23:12:42 +0000633.It Cm FingerprintHash
634Specifies the hash algorithm used when displaying key fingerprints.
635Valid options are:
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000636.Cm md5
djm@openbsd.orgb79efde2014-12-21 23:12:42 +0000637and
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000638.Cm sha256
639(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000640.It Cm ForwardAgent
641Specifies whether the connection to the authentication agent (if any)
642will be forwarded to the remote machine.
643The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000644.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000645or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000646.Cm no
647(the default).
Damien Milleraf653042002-09-04 16:40:37 +1000648.Pp
Damien Miller495dca32003-04-01 21:42:14 +1000649Agent forwarding should be enabled with caution.
650Users with the ability to bypass file permissions on the remote host
651(for the agent's Unix-domain socket)
652can access the local agent through the forwarded connection.
653An attacker cannot obtain key material from the agent,
Damien Milleraf653042002-09-04 16:40:37 +1000654however they can perform operations on the keys that enable them to
655authenticate using the identities loaded into the agent.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000656.It Cm ForwardX11
657Specifies whether X11 connections will be automatically redirected
658over the secure channel and
659.Ev DISPLAY
660set.
661The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000662.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000663or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000664.Cm no
665(the default).
Damien Milleraf653042002-09-04 16:40:37 +1000666.Pp
Damien Miller495dca32003-04-01 21:42:14 +1000667X11 forwarding should be enabled with caution.
668Users with the ability to bypass file permissions on the remote host
Darren Tucker0a118da2003-10-15 15:54:32 +1000669(for the user's X11 authorization database)
Damien Miller495dca32003-04-01 21:42:14 +1000670can access the local X11 display through the forwarded connection.
Darren Tucker0a118da2003-10-15 15:54:32 +1000671An attacker may then be able to perform activities such as keystroke monitoring
672if the
673.Cm ForwardX11Trusted
674option is also enabled.
Damien Miller1ab6a512010-06-26 10:02:24 +1000675.It Cm ForwardX11Timeout
Damien Millercede1db2010-07-02 13:33:48 +1000676Specify a timeout for untrusted X11 forwarding
677using the format described in the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000678.Sx TIME FORMATS
679section of
Damien Miller1ab6a512010-06-26 10:02:24 +1000680.Xr sshd_config 5 .
681X11 connections received by
682.Xr ssh 1
683after this time will be refused.
684The default is to disable untrusted X11 forwarding after twenty minutes has
685elapsed.
Darren Tucker0a118da2003-10-15 15:54:32 +1000686.It Cm ForwardX11Trusted
Darren Tuckerdcf6ec42004-05-13 13:03:56 +1000687If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000688.Cm yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +1100689remote X11 clients will have full access to the original X11 display.
Damien Miller1717fd42005-03-01 21:17:31 +1100690.Pp
Darren Tucker0a118da2003-10-15 15:54:32 +1000691If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000692.Cm no
693(the default),
Damien Miller45ee2b92006-03-15 11:56:18 +1100694remote X11 clients will be considered untrusted and prevented
Darren Tucker0a118da2003-10-15 15:54:32 +1000695from stealing or tampering with data belonging to trusted X11
696clients.
Damien Miller1717fd42005-03-01 21:17:31 +1100697Furthermore, the
698.Xr xauth 1
699token used for the session will be set to expire after 20 minutes.
700Remote clients will be refused access after this time.
Darren Tucker0a118da2003-10-15 15:54:32 +1000701.Pp
Darren Tucker0a118da2003-10-15 15:54:32 +1000702See the X11 SECURITY extension specification for full details on
703the restrictions imposed on untrusted clients.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000704.It Cm GatewayPorts
705Specifies whether remote hosts are allowed to connect to local
706forwarded ports.
707By default,
Damien Miller45ee2b92006-03-15 11:56:18 +1100708.Xr ssh 1
Damien Miller495dca32003-04-01 21:42:14 +1000709binds local port forwardings to the loopback address.
710This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000711.Cm GatewayPorts
Damien Miller45ee2b92006-03-15 11:56:18 +1100712can be used to specify that ssh
Ben Lindstrom9f049032002-06-21 00:59:05 +0000713should bind local port forwardings to the wildcard address,
714thus allowing remote hosts to connect to forwarded ports.
715The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000716.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000717or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000718.Cm no
719(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000720.It Cm GlobalKnownHostsFile
Damien Miller295ee632011-05-29 21:42:31 +1000721Specifies one or more files to use for the global
722host key database, separated by whitespace.
723The default is
724.Pa /etc/ssh/ssh_known_hosts ,
725.Pa /etc/ssh/ssh_known_hosts2 .
Darren Tucker0efd1552003-08-26 11:49:55 +1000726.It Cm GSSAPIAuthentication
Damien Millerbaafb982003-12-17 16:32:23 +1100727Specifies whether user authentication based on GSSAPI is allowed.
Damien Millerc2b98272003-09-03 12:13:30 +1000728The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000729.Cm no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000730.It Cm GSSAPIDelegateCredentials
731Forward (delegate) credentials to the server.
732The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000733.Cm no .
Damien Millere1776152005-03-01 21:47:37 +1100734.It Cm HashKnownHosts
735Indicates that
Damien Miller45ee2b92006-03-15 11:56:18 +1100736.Xr ssh 1
Damien Millere1776152005-03-01 21:47:37 +1100737should hash host names and addresses when they are added to
Damien Miller167ea5d2005-05-26 12:04:02 +1000738.Pa ~/.ssh/known_hosts .
Damien Millere1776152005-03-01 21:47:37 +1100739These hashed names may be used normally by
Damien Miller45ee2b92006-03-15 11:56:18 +1100740.Xr ssh 1
Damien Millere1776152005-03-01 21:47:37 +1100741and
Damien Miller45ee2b92006-03-15 11:56:18 +1100742.Xr sshd 8 ,
Damien Millere1776152005-03-01 21:47:37 +1100743but they do not reveal identifying information should the file's contents
744be disclosed.
745The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000746.Cm no .
Damien Miller858bb7d2006-08-05 11:34:51 +1000747Note that existing names and addresses in known hosts files
748will not be converted automatically,
749but may be manually hashed using
Damien Miller4b42d7f2005-03-01 21:48:35 +1100750.Xr ssh-keygen 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000751.It Cm HostbasedAuthentication
752Specifies whether to try rhosts based authentication with public key
753authentication.
754The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000755.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +0000756or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000757.Cm no
758(the default).
djm@openbsd.org46347ed2015-01-30 11:43:14 +0000759.It Cm HostbasedKeyTypes
760Specifies the key types that will be used for hostbased authentication
761as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000762Alternately if the specified value begins with a
763.Sq +
764character, then the specified key types will be appended to the default set
765instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000766If the specified value begins with a
767.Sq -
768character, then the specified key types (including wildcards) will be removed
769from the default set instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000770The default for this option is:
771.Bd -literal -offset 3n
772ecdsa-sha2-nistp256-cert-v01@openssh.com,
773ecdsa-sha2-nistp384-cert-v01@openssh.com,
774ecdsa-sha2-nistp521-cert-v01@openssh.com,
775ssh-ed25519-cert-v01@openssh.com,
776ssh-rsa-cert-v01@openssh.com,
777ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +0000778ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000779.Ed
780.Pp
djm@openbsd.org46347ed2015-01-30 11:43:14 +0000781The
782.Fl Q
783option of
784.Xr ssh 1
785may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000786.It Cm HostKeyAlgorithms
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000787Specifies the host key algorithms
Ben Lindstrom9f049032002-06-21 00:59:05 +0000788that the client wants to use in order of preference.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000789Alternately if the specified value begins with a
790.Sq +
791character, then the specified key types will be appended to the default set
792instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000793If the specified value begins with a
794.Sq -
795character, then the specified key types (including wildcards) will be removed
796from the default set instead of replacing them.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000797The default for this option is:
Damien Millereb8b60e2010-08-31 22:41:14 +1000798.Bd -literal -offset 3n
799ecdsa-sha2-nistp256-cert-v01@openssh.com,
800ecdsa-sha2-nistp384-cert-v01@openssh.com,
801ecdsa-sha2-nistp521-cert-v01@openssh.com,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100802ssh-ed25519-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000803ssh-rsa-cert-v01@openssh.com,
Damien Millereb8b60e2010-08-31 22:41:14 +1000804ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +0000805ssh-ed25519,ssh-rsa
Damien Millereb8b60e2010-08-31 22:41:14 +1000806.Ed
Damien Millerd925dcd2010-12-01 12:21:51 +1100807.Pp
808If hostkeys are known for the destination host then this default is modified
809to prefer their algorithms.
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000810.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000811The list of available key types may also be obtained using
812.Qq ssh -Q key .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000813.It Cm HostKeyAlias
814Specifies an alias that should be used instead of the
815real host name when looking up or saving the host key
djm@openbsd.org6f8ca3b2017-06-24 05:35:05 +0000816in the host key database files and when validating host certificates.
Damien Miller45ee2b92006-03-15 11:56:18 +1100817This option is useful for tunneling SSH connections
Ben Lindstrom9f049032002-06-21 00:59:05 +0000818or for multiple servers running on a single host.
819.It Cm HostName
820Specifies the real host name to log into.
821This can be used to specify nicknames or abbreviations for hosts.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000822Arguments to
823.Cm HostName
824accept the tokens described in the
825.Sx TOKENS
826section.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000827Numeric IP addresses are also permitted (both on the command line and in
828.Cm HostName
829specifications).
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000830The default is the name given on the command line.
Damien Millerbd394c32004-03-08 23:12:36 +1100831.It Cm IdentitiesOnly
832Specifies that
Damien Miller45ee2b92006-03-15 11:56:18 +1100833.Xr ssh 1
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000834should only use the authentication identity and certificate files explicitly
835configured in the
Damien Miller1a812582004-04-20 20:13:32 +1000836.Nm
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000837files
838or passed on the
839.Xr ssh 1
840command-line,
Damien Miller45ee2b92006-03-15 11:56:18 +1100841even if
842.Xr ssh-agent 1
Damien Millercb6b68b2012-12-03 09:49:52 +1100843or a
844.Cm PKCS11Provider
Damien Millerbd394c32004-03-08 23:12:36 +1100845offers more identities.
846The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000847.Cm yes
Damien Millerbd394c32004-03-08 23:12:36 +1100848or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000849.Cm no
850(the default).
Damien Miller45ee2b92006-03-15 11:56:18 +1100851This option is intended for situations where ssh-agent
Damien Millerbd394c32004-03-08 23:12:36 +1100852offers many different identities.
markus@openbsd.orgb02ad1c2016-05-04 12:21:53 +0000853.It Cm IdentityAgent
854Specifies the
855.Ux Ns -domain
856socket used to communicate with the authentication agent.
857.Pp
858This option overrides the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000859.Ev SSH_AUTH_SOCK
markus@openbsd.orgb02ad1c2016-05-04 12:21:53 +0000860environment variable and can be used to select a specific agent.
861Setting the socket name to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000862.Cm none
markus@openbsd.orgb02ad1c2016-05-04 12:21:53 +0000863disables the use of an authentication agent.
markus@openbsd.org1a75d142016-05-04 14:29:58 +0000864If the string
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000865.Qq SSH_AUTH_SOCK
markus@openbsd.org1a75d142016-05-04 14:29:58 +0000866is specified, the location of the socket will be read from the
867.Ev SSH_AUTH_SOCK
868environment variable.
markus@openbsd.orgb02ad1c2016-05-04 12:21:53 +0000869.Pp
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000870Arguments to
871.Cm IdentityAgent
872may use the tilde syntax to refer to a user's home directory
873or the tokens described in the
874.Sx TOKENS
875section.
Damien Miller957d4e42005-12-13 19:30:45 +1100876.It Cm IdentityFile
sobrado@openbsd.orgf70b22b2014-08-30 15:33:50 +0000877Specifies a file from which the user's DSA, ECDSA, Ed25519 or RSA authentication
Damien Millereb8b60e2010-08-31 22:41:14 +1000878identity is read.
Damien Miller957d4e42005-12-13 19:30:45 +1100879The default is
Damien Millereb8b60e2010-08-31 22:41:14 +1000880.Pa ~/.ssh/id_dsa ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100881.Pa ~/.ssh/id_ecdsa ,
882.Pa ~/.ssh/id_ed25519
Damien Miller957d4e42005-12-13 19:30:45 +1100883and
djm@openbsd.org788ac792017-04-30 23:18:22 +0000884.Pa ~/.ssh/id_rsa .
Damien Miller957d4e42005-12-13 19:30:45 +1100885Additionally, any identities represented by the authentication agent
Damien Miller7f2b4382013-07-18 16:10:29 +1000886will be used for authentication unless
887.Cm IdentitiesOnly
888is set.
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000889If no certificates have been explicitly specified by
890.Cm CertificateFile ,
Damien Miller5059d8d2010-03-05 21:31:11 +1100891.Xr ssh 1
892will try to load certificate information from the filename obtained by
893appending
894.Pa -cert.pub
895to the path of a specified
896.Cm IdentityFile .
Damien Miller6b1d53c2006-03-31 23:13:21 +1100897.Pp
jmc@openbsd.org80d1c962016-09-28 17:59:22 +0000898Arguments to
899.Cm IdentityFile
900may use the tilde syntax to refer to a user's home directory
901or the tokens described in the
902.Sx TOKENS
903section.
Damien Miller6b1d53c2006-03-31 23:13:21 +1100904.Pp
Damien Miller957d4e42005-12-13 19:30:45 +1100905It is possible to have
906multiple identity files specified in configuration files; all these
907identities will be tried in sequence.
Damien Miller6029e072011-06-20 14:22:49 +1000908Multiple
909.Cm IdentityFile
910directives will add to the list of identities tried (this behaviour
911differs from that of other configuration directives).
Damien Miller7f2b4382013-07-18 16:10:29 +1000912.Pp
913.Cm IdentityFile
914may be used in conjunction with
915.Cm IdentitiesOnly
916to select which identities in an agent are offered during authentication.
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000917.Cm IdentityFile
918may also be used in conjunction with
919.Cm CertificateFile
920in order to provide any certificate also needed for authentication with
921the identity.
Darren Tucker63e0df22013-05-16 20:30:31 +1000922.It Cm IgnoreUnknown
923Specifies a pattern-list of unknown options to be ignored if they are
924encountered in configuration parsing.
925This may be used to suppress errors if
926.Nm
927contains options that are unrecognised by
928.Xr ssh 1 .
929It is recommended that
930.Cm IgnoreUnknown
931be listed early in the configuration file as it will not be applied
932to unknown options that appear before it.
djm@openbsd.orgdc7990b2016-04-15 00:30:19 +0000933.It Cm Include
934Include the specified configuration file(s).
jmc@openbsd.org6aaabc22016-04-17 14:34:46 +0000935Multiple pathnames may be specified and each pathname may contain
djm@openbsd.orgdc7990b2016-04-15 00:30:19 +0000936.Xr glob 3
937wildcards and, for user configurations, shell-like
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000938.Sq ~
djm@openbsd.orgdc7990b2016-04-15 00:30:19 +0000939references to user home directories.
940Files without absolute paths are assumed to be in
941.Pa ~/.ssh
jmc@openbsd.org6aaabc22016-04-17 14:34:46 +0000942if included in a user configuration file or
djm@openbsd.orgdc7990b2016-04-15 00:30:19 +0000943.Pa /etc/ssh
944if included from the system configuration file.
945.Cm Include
946directive may appear inside a
947.Cm Match
948or
949.Cm Host
950block
951to perform conditional inclusion.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100952.It Cm IPQoS
953Specifies the IPv4 type-of-service or DSCP class for connections.
954Accepted values are
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000955.Cm af11 ,
956.Cm af12 ,
957.Cm af13 ,
958.Cm af21 ,
959.Cm af22 ,
960.Cm af23 ,
961.Cm af31 ,
962.Cm af32 ,
963.Cm af33 ,
964.Cm af41 ,
965.Cm af42 ,
966.Cm af43 ,
967.Cm cs0 ,
968.Cm cs1 ,
969.Cm cs2 ,
970.Cm cs3 ,
971.Cm cs4 ,
972.Cm cs5 ,
973.Cm cs6 ,
974.Cm cs7 ,
975.Cm ef ,
976.Cm lowdelay ,
977.Cm throughput ,
978.Cm reliability ,
djm@openbsd.org51676ec2017-07-23 23:37:02 +0000979a numeric value, or
980.Cm none
981to use the operating system default.
Damien Miller928362d2010-12-26 14:26:45 +1100982This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100983If one argument is specified, it is used as the packet class unconditionally.
984If two values are specified, the first is automatically selected for
985interactive sessions and the second for non-interactive sessions.
986The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000987.Cm lowdelay
Damien Miller0dac6fb2010-11-20 15:19:38 +1100988for interactive sessions and
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000989.Cm throughput
Damien Miller0dac6fb2010-11-20 15:19:38 +1100990for non-interactive sessions.
Damien Millercfb606c2007-10-26 14:24:48 +1000991.It Cm KbdInteractiveAuthentication
992Specifies whether to use keyboard-interactive authentication.
993The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000994.Cm yes
995(the default)
Damien Millercfb606c2007-10-26 14:24:48 +1000996or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +0000997.Cm no .
Darren Tucker636ca902004-11-05 20:22:00 +1100998.It Cm KbdInteractiveDevices
999Specifies the list of methods to use in keyboard-interactive authentication.
1000Multiple method names must be comma-separated.
1001The default is to use the server specified list.
Damien Miller9cfbaec2006-03-15 11:57:55 +11001002The methods available vary depending on what the server supports.
1003For an OpenSSH server,
1004it may be zero or more of:
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001005.Cm bsdauth ,
1006.Cm pam ,
Damien Miller9cfbaec2006-03-15 11:57:55 +11001007and
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001008.Cm skey .
Damien Millerd5f62bf2010-09-24 22:11:14 +10001009.It Cm KexAlgorithms
1010Specifies the available KEX (Key Exchange) algorithms.
1011Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001012Alternately if the specified value begins with a
1013.Sq +
1014character, then the specified methods will be appended to the default set
1015instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +00001016If the specified value begins with a
1017.Sq -
1018character, then the specified methods (including wildcards) will be removed
1019from the default set instead of replacing them.
Damien Miller7fe2b1f2010-09-24 22:11:53 +10001020The default is:
1021.Bd -literal -offset indent
djm@openbsd.org16277fc2016-09-22 17:55:13 +00001022curve25519-sha256,curve25519-sha256@libssh.org,
Damien Miller7fe2b1f2010-09-24 22:11:53 +10001023ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
1024diffie-hellman-group-exchange-sha256,
djm@openbsd.org680321f2018-02-16 02:40:45 +00001025diffie-hellman-group16-sha512,
1026diffie-hellman-group18-sha512,
Damien Millerc1621c82014-04-20 13:22:46 +10001027diffie-hellman-group-exchange-sha1,
djm@openbsd.org680321f2018-02-16 02:40:45 +00001028diffie-hellman-group14-sha256,
djm@openbsd.orgbdfd29f2015-07-03 03:47:00 +00001029diffie-hellman-group14-sha1
Damien Miller7fe2b1f2010-09-24 22:11:53 +10001030.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001031.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001032The list of available key exchange algorithms may also be obtained using
1033.Qq ssh -Q kex .
Damien Millerd27b9472005-12-13 19:29:02 +11001034.It Cm LocalCommand
1035Specifies a command to execute on the local machine after successfully
1036connecting to the server.
1037The command string extends to the end of the line, and is executed with
Darren Tucker63b31cb2007-12-02 23:09:30 +11001038the user's shell.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001039Arguments to
1040.Cm LocalCommand
1041accept the tokens described in the
1042.Sx TOKENS
1043section.
Darren Tucker78be8c52010-01-08 17:05:59 +11001044.Pp
1045The command is run synchronously and does not have access to the
1046session of the
1047.Xr ssh 1
1048that spawned it.
1049It should not be used for interactive commands.
1050.Pp
Damien Millerd27b9472005-12-13 19:29:02 +11001051This directive is ignored unless
1052.Cm PermitLocalCommand
1053has been enabled.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001054.It Cm LocalForward
Damien Millere9d001e2006-01-14 10:10:17 +11001055Specifies that a TCP port on the local machine be forwarded over
Ben Lindstrom9f049032002-06-21 00:59:05 +00001056the secure channel to the specified host and port from the remote machine.
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001057The first argument must be
Damien Millerf91ee4c2005-03-01 21:24:33 +11001058.Sm off
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001059.Oo Ar bind_address : Oc Ar port
Damien Millerf91ee4c2005-03-01 21:24:33 +11001060.Sm on
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001061and the second argument must be
1062.Ar host : Ns Ar hostport .
Damien Miller7fa96602010-08-05 13:03:13 +10001063IPv6 addresses can be specified by enclosing addresses in square brackets.
Damien Millerf8c55462005-03-02 12:03:05 +11001064Multiple forwardings may be specified, and additional forwardings can be
Damien Millerf91ee4c2005-03-01 21:24:33 +11001065given on the command line.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001066Only the superuser can forward privileged ports.
Damien Millerf91ee4c2005-03-01 21:24:33 +11001067By default, the local port is bound in accordance with the
1068.Cm GatewayPorts
1069setting.
1070However, an explicit
1071.Ar bind_address
1072may be used to bind the connection to a specific address.
1073The
1074.Ar bind_address
1075of
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001076.Cm localhost
Damien Millerf8c55462005-03-02 12:03:05 +11001077indicates that the listening port be bound for local use only, while an
1078empty address or
1079.Sq *
Damien Millerf91ee4c2005-03-01 21:24:33 +11001080indicates that the port should be available from all interfaces.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001081.It Cm LogLevel
1082Gives the verbosity level that is used when logging messages from
Damien Miller45ee2b92006-03-15 11:56:18 +11001083.Xr ssh 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001084The possible values are:
Damien Miller45ee2b92006-03-15 11:56:18 +11001085QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +10001086The default is INFO.
1087DEBUG and DEBUG1 are equivalent.
1088DEBUG2 and DEBUG3 each specify higher levels of verbose output.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001089.It Cm MACs
1090Specifies the MAC (message authentication code) algorithms
1091in order of preference.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +00001092The MAC algorithm is used for data integrity protection.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001093Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001094If the specified value begins with a
1095.Sq +
1096character, then the specified algorithms will be appended to the default set
1097instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +00001098If the specified value begins with a
1099.Sq -
1100character, then the specified algorithms (including wildcards) will be removed
1101from the default set instead of replacing them.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001102.Pp
Damien Milleraf43a7a2012-12-12 10:46:31 +11001103The algorithms that contain
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001104.Qq -etm
Damien Milleraf43a7a2012-12-12 10:46:31 +11001105calculate the MAC after encryption (encrypt-then-mac).
1106These are considered safer and their use recommended.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001107.Pp
Damien Miller45ee2b92006-03-15 11:56:18 +11001108The default is:
Damien Miller5e7c30b2007-06-11 14:06:32 +10001109.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +11001110umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1111hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001112hmac-sha1-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +10001113umac-64@openssh.com,umac-128@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001114hmac-sha2-256,hmac-sha2-512,hmac-sha1
Damien Miller5e7c30b2007-06-11 14:06:32 +10001115.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001116.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001117The list of available MAC algorithms may also be obtained using
1118.Qq ssh -Q mac .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001119.It Cm NoHostAuthenticationForLocalhost
djm@openbsd.org4f011da2018-02-10 06:40:28 +00001120Disable host authentication for localhost (loopback addresses).
Ben Lindstrom9f049032002-06-21 00:59:05 +00001121The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001122.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +00001123or
jmc@openbsd.org78142e32017-02-27 14:30:33 +00001124.Cm no
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001125(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +00001126.It Cm NumberOfPasswordPrompts
1127Specifies the number of password prompts before giving up.
1128The argument to this keyword must be an integer.
Damien Miller45ee2b92006-03-15 11:56:18 +11001129The default is 3.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001130.It Cm PasswordAuthentication
1131Specifies whether to use password authentication.
1132The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001133.Cm yes
1134(the default)
Ben Lindstrom9f049032002-06-21 00:59:05 +00001135or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001136.Cm no .
Damien Millerd27b9472005-12-13 19:29:02 +11001137.It Cm PermitLocalCommand
1138Allow local command execution via the
1139.Ic LocalCommand
1140option or using the
Damien Miller4b2319f2005-12-13 19:30:27 +11001141.Ic !\& Ns Ar command
Damien Millerd27b9472005-12-13 19:29:02 +11001142escape sequence in
1143.Xr ssh 1 .
1144The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001145.Cm yes
Damien Millerd27b9472005-12-13 19:29:02 +11001146or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001147.Cm no
1148(the default).
Damien Miller7ea845e2010-02-12 09:21:02 +11001149.It Cm PKCS11Provider
1150Specifies which PKCS#11 provider to use.
Damien Miller8e1ea4e2010-11-20 15:20:10 +11001151The argument to this keyword is the PKCS#11 shared library
Damien Miller7ea845e2010-02-12 09:21:02 +11001152.Xr ssh 1
Damien Millera7618442010-02-12 09:26:02 +11001153should use to communicate with a PKCS#11 token providing the user's
Damien Miller7ea845e2010-02-12 09:21:02 +11001154private RSA key.
Damien Miller957d4e42005-12-13 19:30:45 +11001155.It Cm Port
1156Specifies the port number to connect on the remote host.
Damien Miller45ee2b92006-03-15 11:56:18 +11001157The default is 22.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001158.It Cm PreferredAuthentications
jmc@openbsd.orga685ae82016-02-17 07:38:19 +00001159Specifies the order in which the client should try authentication methods.
Darren Tucker1adc2bd2005-03-14 23:14:20 +11001160This allows a client to prefer one method (e.g.\&
Ben Lindstrom9f049032002-06-21 00:59:05 +00001161.Cm keyboard-interactive )
Darren Tucker1adc2bd2005-03-14 23:14:20 +11001162over another method (e.g.\&
Damien Miller544378d2010-04-16 15:52:24 +10001163.Cm password ) .
1164The default is:
1165.Bd -literal -offset indent
1166gssapi-with-mic,hostbased,publickey,
1167keyboard-interactive,password
1168.Ed
Ben Lindstrom9f049032002-06-21 00:59:05 +00001169.It Cm ProxyCommand
1170Specifies the command to use to connect to the server.
1171The command
Damien Miller079bac22014-07-09 13:06:25 +10001172string extends to the end of the line, and is executed
1173using the user's shell
1174.Ql exec
1175directive to avoid a lingering shell process.
1176.Pp
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001177Arguments to
1178.Cm ProxyCommand
1179accept the tokens described in the
1180.Sx TOKENS
1181section.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001182The command can be basically anything,
1183and should read from its standard input and write to its standard output.
1184It should eventually connect an
1185.Xr sshd 8
1186server running on some machine, or execute
1187.Ic sshd -i
1188somewhere.
1189Host key management will be done using the
1190HostName of the host being connected (defaulting to the name typed by
1191the user).
Damien Miller495dca32003-04-01 21:42:14 +10001192Setting the command to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001193.Cm none
Damien Miller9f1e33a2003-02-24 11:57:32 +11001194disables this option entirely.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001195Note that
1196.Cm CheckHostIP
1197is not available for connects with a proxy command.
1198.Pp
Damien Millerebcfedc2005-05-26 12:13:56 +10001199This directive is useful in conjunction with
1200.Xr nc 1
1201and its proxy support.
Damien Millerdfec2942005-05-26 12:14:32 +10001202For example, the following directive would connect via an HTTP proxy at
Damien Millerebcfedc2005-05-26 12:13:56 +10001203192.0.2.0:
1204.Bd -literal -offset 3n
1205ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p
1206.Ed
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001207.It Cm ProxyJump
millert@openbsd.org887669e2017-10-21 23:06:24 +00001208Specifies one or more jump proxies as either
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001209.Xo
1210.Sm off
jmc@openbsd.orge4eb7d92016-07-16 06:57:55 +00001211.Op Ar user No @
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001212.Ar host
jmc@openbsd.orge4eb7d92016-07-16 06:57:55 +00001213.Op : Ns Ar port
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001214.Sm on
millert@openbsd.org887669e2017-10-21 23:06:24 +00001215or an ssh URI
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001216.Xc .
djm@openbsd.org286f5a72016-07-22 03:35:11 +00001217Multiple proxies may be separated by comma characters and will be visited
djm@openbsd.orgf00211e2016-07-22 07:00:46 +00001218sequentially.
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001219Setting this option will cause
1220.Xr ssh 1
1221to connect to the target host by first making a
1222.Xr ssh 1
1223connection to the specified
1224.Cm ProxyJump
1225host and then establishing a
jmc@openbsd.orge4eb7d92016-07-16 06:57:55 +00001226TCP forwarding to the ultimate target from there.
djm@openbsd.orged877ef2016-07-15 00:24:30 +00001227.Pp
1228Note that this option will compete with the
1229.Cm ProxyCommand
1230option - whichever is specified first will prevent later instances of the
1231other from taking effect.
Damien Miller1262b662013-08-21 02:44:24 +10001232.It Cm ProxyUseFdpass
Damien Millerf2f6c312013-08-21 02:44:58 +10001233Specifies that
Damien Miller1262b662013-08-21 02:44:24 +10001234.Cm ProxyCommand
1235will pass a connected file descriptor back to
Damien Millerf2f6c312013-08-21 02:44:58 +10001236.Xr ssh 1
Damien Miller1262b662013-08-21 02:44:24 +10001237instead of continuing to execute and pass data.
1238The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001239.Cm no .
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001240.It Cm PubkeyAcceptedKeyTypes
1241Specifies the key types that will be used for public key authentication
1242as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001243Alternately if the specified value begins with a
1244.Sq +
1245character, then the key types after it will be appended to the default
1246instead of replacing it.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +00001247If the specified value begins with a
1248.Sq -
1249character, then the specified key types (including wildcards) will be removed
1250from the default set instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001251The default for this option is:
1252.Bd -literal -offset 3n
1253ecdsa-sha2-nistp256-cert-v01@openssh.com,
1254ecdsa-sha2-nistp384-cert-v01@openssh.com,
1255ecdsa-sha2-nistp521-cert-v01@openssh.com,
1256ssh-ed25519-cert-v01@openssh.com,
1257ssh-rsa-cert-v01@openssh.com,
1258ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +00001259ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001260.Ed
1261.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001262The list of available key types may also be obtained using
1263.Qq ssh -Q key .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001264.It Cm PubkeyAuthentication
1265Specifies whether to try public key authentication.
1266The argument to this keyword must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001267.Cm yes
1268(the default)
Ben Lindstrom9f049032002-06-21 00:59:05 +00001269or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001270.Cm no .
Darren Tucker62388b22006-01-20 11:31:47 +11001271.It Cm RekeyLimit
1272Specifies the maximum amount of data that may be transmitted before the
Darren Tuckerc53c2af2013-05-16 20:28:16 +10001273session key is renegotiated, optionally followed a maximum amount of
1274time that may pass before the session key is renegotiated.
1275The first argument is specified in bytes and may have a suffix of
Damien Millerddfddf12006-01-31 21:39:03 +11001276.Sq K ,
1277.Sq M ,
Darren Tucker62388b22006-01-20 11:31:47 +11001278or
Damien Millerddfddf12006-01-31 21:39:03 +11001279.Sq G
Darren Tucker62388b22006-01-20 11:31:47 +11001280to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1281The default is between
Damien Miller45ee2b92006-03-15 11:56:18 +11001282.Sq 1G
Darren Tucker62388b22006-01-20 11:31:47 +11001283and
Damien Miller45ee2b92006-03-15 11:56:18 +11001284.Sq 4G ,
Darren Tucker62388b22006-01-20 11:31:47 +11001285depending on the cipher.
Darren Tuckerc53c2af2013-05-16 20:28:16 +10001286The optional second value is specified in seconds and may use any of the
1287units documented in the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001288.Sx TIME FORMATS
1289section of
Darren Tuckerc53c2af2013-05-16 20:28:16 +10001290.Xr sshd_config 5 .
1291The default value for
1292.Cm RekeyLimit
1293is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001294.Cm default none ,
Darren Tuckerc53c2af2013-05-16 20:28:16 +10001295which means that rekeying is performed after the cipher's default amount
1296of data has been sent or received and no time based rekeying is done.
bluhm@openbsd.org1112b532017-05-30 18:58:37 +00001297.It Cm RemoteCommand
1298Specifies a command to execute on the remote machine after successfully
1299connecting to the server.
1300The command string extends to the end of the line, and is executed with
1301the user's shell.
jmc@openbsd.orga3bb2502017-05-30 19:38:17 +00001302Arguments to
1303.Cm RemoteCommand
1304accept the tokens described in the
1305.Sx TOKENS
1306section.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001307.It Cm RemoteForward
Damien Millere9d001e2006-01-14 10:10:17 +11001308Specifies that a TCP port on the remote machine be forwarded over
markus@openbsd.org609d7a62017-09-21 19:16:53 +00001309the secure channel.
1310The remote port may either be fowarded to a specified host and port
1311from the local machine, or may act as a SOCKS 4/5 proxy that allows a remote
1312client to connect to arbitrary destinations from the local machine.
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001313The first argument must be
Damien Millerf91ee4c2005-03-01 21:24:33 +11001314.Sm off
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001315.Oo Ar bind_address : Oc Ar port
Damien Millerf91ee4c2005-03-01 21:24:33 +11001316.Sm on
markus@openbsd.org609d7a62017-09-21 19:16:53 +00001317If forwarding to a specific destination then the second argument must be
1318.Ar host : Ns Ar hostport ,
1319otherwise if no destination argument is specified then the remote forwarding
1320will be established as a SOCKS proxy.
1321.Pp
Damien Miller7fa96602010-08-05 13:03:13 +10001322IPv6 addresses can be specified by enclosing addresses in square brackets.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001323Multiple forwardings may be specified, and additional
1324forwardings can be given on the command line.
Damien Millerde7532e2008-11-03 19:24:45 +11001325Privileged ports can be forwarded only when
1326logging in as root on the remote machine.
Damien Millere379e102009-02-14 16:34:39 +11001327.Pp
Damien Miller85c6d8a2009-02-14 16:34:21 +11001328If the
1329.Ar port
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001330argument is 0,
Damien Miller85c6d8a2009-02-14 16:34:21 +11001331the listen port will be dynamically allocated on the server and reported
1332to the client at run time.
Damien Millerf91ee4c2005-03-01 21:24:33 +11001333.Pp
1334If the
1335.Ar bind_address
1336is not specified, the default is to only bind to loopback addresses.
1337If the
1338.Ar bind_address
1339is
1340.Ql *
1341or an empty string, then the forwarding is requested to listen on all
1342interfaces.
1343Specifying a remote
1344.Ar bind_address
Damien Millerf8c55462005-03-02 12:03:05 +11001345will only succeed if the server's
1346.Cm GatewayPorts
Damien Millerf91ee4c2005-03-01 21:24:33 +11001347option is enabled (see
Damien Millerf8c55462005-03-02 12:03:05 +11001348.Xr sshd_config 5 ) .
Damien Miller21771e22011-05-15 08:45:50 +10001349.It Cm RequestTTY
1350Specifies whether to request a pseudo-tty for the session.
1351The argument may be one of:
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001352.Cm no
Damien Miller21771e22011-05-15 08:45:50 +10001353(never request a TTY),
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001354.Cm yes
Damien Miller21771e22011-05-15 08:45:50 +10001355(always request a TTY when standard input is a TTY),
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001356.Cm force
Damien Miller21771e22011-05-15 08:45:50 +10001357(always request a TTY) or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001358.Cm auto
Damien Miller21771e22011-05-15 08:45:50 +10001359(request a TTY when opening a login session).
1360This option mirrors the
1361.Fl t
1362and
1363.Fl T
1364flags for
1365.Xr ssh 1 .
djm@openbsd.org5e39a492014-12-04 02:24:32 +00001366.It Cm RevokedHostKeys
1367Specifies revoked host public keys.
1368Keys listed in this file will be refused for host authentication.
1369Note that if this file does not exist or is not readable,
1370then host authentication will be refused for all hosts.
1371Keys may be specified as a text file, listing one public key per line, or as
1372an OpenSSH Key Revocation List (KRL) as generated by
1373.Xr ssh-keygen 1 .
1374For more information on KRLs, see the KEY REVOCATION LISTS section in
1375.Xr ssh-keygen 1 .
Darren Tucker46bc0752004-05-02 22:11:30 +10001376.It Cm SendEnv
1377Specifies what variables from the local
1378.Xr environ 7
1379should be sent to the server.
Damien Miller45ee2b92006-03-15 11:56:18 +11001380The server must also support it, and the server must be configured to
Darren Tucker1e0c9bf2004-05-02 22:12:48 +10001381accept these environment variables.
dtucker@openbsd.org85b96ef2015-04-28 10:17:58 +00001382Note that the
1383.Ev TERM
jmc@openbsd.orgc1d5bcf2015-04-28 13:47:38 +00001384environment variable is always sent whenever a
dtucker@openbsd.org85b96ef2015-04-28 10:17:58 +00001385pseudo-terminal is requested as it is required by the protocol.
Darren Tucker46bc0752004-05-02 22:11:30 +10001386Refer to
1387.Cm AcceptEnv
1388in
1389.Xr sshd_config 5
1390for how to configure the server.
Damien Miller6def5512006-03-15 11:54:05 +11001391Variables are specified by name, which may contain wildcard characters.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +10001392Multiple environment variables may be separated by whitespace or spread
Darren Tucker46bc0752004-05-02 22:11:30 +10001393across multiple
1394.Cm SendEnv
1395directives.
1396The default is not to send any environment variables.
Damien Millerf54a4b92006-03-15 11:54:36 +11001397.Pp
1398See
1399.Sx PATTERNS
1400for more information on patterns.
Damien Miller509b0102003-12-17 16:33:10 +11001401.It Cm ServerAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +11001402Sets the number of server alive messages (see below) which may be
Damien Miller509b0102003-12-17 16:33:10 +11001403sent without
Damien Miller45ee2b92006-03-15 11:56:18 +11001404.Xr ssh 1
Damien Miller509b0102003-12-17 16:33:10 +11001405receiving any messages back from the server.
1406If this threshold is reached while server alive messages are being sent,
Damien Miller45ee2b92006-03-15 11:56:18 +11001407ssh will disconnect from the server, terminating the session.
Damien Miller509b0102003-12-17 16:33:10 +11001408It is important to note that the use of server alive messages is very
1409different from
1410.Cm TCPKeepAlive
1411(below).
1412The server alive messages are sent through the encrypted channel
1413and therefore will not be spoofable.
1414The TCP keepalive option enabled by
1415.Cm TCPKeepAlive
1416is spoofable.
1417The server alive mechanism is valuable when the client or
1418server depend on knowing when a connection has become inactive.
1419.Pp
1420The default value is 3.
1421If, for example,
1422.Cm ServerAliveInterval
Damien Miller45ee2b92006-03-15 11:56:18 +11001423(see below) is set to 15 and
Damien Miller509b0102003-12-17 16:33:10 +11001424.Cm ServerAliveCountMax
Damien Miller45ee2b92006-03-15 11:56:18 +11001425is left at the default, if the server becomes unresponsive,
1426ssh will disconnect after approximately 45 seconds.
Damien Miller957d4e42005-12-13 19:30:45 +11001427.It Cm ServerAliveInterval
1428Sets a timeout interval in seconds after which if no data has been received
1429from the server,
Damien Miller45ee2b92006-03-15 11:56:18 +11001430.Xr ssh 1
Damien Miller957d4e42005-12-13 19:30:45 +11001431will send a message through the encrypted
1432channel to request a response from the server.
1433The default
1434is 0, indicating that these messages will not be sent to the server.
Damien Miller7acefbb2014-07-18 14:11:24 +10001435.It Cm StreamLocalBindMask
1436Sets the octal file creation mode mask
1437.Pq umask
1438used when creating a Unix-domain socket file for local or remote
1439port forwarding.
1440This option is only used for port forwarding to a Unix-domain socket file.
1441.Pp
1442The default value is 0177, which creates a Unix-domain socket file that is
1443readable and writable only by the owner.
1444Note that not all operating systems honor the file mode on Unix-domain
1445socket files.
1446.It Cm StreamLocalBindUnlink
1447Specifies whether to remove an existing Unix-domain socket file for local
1448or remote port forwarding before creating a new one.
1449If the socket file already exists and
1450.Cm StreamLocalBindUnlink
1451is not enabled,
1452.Nm ssh
1453will be unable to forward the port to the Unix-domain socket file.
1454This option is only used for port forwarding to a Unix-domain socket file.
1455.Pp
1456The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001457.Cm yes
Damien Miller7acefbb2014-07-18 14:11:24 +10001458or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001459.Cm no
1460(the default).
Ben Lindstrom9f049032002-06-21 00:59:05 +00001461.It Cm StrictHostKeyChecking
1462If this flag is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001463.Cm yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +11001464.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001465will never automatically add host keys to the
Damien Miller167ea5d2005-05-26 12:04:02 +10001466.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +00001467file, and refuses to connect to hosts whose host key has changed.
dtucker@openbsd.org3e615092018-02-06 06:01:54 +00001468This provides maximum protection against man-in-the-middle (MITM) attacks,
Damien Miller45ee2b92006-03-15 11:56:18 +11001469though it can be annoying when the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001470.Pa /etc/ssh/ssh_known_hosts
Damien Miller45ee2b92006-03-15 11:56:18 +11001471file is poorly maintained or when connections to new hosts are
Ben Lindstrom9f049032002-06-21 00:59:05 +00001472frequently made.
1473This option forces the user to manually
1474add all new hosts.
jmc@openbsd.org149a8cd2017-09-04 06:34:43 +00001475.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001476If this flag is set to
djm@openbsd.org22376d22017-09-03 23:33:13 +00001477.Dq accept-new
jmc@openbsd.org149a8cd2017-09-04 06:34:43 +00001478then ssh will automatically add new host keys to the user
djm@openbsd.org22376d22017-09-03 23:33:13 +00001479known hosts files, but will not permit connections to hosts with
1480changed host keys.
1481If this flag is set to
1482.Dq no
1483or
1484.Dq off ,
jmc@openbsd.org149a8cd2017-09-04 06:34:43 +00001485ssh will automatically add new host keys to the user known hosts files
1486and allow connections to hosts with changed hostkeys to proceed,
1487subject to some restrictions.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001488If this flag is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001489.Cm ask
1490(the default),
Ben Lindstrom9f049032002-06-21 00:59:05 +00001491new host keys
1492will be added to the user known host files only after the user
1493has confirmed that is what they really want to do, and
Damien Miller45ee2b92006-03-15 11:56:18 +11001494ssh will refuse to connect to hosts whose host key has changed.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001495The host keys of
1496known hosts will be verified automatically in all cases.
jmc@openbsd.org47a287b2017-04-28 06:15:03 +00001497.It Cm SyslogFacility
1498Gives the facility code that is used when logging messages from
1499.Xr ssh 1 .
1500The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1501LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1502The default is USER.
Damien Miller12c150e2003-12-17 16:31:10 +11001503.It Cm TCPKeepAlive
1504Specifies whether the system should send TCP keepalive messages to the
1505other side.
1506If they are sent, death of the connection or crash of one
1507of the machines will be properly noticed.
1508However, this means that
1509connections will die if the route is down temporarily, and some people
1510find it annoying.
1511.Pp
1512The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001513.Cm yes
Damien Miller12c150e2003-12-17 16:31:10 +11001514(to send TCP keepalive messages), and the client will notice
1515if the network goes down or the remote host dies.
1516This is important in scripts, and many users want it too.
1517.Pp
1518To disable TCP keepalive messages, the value should be set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001519.Cm no .
djm@openbsd.orga7c38212018-02-10 09:03:54 +00001520See also
1521.Cm ServerAliveInterval
1522for protocol-level keepalives.
Damien Millerd27b9472005-12-13 19:29:02 +11001523.It Cm Tunnel
Damien Miller991dba42006-07-10 20:16:27 +10001524Request
Damien Millerd27b9472005-12-13 19:29:02 +11001525.Xr tun 4
Damien Miller7746c392005-12-13 19:33:37 +11001526device forwarding between the client and the server.
Damien Millerd27b9472005-12-13 19:29:02 +11001527The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001528.Cm yes ,
1529.Cm point-to-point
Damien Miller991dba42006-07-10 20:16:27 +10001530(layer 3),
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001531.Cm ethernet
Damien Miller991dba42006-07-10 20:16:27 +10001532(layer 2),
Damien Millerd27b9472005-12-13 19:29:02 +11001533or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001534.Cm no
1535(the default).
Damien Miller991dba42006-07-10 20:16:27 +10001536Specifying
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001537.Cm yes
Damien Miller991dba42006-07-10 20:16:27 +10001538requests the default tunnel mode, which is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001539.Cm point-to-point .
Damien Millerd27b9472005-12-13 19:29:02 +11001540.It Cm TunnelDevice
Damien Miller991dba42006-07-10 20:16:27 +10001541Specifies the
Damien Millerd27b9472005-12-13 19:29:02 +11001542.Xr tun 4
Damien Miller991dba42006-07-10 20:16:27 +10001543devices to open on the client
1544.Pq Ar local_tun
1545and the server
1546.Pq Ar remote_tun .
1547.Pp
1548The argument must be
1549.Sm off
1550.Ar local_tun Op : Ar remote_tun .
1551.Sm on
1552The devices may be specified by numerical ID or the keyword
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001553.Cm any ,
Damien Miller991dba42006-07-10 20:16:27 +10001554which uses the next available tunnel device.
1555If
1556.Ar remote_tun
1557is not specified, it defaults to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001558.Cm any .
Damien Miller991dba42006-07-10 20:16:27 +10001559The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001560.Cm any:any .
djm@openbsd.org1d1092b2015-01-26 12:16:36 +00001561.It Cm UpdateHostKeys
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001562Specifies whether
1563.Xr ssh 1
1564should accept notifications of additional hostkeys from the server sent
1565after authentication has completed and add them to
1566.Cm UserKnownHostsFile .
1567The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001568.Cm yes ,
1569.Cm no
djm@openbsd.org523463a2015-02-16 22:13:32 +00001570(the default) or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001571.Cm ask .
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001572Enabling this option allows learning alternate hostkeys for a server
djm@openbsd.org1d1092b2015-01-26 12:16:36 +00001573and supports graceful key rotation by allowing a server to send replacement
1574public keys before old ones are removed.
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001575Additional hostkeys are only accepted if the key used to authenticate the
sobrado@openbsd.orge3cbb062015-09-22 08:33:23 +00001576host was already trusted or explicitly accepted by the user.
djm@openbsd.org523463a2015-02-16 22:13:32 +00001577If
1578.Cm UpdateHostKeys
1579is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001580.Cm ask ,
djm@openbsd.org523463a2015-02-16 22:13:32 +00001581then the user is asked to confirm the modifications to the known_hosts file.
djm@openbsd.org44732de2015-02-20 22:17:21 +00001582Confirmation is currently incompatible with
1583.Cm ControlPersist ,
1584and will be disabled if it is enabled.
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001585.Pp
1586Presently, only
1587.Xr sshd 8
1588from OpenSSH 6.8 and greater support the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001589.Qq hostkeys@openssh.com
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001590protocol extension used to inform the client of all the server's hostkeys.
Damien Millere8cd7412005-12-24 14:55:47 +11001591.It Cm UsePrivilegedPort
1592Specifies whether to use a privileged port for outgoing connections.
1593The argument must be
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001594.Cm yes
Damien Millere8cd7412005-12-24 14:55:47 +11001595or
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001596.Cm no
1597(the default).
Damien Millere8cd7412005-12-24 14:55:47 +11001598If set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001599.Cm yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +11001600.Xr ssh 1
Damien Millere8cd7412005-12-24 14:55:47 +11001601must be setuid root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001602.It Cm User
1603Specifies the user to log in as.
1604This can be useful when a different user name is used on different machines.
1605This saves the trouble of
1606having to remember to give the user name on the command line.
1607.It Cm UserKnownHostsFile
Damien Miller295ee632011-05-29 21:42:31 +10001608Specifies one or more files to use for the user
1609host key database, separated by whitespace.
1610The default is
1611.Pa ~/.ssh/known_hosts ,
1612.Pa ~/.ssh/known_hosts2 .
Damien Miller37876e92003-05-15 10:19:46 +10001613.It Cm VerifyHostKeyDNS
1614Specifies whether to verify the remote key using DNS and SSHFP resource
1615records.
Damien Miller150b5572003-11-17 21:19:29 +11001616If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001617.Cm yes ,
Damien Millerfe448472003-11-17 21:19:49 +11001618the client will implicitly trust keys that match a secure fingerprint
Damien Miller150b5572003-11-17 21:19:29 +11001619from DNS.
1620Insecure fingerprints will be handled as if this option was set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001621.Cm ask .
Damien Miller150b5572003-11-17 21:19:29 +11001622If this option is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001623.Cm ask ,
Damien Miller150b5572003-11-17 21:19:29 +11001624information on fingerprint match will be displayed, but the user will still
1625need to confirm new host keys according to the
1626.Cm StrictHostKeyChecking
1627option.
Damien Miller37876e92003-05-15 10:19:46 +10001628The default is
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001629.Cm no .
Damien Miller45ee2b92006-03-15 11:56:18 +11001630.Pp
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001631See also
1632.Sx VERIFYING HOST KEYS
1633in
Damien Miller45ee2b92006-03-15 11:56:18 +11001634.Xr ssh 1 .
Damien Miller10288242008-06-30 00:04:03 +10001635.It Cm VisualHostKey
1636If this flag is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001637.Cm yes ,
Damien Miller10288242008-06-30 00:04:03 +10001638an ASCII art representation of the remote host key fingerprint is
djm@openbsd.orgb79efde2014-12-21 23:12:42 +00001639printed in addition to the fingerprint string at login and
Damien Millera414cd32008-11-03 19:25:21 +11001640for unknown host keys.
Damien Miller10288242008-06-30 00:04:03 +10001641If this flag is set to
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001642.Cm no
1643(the default),
Damien Millera414cd32008-11-03 19:25:21 +11001644no fingerprint strings are printed at login and
djm@openbsd.orgb79efde2014-12-21 23:12:42 +00001645only the fingerprint string will be printed for unknown host keys.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001646.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001647Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001648.Xr xauth 1
1649program.
1650The default is
1651.Pa /usr/X11R6/bin/xauth .
1652.El
Damien Millerb5282c22006-03-15 11:59:08 +11001653.Sh PATTERNS
1654A
1655.Em pattern
1656consists of zero or more non-whitespace characters,
1657.Sq *
1658(a wildcard that matches zero or more characters),
1659or
1660.Sq ?\&
1661(a wildcard that matches exactly one character).
1662For example, to specify a set of declarations for any host in the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001663.Qq .co.uk
Damien Millerb5282c22006-03-15 11:59:08 +11001664set of domains,
1665the following pattern could be used:
1666.Pp
1667.Dl Host *.co.uk
1668.Pp
1669The following pattern
1670would match any host in the 192.168.0.[0-9] network range:
1671.Pp
1672.Dl Host 192.168.0.?
1673.Pp
1674A
1675.Em pattern-list
1676is a comma-separated list of patterns.
1677Patterns within pattern-lists may be negated
1678by preceding them with an exclamation mark
1679.Pq Sq !\& .
1680For example,
Damien Miller51682fa2013-10-17 11:48:31 +11001681to allow a key to be used from anywhere within an organization
Damien Millerb5282c22006-03-15 11:59:08 +11001682except from the
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001683.Qq dialup
Damien Millerb5282c22006-03-15 11:59:08 +11001684pool,
1685the following entry (in authorized_keys) could be used:
1686.Pp
1687.Dl from=\&"!*.dialup.example.com,*.example.com\&"
djm@openbsd.org05b69e92017-10-18 02:49:44 +00001688.Pp
1689Note that a negated match will never produce a positive result by itself.
1690For example, attempting to match
1691.Qq host3
1692against the following pattern-list will fail:
1693.Pp
1694.Dl from=\&"!host1,!host2\&"
1695.Pp
1696The solution here is to include a term that will yield a positive match,
1697such as a wildcard:
1698.Pp
1699.Dl from=\&"!host1,!host2,*\&"
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001700.Sh TOKENS
1701Arguments to some keywords can make use of tokens,
1702which are expanded at runtime:
1703.Pp
1704.Bl -tag -width XXXX -offset indent -compact
1705.It %%
1706A literal
1707.Sq % .
1708.It \&%C
jmc@openbsd.org2b4f3ab2017-10-05 12:56:50 +00001709Hash of %l%h%p%r.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001710.It %d
1711Local user's home directory.
1712.It %h
1713The remote hostname.
1714.It %i
1715The local user ID.
1716.It %L
1717The local hostname.
1718.It %l
1719The local hostname, including the domain name.
1720.It %n
1721The original remote hostname, as given on the command line.
1722.It %p
1723The remote port.
1724.It %r
1725The remote username.
djm@openbsd.orgb7548b12017-10-23 05:08:00 +00001726.It \&%T
1727The local
1728.Xr tun 4
1729or
1730.Xr tap 4
1731network interface assigned if
jmc@openbsd.org08696272017-10-24 06:27:42 +00001732tunnel forwarding was requested, or
1733.Qq NONE
djm@openbsd.orgb7548b12017-10-23 05:08:00 +00001734otherwise.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001735.It %u
1736The local username.
1737.El
1738.Pp
1739.Cm Match exec
1740accepts the tokens %%, %h, %L, %l, %n, %p, %r, and %u.
1741.Pp
1742.Cm CertificateFile
1743accepts the tokens %%, %d, %h, %l, %r, and %u.
1744.Pp
1745.Cm ControlPath
1746accepts the tokens %%, %C, %h, %i, %L, %l, %n, %p, %r, and %u.
1747.Pp
1748.Cm HostName
1749accepts the tokens %% and %h.
1750.Pp
1751.Cm IdentityAgent
1752and
1753.Cm IdentityFile
1754accept the tokens %%, %d, %h, %l, %r, and %u.
1755.Pp
1756.Cm LocalCommand
djm@openbsd.orgb7548b12017-10-23 05:08:00 +00001757accepts the tokens %%, %C, %d, %h, %l, %n, %p, %r, %T, and %u.
jmc@openbsd.org80d1c962016-09-28 17:59:22 +00001758.Pp
1759.Cm ProxyCommand
1760accepts the tokens %%, %h, %p, and %r.
jmc@openbsd.orga3bb2502017-05-30 19:38:17 +00001761.Pp
1762.Cm RemoteCommand
1763accepts the tokens %%, %C, %d, %h, %l, %n, %p, %r, and %u.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001764.Sh FILES
1765.Bl -tag -width Ds
Damien Miller167ea5d2005-05-26 12:04:02 +10001766.It Pa ~/.ssh/config
Ben Lindstrom9f049032002-06-21 00:59:05 +00001767This is the per-user configuration file.
1768The format of this file is described above.
Damien Miller45ee2b92006-03-15 11:56:18 +11001769This file is used by the SSH client.
Damien Millerc970cb92004-04-20 20:12:53 +10001770Because of the potential for abuse, this file must have strict permissions:
1771read/write for the user, and not accessible by others.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001772.It Pa /etc/ssh/ssh_config
1773Systemwide configuration file.
1774This file provides defaults for those
1775values that are not specified in the user's configuration file, and
1776for those users who do not have a configuration file.
1777This file must be world-readable.
1778.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001779.Sh SEE ALSO
1780.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001781.Sh AUTHORS
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001782.An -nosplit
Ben Lindstrom9f049032002-06-21 00:59:05 +00001783OpenSSH is a derivative of the original and free
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001784ssh 1.2.12 release by
1785.An Tatu Ylonen .
1786.An Aaron Campbell , Bob Beck , Markus Friedl ,
1787.An Niels Provos , Theo de Raadt
1788and
1789.An Dug Song
Ben Lindstrom9f049032002-06-21 00:59:05 +00001790removed many bugs, re-added newer features and
1791created OpenSSH.
jmc@openbsd.orgfd2a8f12016-10-15 19:56:25 +00001792.An Markus Friedl
1793contributed the support for SSH protocol versions 1.5 and 2.0.