blob: be790114a4c80811aafc0923388a71819edd56a7 [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.\"
markus@openbsd.orgb02ad1c2016-05-04 12:21:53 +000036.\" $OpenBSD: ssh_config.5,v 1.231 2016/05/04 12:21:53 markus Exp $
37.Dd $Mdocdate: May 4 2016 $
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
43.Sh SYNOPSIS
Darren Tuckerbf6b3282007-02-19 22:08:17 +110044.Nm ~/.ssh/config
45.Nm /etc/ssh/ssh_config
Ben Lindstrom9f049032002-06-21 00:59:05 +000046.Sh DESCRIPTION
Damien Miller45ee2b92006-03-15 11:56:18 +110047.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +000048obtains configuration data from the following sources in
49the following order:
Damien Miller5c853b52006-03-15 11:37:02 +110050.Pp
Ben Lindstrom479b4762002-08-20 19:04:51 +000051.Bl -enum -offset indent -compact
52.It
53command-line options
54.It
55user's configuration file
Damien Miller167ea5d2005-05-26 12:04:02 +100056.Pq Pa ~/.ssh/config
Ben Lindstrom479b4762002-08-20 19:04:51 +000057.It
58system-wide configuration file
59.Pq Pa /etc/ssh/ssh_config
60.El
Ben Lindstrom9f049032002-06-21 00:59:05 +000061.Pp
62For each parameter, the first obtained value
63will be used.
Darren Tucker43d8e282005-02-09 09:51:08 +110064The configuration files contain sections separated by
Ben Lindstrom9f049032002-06-21 00:59:05 +000065.Dq Host
66specifications, and that section is only applied for hosts that
67match one of the patterns given in the specification.
djm@openbsd.org957fbce2014-10-08 22:20:25 +000068The matched host name is usually the one given on the command line
69(see the
70.Cm CanonicalizeHostname
71option for exceptions.)
Ben Lindstrom9f049032002-06-21 00:59:05 +000072.Pp
73Since the first obtained value for each parameter is used, more
74host-specific declarations should be given near the beginning of the
75file, and general defaults at the end.
76.Pp
77The configuration file has the following format:
78.Pp
79Empty lines and lines starting with
80.Ql #
81are comments.
Ben Lindstrom9f049032002-06-21 00:59:05 +000082Otherwise a line is of the format
83.Dq keyword arguments .
84Configuration options may be separated by whitespace or
85optional whitespace and exactly one
86.Ql = ;
87the latter format is useful to avoid the need to quote whitespace
88when specifying configuration options using the
89.Nm ssh ,
Damien Miller4aea9742006-03-15 11:59:39 +110090.Nm scp ,
Ben Lindstrom9f049032002-06-21 00:59:05 +000091and
92.Nm sftp
93.Fl o
94option.
Damien Miller306d1182006-03-15 12:05:59 +110095Arguments may optionally be enclosed in double quotes
96.Pq \&"
97in order to represent arguments containing spaces.
Ben Lindstrom9f049032002-06-21 00:59:05 +000098.Pp
99The possible
100keywords and their meanings are as follows (note that
101keywords are case-insensitive and arguments are case-sensitive):
102.Bl -tag -width Ds
103.It Cm Host
104Restricts the following declarations (up to the next
105.Cm Host
Damien Miller194fd902013-10-15 12:13:05 +1100106or
107.Cm Match
Ben Lindstrom9f049032002-06-21 00:59:05 +0000108keyword) to be only for those hosts that match one of the patterns
109given after the keyword.
Damien Millerfa51b162008-11-03 19:17:33 +1100110If more than one pattern is provided, they should be separated by whitespace.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000111A single
Damien Miller208f1ed2006-03-15 11:56:03 +1100112.Ql *
Ben Lindstrom9f049032002-06-21 00:59:05 +0000113as a pattern can be used to provide global
114defaults for all hosts.
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000115The host is usually the
Ben Lindstrom9f049032002-06-21 00:59:05 +0000116.Ar hostname
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000117argument given on the command line
118(see the
119.Cm CanonicalizeHostname
120option for exceptions.)
Damien Millerf54a4b92006-03-15 11:54:36 +1100121.Pp
Damien Millerfe924212011-05-15 08:44:45 +1000122A pattern entry may be negated by prefixing it with an exclamation mark
123.Pq Sq !\& .
124If a negated entry is matched, then the
125.Cm Host
126entry is ignored, regardless of whether any other patterns on the line
127match.
128Negated matches are therefore useful to provide exceptions for wildcard
129matches.
130.Pp
Damien Millerf54a4b92006-03-15 11:54:36 +1100131See
132.Sx PATTERNS
133for more information on patterns.
Damien Millerd77b81f2013-10-17 11:39:00 +1100134.It Cm Match
Damien Miller194fd902013-10-15 12:13:05 +1100135Restricts the following declarations (up to the next
136.Cm Host
137or
138.Cm Match
139keyword) to be used only when the conditions following the
140.Cm Match
141keyword are satisfied.
sobrado@openbsd.orge3cbb062015-09-22 08:33:23 +0000142Match conditions are specified using one or more criteria
Damien Millercf31f382013-10-24 21:02:56 +1100143or the single token
144.Cm all
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000145which always matches.
146The available criteria keywords are:
147.Cm canonical ,
Damien Miller8a04be72013-10-23 16:29:40 +1100148.Cm exec ,
Damien Miller194fd902013-10-15 12:13:05 +1100149.Cm host ,
150.Cm originalhost ,
151.Cm user ,
152and
153.Cm localuser .
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000154The
155.Cm all
156criteria must appear alone or immediately after
jmc@openbsd.orgb1ba15f2014-10-09 06:21:31 +0000157.Cm canonical .
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000158Other criteria may be combined arbitrarily.
159All criteria but
160.Cm all
161and
162.Cm canonical
163require an argument.
164Criteria may be negated by prepending an exclamation mark
165.Pq Sq !\& .
Damien Miller194fd902013-10-15 12:13:05 +1100166.Pp
Damien Miller8e5a67f2013-10-23 16:30:25 +1100167The
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000168.Cm canonical
dtucker@openbsd.orgdd2cfeb2015-05-28 05:09:45 +0000169keyword matches only when the configuration file is being re-parsed
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000170after hostname canonicalization (see the
171.Cm CanonicalizeHostname
172option.)
173This may be useful to specify conditions that work with canonical host
174names only.
175The
Damien Miller8a04be72013-10-23 16:29:40 +1100176.Cm exec
Damien Miller8e5a67f2013-10-23 16:30:25 +1100177keyword executes the specified command under the user's shell.
Damien Miller194fd902013-10-15 12:13:05 +1100178If the command returns a zero exit status then the condition is considered true.
179Commands containing whitespace characters must be quoted.
Damien Miller5c86ebd2013-10-23 16:29:12 +1100180The following character sequences in the command will be expanded prior to
181execution:
182.Ql %L
183will be substituted by the first component of the local host name,
184.Ql %l
185will be substituted by the local host name (including any domain name),
186.Ql %h
187will be substituted by the target host name,
188.Ql %n
189will be substituted by the original target host name
Damien Miller8a04be72013-10-23 16:29:40 +1100190specified on the command-line,
Damien Miller5c86ebd2013-10-23 16:29:12 +1100191.Ql %p
192the destination port,
193.Ql %r
194by the remote login username, and
195.Ql %u
196by the username of the user running
197.Xr ssh 1 .
Damien Miller194fd902013-10-15 12:13:05 +1100198.Pp
199The other keywords' criteria must be single entries or comma-separated
200lists and may use the wildcard and negation operators described in the
201.Sx PATTERNS
202section.
203The criteria for the
204.Cm host
205keyword are matched against the target hostname, after any substitution
206by the
207.Cm Hostname
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000208or
209.Cm CanonicalizeHostname
210options.
Damien Miller194fd902013-10-15 12:13:05 +1100211The
212.Cm originalhost
213keyword matches against the hostname as it was specified on the command-line.
214The
215.Cm user
216keyword matches against the target username on the remote host.
217The
218.Cm localuser
219keyword matches against the name of the local user running
220.Xr ssh 1
221(this keyword may be useful in system-wide
222.Nm
223files).
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000224.It Cm AddKeysToAgent
225Specifies whether keys should be automatically added to a running
jmc@openbsd.orge41a0712015-11-15 23:58:04 +0000226.Xr ssh-agent 1 .
jcs@openbsd.orgf361df42015-11-15 22:26:49 +0000227If this option is set to
228.Dq yes
229and a key is loaded from a file, the key and its passphrase are added to
230the agent with the default lifetime, as if by
231.Xr ssh-add 1 .
232If this option is set to
233.Dq ask ,
234.Nm ssh
235will require confirmation using the
236.Ev SSH_ASKPASS
237program before adding a key (see
238.Xr ssh-add 1
239for details).
240If this option is set to
241.Dq confirm ,
242each use of the key must be confirmed, as if the
243.Fl c
244option was specified to
245.Xr ssh-add 1 .
246If this option is set to
247.Dq no ,
248no keys are added to the agent.
249The argument must be
250.Dq yes ,
251.Dq confirm ,
252.Dq ask ,
253or
254.Dq no .
255The default is
256.Dq no .
Damien Miller20a8f972003-05-18 20:50:30 +1000257.It Cm AddressFamily
Damien Millerfbf486b2003-05-23 18:44:23 +1000258Specifies which address family to use when connecting.
259Valid arguments are
Damien Miller20a8f972003-05-18 20:50:30 +1000260.Dq any ,
261.Dq inet
Damien Miller45ee2b92006-03-15 11:56:18 +1100262(use IPv4 only), or
Damien Miller20a8f972003-05-18 20:50:30 +1000263.Dq inet6
Darren Tucker79a7acf2005-02-09 09:48:57 +1100264(use IPv6 only).
sobrado@openbsd.orgc12f0fd2016-02-20 23:01:46 +0000265The default is
266.Dq any .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000267.It Cm BatchMode
268If set to
269.Dq yes ,
270passphrase/password querying will be disabled.
271This option is useful in scripts and other batch jobs where no user
272is present to supply the password.
273The argument must be
274.Dq yes
275or
276.Dq no .
277The default is
278.Dq no .
279.It Cm BindAddress
Darren Tucker89f4d472005-07-14 17:06:21 +1000280Use the specified address on the local machine as the source address of
Darren Tucker6c71d202005-07-14 17:06:50 +1000281the connection.
282Only useful on systems with more than one address.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000283Note that this option does not work if
284.Cm UsePrivilegedPort
285is set to
286.Dq yes .
Damien Miller0faf7472013-10-17 11:47:23 +1100287.It Cm CanonicalDomains
Damien Miller607af342013-10-17 11:47:51 +1100288When
Damien Miller38505592013-10-17 11:48:13 +1100289.Cm CanonicalizeHostname
Damien Miller0faf7472013-10-17 11:47:23 +1100290is enabled, this option specifies the list of domain suffixes in which to
291search for the specified destination host.
Damien Miller38505592013-10-17 11:48:13 +1100292.It Cm CanonicalizeFallbackLocal
Damien Miller51682fa2013-10-17 11:48:31 +1100293Specifies whether to fail with an error when hostname canonicalization fails.
Damien Miller607af342013-10-17 11:47:51 +1100294The default,
Darren Tuckerb7e01c02014-01-19 22:36:13 +1100295.Dq yes ,
Damien Miller607af342013-10-17 11:47:51 +1100296will attempt to look up the unqualified hostname using the system resolver's
Damien Miller0faf7472013-10-17 11:47:23 +1100297search rules.
298A value of
Darren Tuckerb7e01c02014-01-19 22:36:13 +1100299.Dq no
Damien Miller0faf7472013-10-17 11:47:23 +1100300will cause
301.Xr ssh 1
302to fail instantly if
Damien Miller38505592013-10-17 11:48:13 +1100303.Cm CanonicalizeHostname
Damien Miller0faf7472013-10-17 11:47:23 +1100304is enabled and the target hostname cannot be found in any of the domains
305specified by
306.Cm CanonicalDomains .
Damien Miller38505592013-10-17 11:48:13 +1100307.It Cm CanonicalizeHostname
Damien Miller51682fa2013-10-17 11:48:31 +1100308Controls whether explicit hostname canonicalization is performed.
Damien Miller607af342013-10-17 11:47:51 +1100309The default,
310.Dq no ,
Damien Miller0faf7472013-10-17 11:47:23 +1100311is not to perform any name rewriting and let the system resolver handle all
312hostname lookups.
313If set to
314.Dq yes
315then, for connections that do not use a
316.Cm ProxyCommand ,
317.Xr ssh 1
Damien Miller38505592013-10-17 11:48:13 +1100318will attempt to canonicalize the hostname specified on the command line
Damien Miller0faf7472013-10-17 11:47:23 +1100319using the
320.Cm CanonicalDomains
321suffixes and
Damien Miller38505592013-10-17 11:48:13 +1100322.Cm CanonicalizePermittedCNAMEs
Damien Miller0faf7472013-10-17 11:47:23 +1100323rules.
324If
Damien Miller38505592013-10-17 11:48:13 +1100325.Cm CanonicalizeHostname
Damien Miller0faf7472013-10-17 11:47:23 +1100326is set to
327.Dq always ,
Damien Miller51682fa2013-10-17 11:48:31 +1100328then canonicalization is applied to proxied connections too.
Damien Miller13f97b22014-02-24 15:57:55 +1100329.Pp
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000330If this option is enabled, then the configuration files are processed
331again using the new target name to pick up any new configuration in matching
Damien Miller13f97b22014-02-24 15:57:55 +1100332.Cm Host
djm@openbsd.org957fbce2014-10-08 22:20:25 +0000333and
334.Cm Match
Damien Miller13f97b22014-02-24 15:57:55 +1100335stanzas.
Damien Miller38505592013-10-17 11:48:13 +1100336.It Cm CanonicalizeMaxDots
Damien Miller607af342013-10-17 11:47:51 +1100337Specifies the maximum number of dot characters in a hostname before
Damien Miller51682fa2013-10-17 11:48:31 +1100338canonicalization is disabled.
Damien Miller607af342013-10-17 11:47:51 +1100339The default,
340.Dq 1 ,
341allows a single dot (i.e. hostname.subdomain).
Damien Miller38505592013-10-17 11:48:13 +1100342.It Cm CanonicalizePermittedCNAMEs
Damien Miller607af342013-10-17 11:47:51 +1100343Specifies rules to determine whether CNAMEs should be followed when
Damien Miller38505592013-10-17 11:48:13 +1100344canonicalizing hostnames.
Damien Miller0faf7472013-10-17 11:47:23 +1100345The rules consist of one or more arguments of
Damien Miller607af342013-10-17 11:47:51 +1100346.Ar source_domain_list : Ns Ar target_domain_list ,
Damien Miller0faf7472013-10-17 11:47:23 +1100347where
348.Ar source_domain_list
Damien Miller51682fa2013-10-17 11:48:31 +1100349is a pattern-list of domains that may follow CNAMEs in canonicalization,
Damien Miller0faf7472013-10-17 11:47:23 +1100350and
351.Ar target_domain_list
Damien Miller607af342013-10-17 11:47:51 +1100352is a pattern-list of domains that they may resolve to.
Damien Miller0faf7472013-10-17 11:47:23 +1100353.Pp
354For example,
355.Dq *.a.example.com:*.b.example.com,*.c.example.com
356will allow hostnames matching
357.Dq *.a.example.com
Damien Miller38505592013-10-17 11:48:13 +1100358to be canonicalized to names in the
Damien Miller0faf7472013-10-17 11:47:23 +1100359.Dq *.b.example.com
360or
361.Dq *.c.example.com
362domains.
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000363.It Cm CertificateFile
364Specifies a file from which the user's certificate is read.
365A corresponding private key must be provided separately in order
366to use this certificate either
367from an
368.Cm IdentityFile
369directive or
370.Fl i
371flag to
372.Xr ssh 1 ,
373via
374.Xr ssh-agent 1 ,
375or via a
376.Cm PKCS11Provider .
377.Pp
378The file name may use the tilde
379syntax to refer to a user's home directory or one of the following
380escape characters:
381.Ql %d
382(local user's home directory),
383.Ql %u
384(local user name),
385.Ql %l
386(local host name),
387.Ql %h
388(remote host name) or
389.Ql %r
390(remote user name).
391.Pp
392It is possible to have multiple certificate files specified in
393configuration files; these certificates will be tried in sequence.
394Multiple
395.Cm CertificateFile
396directives will add to the list of certificates used for
397authentication.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000398.It Cm ChallengeResponseAuthentication
Damien Miller1faa7132006-03-15 11:55:31 +1100399Specifies whether to use challenge-response authentication.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000400The argument to this keyword must be
401.Dq yes
402or
403.Dq no .
404The default is
405.Dq yes .
406.It Cm CheckHostIP
407If this flag is set to
408.Dq yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +1100409.Xr ssh 1
410will additionally check the host IP address in the
Ben Lindstrom9f049032002-06-21 00:59:05 +0000411.Pa known_hosts
412file.
djm@openbsd.org5e678592015-06-02 09:10:40 +0000413This allows ssh to detect if a host key changed due to DNS spoofing
414and will add addresses of destination hosts to
415.Pa ~/.ssh/known_hosts
416in the process, regardless of the setting of
417.Cm StrictHostKeyChecking .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000418If the option is set to
419.Dq no ,
420the check will not be executed.
421The default is
422.Dq yes .
423.It Cm Cipher
424Specifies the cipher to use for encrypting the session
425in protocol version 1.
426Currently,
427.Dq blowfish ,
428.Dq 3des ,
429and
430.Dq des
431are supported.
432.Ar des
433is only supported in the
Damien Miller45ee2b92006-03-15 11:56:18 +1100434.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000435client for interoperability with legacy protocol 1 implementations
436that do not support the
437.Ar 3des
Damien Miller495dca32003-04-01 21:42:14 +1000438cipher.
439Its use is strongly discouraged due to cryptographic weaknesses.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000440The default is
441.Dq 3des .
442.It Cm Ciphers
443Specifies the ciphers allowed for protocol version 2
444in order of preference.
445Multiple ciphers must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000446If the specified value begins with a
447.Sq +
448character, then the specified ciphers will be appended to the default set
449instead of replacing them.
450.Pp
Damien Miller0fde8ac2013-11-21 14:12:23 +1100451The supported ciphers are:
452.Pp
Damien Millerc1621c82014-04-20 13:22:46 +1000453.Bl -item -compact -offset indent
454.It
4553des-cbc
456.It
457aes128-cbc
458.It
459aes192-cbc
460.It
461aes256-cbc
462.It
463aes128-ctr
464.It
465aes192-ctr
466.It
467aes256-ctr
468.It
469aes128-gcm@openssh.com
470.It
471aes256-gcm@openssh.com
472.It
473arcfour
474.It
475arcfour128
476.It
477arcfour256
478.It
479blowfish-cbc
480.It
481cast128-cbc
482.It
483chacha20-poly1305@openssh.com
484.El
Damien Miller0fde8ac2013-11-21 14:12:23 +1100485.Pp
Damien Miller45ee2b92006-03-15 11:56:18 +1100486The default is:
Damien Millerc1621c82014-04-20 13:22:46 +1000487.Bd -literal -offset indent
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000488chacha20-poly1305@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000489aes128-ctr,aes192-ctr,aes256-ctr,
Damien Miller1d75abf2013-01-09 16:12:19 +1100490aes128-gcm@openssh.com,aes256-gcm@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +0000491aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
Ben Lindstrom9f049032002-06-21 00:59:05 +0000492.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100493.Pp
494The list of available ciphers may also be obtained using the
495.Fl Q
496option of
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000497.Xr ssh 1
498with an argument of
499.Dq cipher .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000500.It Cm ClearAllForwardings
Damien Miller45ee2b92006-03-15 11:56:18 +1100501Specifies that all local, remote, and dynamic port forwardings
Ben Lindstrom9f049032002-06-21 00:59:05 +0000502specified in the configuration files or on the command line be
Damien Miller495dca32003-04-01 21:42:14 +1000503cleared.
504This option is primarily useful when used from the
Damien Miller45ee2b92006-03-15 11:56:18 +1100505.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000506command line to clear port forwardings set in
507configuration files, and is automatically set by
508.Xr scp 1
509and
510.Xr sftp 1 .
511The argument must be
512.Dq yes
513or
514.Dq no .
515The default is
516.Dq no .
517.It Cm Compression
518Specifies whether to use compression.
519The argument must be
520.Dq yes
521or
522.Dq no .
523The default is
524.Dq no .
525.It Cm CompressionLevel
526Specifies the compression level to use if compression is enabled.
527The argument must be an integer from 1 (fast) to 9 (slow, best).
528The default level is 6, which is good for most applications.
529The meaning of the values is the same as in
530.Xr gzip 1 .
531Note that this option applies to protocol version 1 only.
532.It Cm ConnectionAttempts
533Specifies the number of tries (one per second) to make before exiting.
534The argument must be an integer.
535This may be useful in scripts if the connection sometimes fails.
536The default is 1.
Damien Millerb78d5eb2003-05-16 11:39:04 +1000537.It Cm ConnectTimeout
Damien Miller45ee2b92006-03-15 11:56:18 +1100538Specifies the timeout (in seconds) used when connecting to the
539SSH server, instead of using the default system TCP timeout.
Damien Millerfbf486b2003-05-23 18:44:23 +1000540This value is used only when the target is down or really unreachable,
541not when it refuses the connection.
Damien Miller0e220db2004-06-15 10:34:08 +1000542.It Cm ControlMaster
543Enables the sharing of multiple sessions over a single network connection.
544When set to
Damien Miller45ee2b92006-03-15 11:56:18 +1100545.Dq yes ,
546.Xr ssh 1
Damien Miller0e220db2004-06-15 10:34:08 +1000547will listen for connections on a control socket specified using the
548.Cm ControlPath
549argument.
550Additional sessions can connect to this socket using the same
551.Cm ControlPath
552with
553.Cm ControlMaster
554set to
555.Dq no
Damien Miller2234bac2004-06-30 22:38:52 +1000556(the default).
Damien Miller713de762005-11-05 15:13:49 +1100557These sessions will try to reuse the master instance's network connection
Damien Millerb3bfbb72005-11-05 15:11:48 +1100558rather than initiating new ones, but will fall back to connecting normally
559if the control socket does not exist, or is not listening.
560.Pp
Damien Miller23f07702004-06-18 01:19:03 +1000561Setting this to
562.Dq ask
Damien Miller45ee2b92006-03-15 11:56:18 +1100563will cause ssh
jmc@openbsd.org78de1672015-03-30 18:28:37 +0000564to listen for control connections, but require confirmation using
565.Xr ssh-askpass 1 .
Damien Millerdadfd4d2005-05-26 12:07:13 +1000566If the
567.Cm ControlPath
Damien Miller45ee2b92006-03-15 11:56:18 +1100568cannot be opened,
569ssh will continue without connecting to a master instance.
Damien Millerd14b1e72005-06-16 13:19:41 +1000570.Pp
Damien Miller13390022005-07-06 09:44:19 +1000571X11 and
Damien Millerfd94fba2005-07-06 09:44:59 +1000572.Xr ssh-agent 1
Damien Miller13390022005-07-06 09:44:19 +1000573forwarding is supported over these multiplexed connections, however the
Darren Tucker63551872005-12-20 16:14:15 +1100574display and agent forwarded will be the one belonging to the master
Damien Millerfd94fba2005-07-06 09:44:59 +1000575connection i.e. it is not possible to forward multiple displays or agents.
Damien Miller13390022005-07-06 09:44:19 +1000576.Pp
Damien Millerd14b1e72005-06-16 13:19:41 +1000577Two additional options allow for opportunistic multiplexing: try to use a
578master connection but fall back to creating a new one if one does not already
579exist.
580These options are:
581.Dq auto
582and
583.Dq autoask .
584The latter requires confirmation like the
585.Dq ask
586option.
Damien Miller0e220db2004-06-15 10:34:08 +1000587.It Cm ControlPath
Damien Miller6476cad2005-06-16 13:18:34 +1000588Specify the path to the control socket used for connection sharing as described
589in the
Damien Miller0e220db2004-06-15 10:34:08 +1000590.Cm ControlMaster
Damien Miller8f74c8f2005-06-26 08:56:03 +1000591section above or the string
592.Dq none
593to disable connection sharing.
Damien Miller6476cad2005-06-16 13:18:34 +1000594In the path,
Damien Millerdfc85fa2011-05-15 08:44:02 +1000595.Ql %L
596will be substituted by the first component of the local host name,
Damien Miller3ec54c72006-03-15 11:30:13 +1100597.Ql %l
Damien Millerdfc85fa2011-05-15 08:44:02 +1000598will be substituted by the local host name (including any domain name),
Damien Miller6476cad2005-06-16 13:18:34 +1000599.Ql %h
600will be substituted by the target host name,
Damien Miller486dd2e2011-05-15 08:47:18 +1000601.Ql %n
602will be substituted by the original target host name
603specified on the command line,
Damien Miller6476cad2005-06-16 13:18:34 +1000604.Ql %p
Damien Miller5c86ebd2013-10-23 16:29:12 +1100605the destination port,
Damien Miller6476cad2005-06-16 13:18:34 +1000606.Ql %r
Damien Miller9c386432014-07-03 21:27:46 +1000607by the remote login username,
Damien Millerdfc85fa2011-05-15 08:44:02 +1000608.Ql %u
djm@openbsd.org674b3b62015-09-11 03:47:28 +0000609by the username and
610.Ql %i
jmc@openbsd.org95923e02015-09-11 06:51:39 +0000611by the numeric user ID (uid) of the user running
612.Xr ssh 1 ,
613and
Damien Miller0f123412014-07-03 21:28:09 +1000614.Ql \&%C
Damien Miller9c386432014-07-03 21:27:46 +1000615by a hash of the concatenation: %l%h%p%r.
Damien Millerd14b1e72005-06-16 13:19:41 +1000616It is recommended that any
617.Cm ControlPath
618used for opportunistic connection sharing include
djm@openbsd.orgfc302562014-11-10 22:25:49 +0000619at least %h, %p, and %r (or alternatively %C) and be placed in a directory
620that is not writable by other users.
Damien Millerd14b1e72005-06-16 13:19:41 +1000621This ensures that shared connections are uniquely identified.
Damien Millere11e1ea2010-08-03 16:04:46 +1000622.It Cm ControlPersist
623When used in conjunction with
624.Cm ControlMaster ,
625specifies that the master connection should remain open
626in the background (waiting for future client connections)
627after the initial client connection has been closed.
628If set to
629.Dq no ,
630then the master connection will not be placed into the background,
631and will close as soon as the initial client connection is closed.
632If set to
djm@openbsd.orgfc302562014-11-10 22:25:49 +0000633.Dq yes
634or
635.Dq 0 ,
Damien Millere11e1ea2010-08-03 16:04:46 +1000636then the master connection will remain in the background indefinitely
637(until killed or closed via a mechanism such as the
638.Xr ssh 1
639.Dq Fl O No exit
640option).
641If set to a time in seconds, or a time in any of the formats documented in
642.Xr sshd_config 5 ,
643then the backgrounded master connection will automatically terminate
644after it has remained idle (with no client connections) for the
645specified time.
Damien Miller2234bac2004-06-30 22:38:52 +1000646.It Cm DynamicForward
Damien Millere9d001e2006-01-14 10:10:17 +1100647Specifies that a TCP port on the local machine be forwarded
Damien Miller2234bac2004-06-30 22:38:52 +1000648over the secure channel, and the application
649protocol is then used to determine where to connect to from the
650remote machine.
Darren Tuckerc8d64212005-10-03 18:13:42 +1000651.Pp
652The argument must be
653.Sm off
654.Oo Ar bind_address : Oc Ar port .
655.Sm on
Damien Miller7fa96602010-08-05 13:03:13 +1000656IPv6 addresses can be specified by enclosing addresses in square brackets.
Darren Tuckerc8d64212005-10-03 18:13:42 +1000657By default, the local port is bound in accordance with the
658.Cm GatewayPorts
659setting.
660However, an explicit
661.Ar bind_address
662may be used to bind the connection to a specific address.
663The
664.Ar bind_address
665of
666.Dq localhost
667indicates that the listening port be bound for local use only, while an
668empty address or
669.Sq *
670indicates that the port should be available from all interfaces.
671.Pp
Damien Miller2234bac2004-06-30 22:38:52 +1000672Currently the SOCKS4 and SOCKS5 protocols are supported, and
Damien Miller45ee2b92006-03-15 11:56:18 +1100673.Xr ssh 1
Damien Miller2234bac2004-06-30 22:38:52 +1000674will act as a SOCKS server.
675Multiple forwardings may be specified, and
676additional forwardings can be given on the command line.
677Only the superuser can forward privileged ports.
Darren Tucker674f71d2003-06-28 12:33:12 +1000678.It Cm EnableSSHKeysign
679Setting this option to
680.Dq yes
681in the global client configuration file
682.Pa /etc/ssh/ssh_config
683enables the use of the helper program
684.Xr ssh-keysign 8
685during
686.Cm HostbasedAuthentication .
687The argument must be
688.Dq yes
689or
690.Dq no .
691The default is
692.Dq no .
Darren Tuckerf132c672003-10-15 15:58:18 +1000693This option should be placed in the non-hostspecific section.
Darren Tucker674f71d2003-06-28 12:33:12 +1000694See
695.Xr ssh-keysign 8
696for more information.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000697.It Cm EscapeChar
698Sets the escape character (default:
699.Ql ~ ) .
700The escape character can also
701be set on the command line.
702The argument should be a single character,
703.Ql ^
704followed by a letter, or
705.Dq none
706to disable the escape
707character entirely (making the connection transparent for binary
708data).
Darren Tuckere7d4b192006-07-12 22:17:10 +1000709.It Cm ExitOnForwardFailure
710Specifies whether
711.Xr ssh 1
712should terminate the connection if it cannot set up all requested
djm@openbsd.orga954cdb2015-09-04 04:47:50 +0000713dynamic, tunnel, local, and remote port forwardings, (e.g.\&
jmc@openbsd.org5245bc12015-09-04 06:40:45 +0000714if either end is unable to bind and listen on a specified port).
djm@openbsd.orga954cdb2015-09-04 04:47:50 +0000715Note that
716.Cm ExitOnForwardFailure
717does not apply to connections made over port forwardings and will not,
718for example, cause
719.Xr ssh 1
720to exit if TCP connections to the ultimate forwarding destination fail.
Darren Tuckere7d4b192006-07-12 22:17:10 +1000721The argument must be
722.Dq yes
723or
724.Dq no .
725The default is
726.Dq no .
djm@openbsd.orgb79efde2014-12-21 23:12:42 +0000727.It Cm FingerprintHash
728Specifies the hash algorithm used when displaying key fingerprints.
729Valid options are:
730.Dq md5
731and
732.Dq sha256 .
djm@openbsd.orgb79efde2014-12-21 23:12:42 +0000733The default is
734.Dq sha256 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000735.It Cm ForwardAgent
736Specifies whether the connection to the authentication agent (if any)
737will be forwarded to the remote machine.
738The argument must be
739.Dq yes
740or
741.Dq no .
742The default is
743.Dq no .
Damien Milleraf653042002-09-04 16:40:37 +1000744.Pp
Damien Miller495dca32003-04-01 21:42:14 +1000745Agent forwarding should be enabled with caution.
746Users with the ability to bypass file permissions on the remote host
747(for the agent's Unix-domain socket)
748can access the local agent through the forwarded connection.
749An attacker cannot obtain key material from the agent,
Damien Milleraf653042002-09-04 16:40:37 +1000750however they can perform operations on the keys that enable them to
751authenticate using the identities loaded into the agent.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000752.It Cm ForwardX11
753Specifies whether X11 connections will be automatically redirected
754over the secure channel and
755.Ev DISPLAY
756set.
757The argument must be
758.Dq yes
759or
760.Dq no .
761The default is
762.Dq no .
Damien Milleraf653042002-09-04 16:40:37 +1000763.Pp
Damien Miller495dca32003-04-01 21:42:14 +1000764X11 forwarding should be enabled with caution.
765Users with the ability to bypass file permissions on the remote host
Darren Tucker0a118da2003-10-15 15:54:32 +1000766(for the user's X11 authorization database)
Damien Miller495dca32003-04-01 21:42:14 +1000767can access the local X11 display through the forwarded connection.
Darren Tucker0a118da2003-10-15 15:54:32 +1000768An attacker may then be able to perform activities such as keystroke monitoring
769if the
770.Cm ForwardX11Trusted
771option is also enabled.
Damien Miller1ab6a512010-06-26 10:02:24 +1000772.It Cm ForwardX11Timeout
Damien Millercede1db2010-07-02 13:33:48 +1000773Specify a timeout for untrusted X11 forwarding
774using the format described in the
Damien Millerfecfd112013-07-18 16:11:50 +1000775TIME FORMATS section of
Damien Miller1ab6a512010-06-26 10:02:24 +1000776.Xr sshd_config 5 .
777X11 connections received by
778.Xr ssh 1
779after this time will be refused.
780The default is to disable untrusted X11 forwarding after twenty minutes has
781elapsed.
Darren Tucker0a118da2003-10-15 15:54:32 +1000782.It Cm ForwardX11Trusted
Darren Tuckerdcf6ec42004-05-13 13:03:56 +1000783If this option is set to
Damien Miller45ee2b92006-03-15 11:56:18 +1100784.Dq yes ,
785remote X11 clients will have full access to the original X11 display.
Damien Miller1717fd42005-03-01 21:17:31 +1100786.Pp
Darren Tucker0a118da2003-10-15 15:54:32 +1000787If this option is set to
Damien Miller45ee2b92006-03-15 11:56:18 +1100788.Dq no ,
789remote X11 clients will be considered untrusted and prevented
Darren Tucker0a118da2003-10-15 15:54:32 +1000790from stealing or tampering with data belonging to trusted X11
791clients.
Damien Miller1717fd42005-03-01 21:17:31 +1100792Furthermore, the
793.Xr xauth 1
794token used for the session will be set to expire after 20 minutes.
795Remote clients will be refused access after this time.
Darren Tucker0a118da2003-10-15 15:54:32 +1000796.Pp
797The default is
798.Dq no .
799.Pp
800See the X11 SECURITY extension specification for full details on
801the restrictions imposed on untrusted clients.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000802.It Cm GatewayPorts
803Specifies whether remote hosts are allowed to connect to local
804forwarded ports.
805By default,
Damien Miller45ee2b92006-03-15 11:56:18 +1100806.Xr ssh 1
Damien Miller495dca32003-04-01 21:42:14 +1000807binds local port forwardings to the loopback address.
808This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000809.Cm GatewayPorts
Damien Miller45ee2b92006-03-15 11:56:18 +1100810can be used to specify that ssh
Ben Lindstrom9f049032002-06-21 00:59:05 +0000811should bind local port forwardings to the wildcard address,
812thus allowing remote hosts to connect to forwarded ports.
813The argument must be
814.Dq yes
815or
816.Dq no .
817The default is
818.Dq no .
819.It Cm GlobalKnownHostsFile
Damien Miller295ee632011-05-29 21:42:31 +1000820Specifies one or more files to use for the global
821host key database, separated by whitespace.
822The default is
823.Pa /etc/ssh/ssh_known_hosts ,
824.Pa /etc/ssh/ssh_known_hosts2 .
Darren Tucker0efd1552003-08-26 11:49:55 +1000825.It Cm GSSAPIAuthentication
Damien Millerbaafb982003-12-17 16:32:23 +1100826Specifies whether user authentication based on GSSAPI is allowed.
Damien Millerc2b98272003-09-03 12:13:30 +1000827The default is
Darren Tuckera044f472003-10-15 15:52:03 +1000828.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000829.It Cm GSSAPIDelegateCredentials
830Forward (delegate) credentials to the server.
831The default is
832.Dq no .
Damien Millere1776152005-03-01 21:47:37 +1100833.It Cm HashKnownHosts
834Indicates that
Damien Miller45ee2b92006-03-15 11:56:18 +1100835.Xr ssh 1
Damien Millere1776152005-03-01 21:47:37 +1100836should hash host names and addresses when they are added to
Damien Miller167ea5d2005-05-26 12:04:02 +1000837.Pa ~/.ssh/known_hosts .
Damien Millere1776152005-03-01 21:47:37 +1100838These hashed names may be used normally by
Damien Miller45ee2b92006-03-15 11:56:18 +1100839.Xr ssh 1
Damien Millere1776152005-03-01 21:47:37 +1100840and
Damien Miller45ee2b92006-03-15 11:56:18 +1100841.Xr sshd 8 ,
Damien Millere1776152005-03-01 21:47:37 +1100842but they do not reveal identifying information should the file's contents
843be disclosed.
844The default is
845.Dq no .
Damien Miller858bb7d2006-08-05 11:34:51 +1000846Note that existing names and addresses in known hosts files
847will not be converted automatically,
848but may be manually hashed using
Damien Miller4b42d7f2005-03-01 21:48:35 +1100849.Xr ssh-keygen 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000850.It Cm HostbasedAuthentication
851Specifies whether to try rhosts based authentication with public key
852authentication.
853The argument must be
854.Dq yes
855or
856.Dq no .
857The default is
858.Dq no .
djm@openbsd.org46347ed2015-01-30 11:43:14 +0000859.It Cm HostbasedKeyTypes
860Specifies the key types that will be used for hostbased authentication
861as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000862Alternately if the specified value begins with a
863.Sq +
864character, then the specified key types will be appended to the default set
865instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000866The default for this option is:
867.Bd -literal -offset 3n
868ecdsa-sha2-nistp256-cert-v01@openssh.com,
869ecdsa-sha2-nistp384-cert-v01@openssh.com,
870ecdsa-sha2-nistp521-cert-v01@openssh.com,
871ssh-ed25519-cert-v01@openssh.com,
872ssh-rsa-cert-v01@openssh.com,
873ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +0000874ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000875.Ed
876.Pp
djm@openbsd.org46347ed2015-01-30 11:43:14 +0000877The
878.Fl Q
879option of
880.Xr ssh 1
881may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000882.It Cm HostKeyAlgorithms
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000883Specifies the host key algorithms
Ben Lindstrom9f049032002-06-21 00:59:05 +0000884that the client wants to use in order of preference.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000885Alternately if the specified value begins with a
886.Sq +
887character, then the specified key types will be appended to the default set
888instead of replacing them.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000889The default for this option is:
Damien Millereb8b60e2010-08-31 22:41:14 +1000890.Bd -literal -offset 3n
891ecdsa-sha2-nistp256-cert-v01@openssh.com,
892ecdsa-sha2-nistp384-cert-v01@openssh.com,
893ecdsa-sha2-nistp521-cert-v01@openssh.com,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100894ssh-ed25519-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000895ssh-rsa-cert-v01@openssh.com,
Damien Millereb8b60e2010-08-31 22:41:14 +1000896ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +0000897ssh-ed25519,ssh-rsa
Damien Millereb8b60e2010-08-31 22:41:14 +1000898.Ed
Damien Millerd925dcd2010-12-01 12:21:51 +1100899.Pp
900If hostkeys are known for the destination host then this default is modified
901to prefer their algorithms.
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000902.Pp
903The list of available key types may also be obtained using the
904.Fl Q
905option of
906.Xr ssh 1
907with an argument of
908.Dq key .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000909.It Cm HostKeyAlias
910Specifies an alias that should be used instead of the
911real host name when looking up or saving the host key
912in the host key database files.
Damien Miller45ee2b92006-03-15 11:56:18 +1100913This option is useful for tunneling SSH connections
Ben Lindstrom9f049032002-06-21 00:59:05 +0000914or for multiple servers running on a single host.
915.It Cm HostName
916Specifies the real host name to log into.
917This can be used to specify nicknames or abbreviations for hosts.
Damien Millerd0244d42010-07-16 13:56:43 +1000918If the hostname contains the character sequence
919.Ql %h ,
Damien Miller486dd2e2011-05-15 08:47:18 +1000920then this will be replaced with the host name specified on the command line
Damien Millerd0244d42010-07-16 13:56:43 +1000921(this is useful for manipulating unqualified names).
Damien Milleref9f13b2014-07-03 21:26:21 +1000922The character sequence
923.Ql %%
924will be replaced by a single
925.Ql %
926character, which may be used when specifying IPv6 link-local addresses.
927.Pp
Damien Miller45ee2b92006-03-15 11:56:18 +1100928The default is the name given on the command line.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000929Numeric IP addresses are also permitted (both on the command line and in
930.Cm HostName
931specifications).
Damien Millerbd394c32004-03-08 23:12:36 +1100932.It Cm IdentitiesOnly
933Specifies that
Damien Miller45ee2b92006-03-15 11:56:18 +1100934.Xr ssh 1
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000935should only use the authentication identity and certificate files explicitly
936configured in the
Damien Miller1a812582004-04-20 20:13:32 +1000937.Nm
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000938files
939or passed on the
940.Xr ssh 1
941command-line,
Damien Miller45ee2b92006-03-15 11:56:18 +1100942even if
943.Xr ssh-agent 1
Damien Millercb6b68b2012-12-03 09:49:52 +1100944or a
945.Cm PKCS11Provider
Damien Millerbd394c32004-03-08 23:12:36 +1100946offers more identities.
947The argument to this keyword must be
948.Dq yes
949or
950.Dq no .
Damien Miller45ee2b92006-03-15 11:56:18 +1100951This option is intended for situations where ssh-agent
Damien Millerbd394c32004-03-08 23:12:36 +1100952offers many different identities.
953The default is
954.Dq no .
markus@openbsd.orgb02ad1c2016-05-04 12:21:53 +0000955.It Cm IdentityAgent
956Specifies the
957.Ux Ns -domain
958socket used to communicate with the authentication agent.
959.Pp
960This option overrides the
961.Dq SSH_AUTH_SOCK
962environment variable and can be used to select a specific agent.
963Setting the socket name to
964.Dq none
965disables the use of an authentication agent.
966.Pp
967The socket name may use the tilde
968syntax to refer to a user's home directory or one of the following
969escape characters:
970.Ql %d
971(local user's home directory),
972.Ql %u
973(local user name),
974.Ql %l
975(local host name),
976.Ql %h
977(remote host name) or
978.Ql %r
979(remote user name).
Damien Miller957d4e42005-12-13 19:30:45 +1100980.It Cm IdentityFile
sobrado@openbsd.orgf70b22b2014-08-30 15:33:50 +0000981Specifies a file from which the user's DSA, ECDSA, Ed25519 or RSA authentication
Damien Millereb8b60e2010-08-31 22:41:14 +1000982identity is read.
Damien Miller957d4e42005-12-13 19:30:45 +1100983The default is
984.Pa ~/.ssh/identity
985for protocol version 1, and
Damien Millereb8b60e2010-08-31 22:41:14 +1000986.Pa ~/.ssh/id_dsa ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100987.Pa ~/.ssh/id_ecdsa ,
988.Pa ~/.ssh/id_ed25519
Damien Miller957d4e42005-12-13 19:30:45 +1100989and
Damien Millereb8b60e2010-08-31 22:41:14 +1000990.Pa ~/.ssh/id_rsa
Damien Miller957d4e42005-12-13 19:30:45 +1100991for protocol version 2.
992Additionally, any identities represented by the authentication agent
Damien Miller7f2b4382013-07-18 16:10:29 +1000993will be used for authentication unless
994.Cm IdentitiesOnly
995is set.
djm@openbsd.org4e44a792015-09-24 06:15:11 +0000996If no certificates have been explicitly specified by
997.Cm CertificateFile ,
Damien Miller5059d8d2010-03-05 21:31:11 +1100998.Xr ssh 1
999will try to load certificate information from the filename obtained by
1000appending
1001.Pa -cert.pub
1002to the path of a specified
1003.Cm IdentityFile .
Damien Miller6b1d53c2006-03-31 23:13:21 +11001004.Pp
Damien Miller957d4e42005-12-13 19:30:45 +11001005The file name may use the tilde
Damien Millerc6437cf2006-03-31 23:14:41 +11001006syntax to refer to a user's home directory or one of the following
Damien Miller6b1d53c2006-03-31 23:13:21 +11001007escape characters:
1008.Ql %d
1009(local user's home directory),
1010.Ql %u
1011(local user name),
1012.Ql %l
1013(local host name),
1014.Ql %h
1015(remote host name) or
Damien Millerdfc61832006-03-31 23:14:57 +11001016.Ql %r
Damien Miller6b1d53c2006-03-31 23:13:21 +11001017(remote user name).
1018.Pp
Damien Miller957d4e42005-12-13 19:30:45 +11001019It is possible to have
1020multiple identity files specified in configuration files; all these
1021identities will be tried in sequence.
Damien Miller6029e072011-06-20 14:22:49 +10001022Multiple
1023.Cm IdentityFile
1024directives will add to the list of identities tried (this behaviour
1025differs from that of other configuration directives).
Damien Miller7f2b4382013-07-18 16:10:29 +10001026.Pp
1027.Cm IdentityFile
1028may be used in conjunction with
1029.Cm IdentitiesOnly
1030to select which identities in an agent are offered during authentication.
djm@openbsd.org4e44a792015-09-24 06:15:11 +00001031.Cm IdentityFile
1032may also be used in conjunction with
1033.Cm CertificateFile
1034in order to provide any certificate also needed for authentication with
1035the identity.
Darren Tucker63e0df22013-05-16 20:30:31 +10001036.It Cm IgnoreUnknown
1037Specifies a pattern-list of unknown options to be ignored if they are
1038encountered in configuration parsing.
1039This may be used to suppress errors if
1040.Nm
1041contains options that are unrecognised by
1042.Xr ssh 1 .
1043It is recommended that
1044.Cm IgnoreUnknown
1045be listed early in the configuration file as it will not be applied
1046to unknown options that appear before it.
djm@openbsd.orgdc7990b2016-04-15 00:30:19 +00001047.It Cm Include
1048Include the specified configuration file(s).
jmc@openbsd.org6aaabc22016-04-17 14:34:46 +00001049Multiple pathnames may be specified and each pathname may contain
djm@openbsd.orgdc7990b2016-04-15 00:30:19 +00001050.Xr glob 3
1051wildcards and, for user configurations, shell-like
1052.Dq ~
1053references to user home directories.
1054Files without absolute paths are assumed to be in
1055.Pa ~/.ssh
jmc@openbsd.org6aaabc22016-04-17 14:34:46 +00001056if included in a user configuration file or
djm@openbsd.orgdc7990b2016-04-15 00:30:19 +00001057.Pa /etc/ssh
1058if included from the system configuration file.
1059.Cm Include
1060directive may appear inside a
1061.Cm Match
1062or
1063.Cm Host
1064block
1065to perform conditional inclusion.
Damien Miller0dac6fb2010-11-20 15:19:38 +11001066.It Cm IPQoS
1067Specifies the IPv4 type-of-service or DSCP class for connections.
1068Accepted values are
1069.Dq af11 ,
1070.Dq af12 ,
1071.Dq af13 ,
Damien Millerf6e758c2011-09-22 21:37:13 +10001072.Dq af21 ,
Damien Miller0dac6fb2010-11-20 15:19:38 +11001073.Dq af22 ,
1074.Dq af23 ,
1075.Dq af31 ,
1076.Dq af32 ,
1077.Dq af33 ,
1078.Dq af41 ,
1079.Dq af42 ,
1080.Dq af43 ,
1081.Dq cs0 ,
1082.Dq cs1 ,
1083.Dq cs2 ,
1084.Dq cs3 ,
1085.Dq cs4 ,
1086.Dq cs5 ,
1087.Dq cs6 ,
1088.Dq cs7 ,
1089.Dq ef ,
1090.Dq lowdelay ,
1091.Dq throughput ,
1092.Dq reliability ,
1093or a numeric value.
Damien Miller928362d2010-12-26 14:26:45 +11001094This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +11001095If one argument is specified, it is used as the packet class unconditionally.
1096If two values are specified, the first is automatically selected for
1097interactive sessions and the second for non-interactive sessions.
1098The default is
1099.Dq lowdelay
1100for interactive sessions and
1101.Dq throughput
1102for non-interactive sessions.
Damien Millercfb606c2007-10-26 14:24:48 +10001103.It Cm KbdInteractiveAuthentication
1104Specifies whether to use keyboard-interactive authentication.
1105The argument to this keyword must be
1106.Dq yes
1107or
1108.Dq no .
1109The default is
1110.Dq yes .
Darren Tucker636ca902004-11-05 20:22:00 +11001111.It Cm KbdInteractiveDevices
1112Specifies the list of methods to use in keyboard-interactive authentication.
1113Multiple method names must be comma-separated.
1114The default is to use the server specified list.
Damien Miller9cfbaec2006-03-15 11:57:55 +11001115The methods available vary depending on what the server supports.
1116For an OpenSSH server,
1117it may be zero or more of:
1118.Dq bsdauth ,
1119.Dq pam ,
1120and
1121.Dq skey .
Damien Millerd5f62bf2010-09-24 22:11:14 +10001122.It Cm KexAlgorithms
1123Specifies the available KEX (Key Exchange) algorithms.
1124Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001125Alternately if the specified value begins with a
1126.Sq +
1127character, then the specified methods will be appended to the default set
1128instead of replacing them.
Damien Miller7fe2b1f2010-09-24 22:11:53 +10001129The default is:
1130.Bd -literal -offset indent
Damien Miller0bd8f152013-11-04 08:55:43 +11001131curve25519-sha256@libssh.org,
Damien Miller7fe2b1f2010-09-24 22:11:53 +10001132ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
1133diffie-hellman-group-exchange-sha256,
Damien Millerc1621c82014-04-20 13:22:46 +10001134diffie-hellman-group-exchange-sha1,
djm@openbsd.orgbdfd29f2015-07-03 03:47:00 +00001135diffie-hellman-group14-sha1
Damien Miller7fe2b1f2010-09-24 22:11:53 +10001136.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001137.Pp
1138The list of available key exchange algorithms may also be obtained using the
1139.Fl Q
1140option of
1141.Xr ssh 1
1142with an argument of
1143.Dq kex .
Damien Millerd27b9472005-12-13 19:29:02 +11001144.It Cm LocalCommand
1145Specifies a command to execute on the local machine after successfully
1146connecting to the server.
1147The command string extends to the end of the line, and is executed with
Darren Tucker63b31cb2007-12-02 23:09:30 +11001148the user's shell.
Darren Tuckerf6b01b72008-06-13 04:56:37 +10001149The following escape character substitutions will be performed:
1150.Ql %d
1151(local user's home directory),
1152.Ql %h
1153(remote host name),
1154.Ql %l
1155(local host name),
1156.Ql %n
1157(host name as provided on the command line),
1158.Ql %p
1159(remote port),
1160.Ql %r
1161(remote user name) or
1162.Ql %u
Damien Miller9c386432014-07-03 21:27:46 +10001163(local user name) or
Damien Miller0f123412014-07-03 21:28:09 +10001164.Ql \&%C
Damien Miller9c386432014-07-03 21:27:46 +10001165by a hash of the concatenation: %l%h%p%r.
Darren Tucker78be8c52010-01-08 17:05:59 +11001166.Pp
1167The command is run synchronously and does not have access to the
1168session of the
1169.Xr ssh 1
1170that spawned it.
1171It should not be used for interactive commands.
1172.Pp
Damien Millerd27b9472005-12-13 19:29:02 +11001173This directive is ignored unless
1174.Cm PermitLocalCommand
1175has been enabled.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001176.It Cm LocalForward
Damien Millere9d001e2006-01-14 10:10:17 +11001177Specifies that a TCP port on the local machine be forwarded over
Ben Lindstrom9f049032002-06-21 00:59:05 +00001178the secure channel to the specified host and port from the remote machine.
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001179The first argument must be
Damien Millerf91ee4c2005-03-01 21:24:33 +11001180.Sm off
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001181.Oo Ar bind_address : Oc Ar port
Damien Millerf91ee4c2005-03-01 21:24:33 +11001182.Sm on
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001183and the second argument must be
1184.Ar host : Ns Ar hostport .
Damien Miller7fa96602010-08-05 13:03:13 +10001185IPv6 addresses can be specified by enclosing addresses in square brackets.
Damien Millerf8c55462005-03-02 12:03:05 +11001186Multiple forwardings may be specified, and additional forwardings can be
Damien Millerf91ee4c2005-03-01 21:24:33 +11001187given on the command line.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001188Only the superuser can forward privileged ports.
Damien Millerf91ee4c2005-03-01 21:24:33 +11001189By default, the local port is bound in accordance with the
1190.Cm GatewayPorts
1191setting.
1192However, an explicit
1193.Ar bind_address
1194may be used to bind the connection to a specific address.
1195The
1196.Ar bind_address
1197of
1198.Dq localhost
Damien Millerf8c55462005-03-02 12:03:05 +11001199indicates that the listening port be bound for local use only, while an
1200empty address or
1201.Sq *
Damien Millerf91ee4c2005-03-01 21:24:33 +11001202indicates that the port should be available from all interfaces.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001203.It Cm LogLevel
1204Gives the verbosity level that is used when logging messages from
Damien Miller45ee2b92006-03-15 11:56:18 +11001205.Xr ssh 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001206The possible values are:
Damien Miller45ee2b92006-03-15 11:56:18 +11001207QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +10001208The default is INFO.
1209DEBUG and DEBUG1 are equivalent.
1210DEBUG2 and DEBUG3 each specify higher levels of verbose output.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001211.It Cm MACs
1212Specifies the MAC (message authentication code) algorithms
1213in order of preference.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +00001214The MAC algorithm is used for data integrity protection.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001215Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001216If the specified value begins with a
1217.Sq +
1218character, then the specified algorithms will be appended to the default set
1219instead of replacing them.
1220.Pp
Damien Milleraf43a7a2012-12-12 10:46:31 +11001221The algorithms that contain
1222.Dq -etm
1223calculate the MAC after encryption (encrypt-then-mac).
1224These are considered safer and their use recommended.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001225.Pp
Damien Miller45ee2b92006-03-15 11:56:18 +11001226The default is:
Damien Miller5e7c30b2007-06-11 14:06:32 +10001227.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +11001228umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1229hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001230hmac-sha1-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +10001231umac-64@openssh.com,umac-128@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001232hmac-sha2-256,hmac-sha2-512,hmac-sha1
Damien Miller5e7c30b2007-06-11 14:06:32 +10001233.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001234.Pp
1235The list of available MAC algorithms may also be obtained using the
1236.Fl Q
1237option of
1238.Xr ssh 1
1239with an argument of
1240.Dq mac .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001241.It Cm NoHostAuthenticationForLocalhost
1242This option can be used if the home directory is shared across machines.
1243In this case localhost will refer to a different machine on each of
1244the machines and the user will get many warnings about changed host keys.
1245However, this option disables host authentication for localhost.
1246The argument to this keyword must be
1247.Dq yes
1248or
1249.Dq no .
1250The default is to check the host key for localhost.
1251.It Cm NumberOfPasswordPrompts
1252Specifies the number of password prompts before giving up.
1253The argument to this keyword must be an integer.
Damien Miller45ee2b92006-03-15 11:56:18 +11001254The default is 3.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001255.It Cm PasswordAuthentication
1256Specifies whether to use password authentication.
1257The argument to this keyword must be
1258.Dq yes
1259or
1260.Dq no .
1261The default is
1262.Dq yes .
Damien Millerd27b9472005-12-13 19:29:02 +11001263.It Cm PermitLocalCommand
1264Allow local command execution via the
1265.Ic LocalCommand
1266option or using the
Damien Miller4b2319f2005-12-13 19:30:27 +11001267.Ic !\& Ns Ar command
Damien Millerd27b9472005-12-13 19:29:02 +11001268escape sequence in
1269.Xr ssh 1 .
1270The argument must be
1271.Dq yes
1272or
1273.Dq no .
1274The default is
1275.Dq no .
Damien Miller7ea845e2010-02-12 09:21:02 +11001276.It Cm PKCS11Provider
1277Specifies which PKCS#11 provider to use.
Damien Miller8e1ea4e2010-11-20 15:20:10 +11001278The argument to this keyword is the PKCS#11 shared library
Damien Miller7ea845e2010-02-12 09:21:02 +11001279.Xr ssh 1
Damien Millera7618442010-02-12 09:26:02 +11001280should use to communicate with a PKCS#11 token providing the user's
Damien Miller7ea845e2010-02-12 09:21:02 +11001281private RSA key.
Damien Miller957d4e42005-12-13 19:30:45 +11001282.It Cm Port
1283Specifies the port number to connect on the remote host.
Damien Miller45ee2b92006-03-15 11:56:18 +11001284The default is 22.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001285.It Cm PreferredAuthentications
jmc@openbsd.orga685ae82016-02-17 07:38:19 +00001286Specifies the order in which the client should try authentication methods.
Darren Tucker1adc2bd2005-03-14 23:14:20 +11001287This allows a client to prefer one method (e.g.\&
Ben Lindstrom9f049032002-06-21 00:59:05 +00001288.Cm keyboard-interactive )
Darren Tucker1adc2bd2005-03-14 23:14:20 +11001289over another method (e.g.\&
Damien Miller544378d2010-04-16 15:52:24 +10001290.Cm password ) .
1291The default is:
1292.Bd -literal -offset indent
1293gssapi-with-mic,hostbased,publickey,
1294keyboard-interactive,password
1295.Ed
Ben Lindstrom9f049032002-06-21 00:59:05 +00001296.It Cm Protocol
1297Specifies the protocol versions
Damien Miller45ee2b92006-03-15 11:56:18 +11001298.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001299should support in order of preference.
1300The possible values are
Damien Miller45ee2b92006-03-15 11:56:18 +11001301.Sq 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001302and
Damien Miller45ee2b92006-03-15 11:56:18 +11001303.Sq 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001304Multiple versions must be comma-separated.
Darren Tuckerbad50762009-10-11 21:51:08 +11001305When this option is set to
Darren Tucker7a4a7652009-10-11 21:51:40 +11001306.Dq 2,1
Darren Tuckerbad50762009-10-11 21:51:08 +11001307.Nm ssh
1308will try version 2 and fall back to version 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001309if version 2 is not available.
Darren Tuckerbad50762009-10-11 21:51:08 +11001310The default is
Darren Tucker7a4a7652009-10-11 21:51:40 +11001311.Sq 2 .
djm@openbsd.orge7901ef2016-02-16 05:11:04 +00001312Protocol 1 suffers from a number of cryptographic weaknesses and should
1313not be used.
1314It is only offered to support legacy devices.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001315.It Cm ProxyCommand
1316Specifies the command to use to connect to the server.
1317The command
Damien Miller079bac22014-07-09 13:06:25 +10001318string extends to the end of the line, and is executed
1319using the user's shell
1320.Ql exec
1321directive to avoid a lingering shell process.
1322.Pp
Damien Millerc4eddee2010-04-18 08:07:43 +10001323In the command string, any occurrence of
Ben Lindstrom9f049032002-06-21 00:59:05 +00001324.Ql %h
1325will be substituted by the host name to
Damien Millerb1b17042010-04-16 15:54:19 +10001326connect,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001327.Ql %p
Damien Millerc4eddee2010-04-18 08:07:43 +10001328by the port, and
1329.Ql %r
Damien Millerb1b17042010-04-16 15:54:19 +10001330by the remote user name.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001331The command can be basically anything,
1332and should read from its standard input and write to its standard output.
1333It should eventually connect an
1334.Xr sshd 8
1335server running on some machine, or execute
1336.Ic sshd -i
1337somewhere.
1338Host key management will be done using the
1339HostName of the host being connected (defaulting to the name typed by
1340the user).
Damien Miller495dca32003-04-01 21:42:14 +10001341Setting the command to
1342.Dq none
Damien Miller9f1e33a2003-02-24 11:57:32 +11001343disables this option entirely.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001344Note that
1345.Cm CheckHostIP
1346is not available for connects with a proxy command.
1347.Pp
Damien Millerebcfedc2005-05-26 12:13:56 +10001348This directive is useful in conjunction with
1349.Xr nc 1
1350and its proxy support.
Damien Millerdfec2942005-05-26 12:14:32 +10001351For example, the following directive would connect via an HTTP proxy at
Damien Millerebcfedc2005-05-26 12:13:56 +10001352192.0.2.0:
1353.Bd -literal -offset 3n
1354ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p
1355.Ed
Damien Miller1262b662013-08-21 02:44:24 +10001356.It Cm ProxyUseFdpass
Damien Millerf2f6c312013-08-21 02:44:58 +10001357Specifies that
Damien Miller1262b662013-08-21 02:44:24 +10001358.Cm ProxyCommand
1359will pass a connected file descriptor back to
Damien Millerf2f6c312013-08-21 02:44:58 +10001360.Xr ssh 1
Damien Miller1262b662013-08-21 02:44:24 +10001361instead of continuing to execute and pass data.
1362The default is
1363.Dq no .
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001364.It Cm PubkeyAcceptedKeyTypes
1365Specifies the key types that will be used for public key authentication
1366as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001367Alternately if the specified value begins with a
1368.Sq +
1369character, then the key types after it will be appended to the default
1370instead of replacing it.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001371The default for this option is:
1372.Bd -literal -offset 3n
1373ecdsa-sha2-nistp256-cert-v01@openssh.com,
1374ecdsa-sha2-nistp384-cert-v01@openssh.com,
1375ecdsa-sha2-nistp521-cert-v01@openssh.com,
1376ssh-ed25519-cert-v01@openssh.com,
1377ssh-rsa-cert-v01@openssh.com,
1378ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +00001379ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001380.Ed
1381.Pp
1382The
1383.Fl Q
1384option of
1385.Xr ssh 1
1386may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001387.It Cm PubkeyAuthentication
1388Specifies whether to try public key authentication.
1389The argument to this keyword must be
1390.Dq yes
1391or
1392.Dq no .
1393The default is
1394.Dq yes .
Darren Tucker62388b22006-01-20 11:31:47 +11001395.It Cm RekeyLimit
1396Specifies the maximum amount of data that may be transmitted before the
Darren Tuckerc53c2af2013-05-16 20:28:16 +10001397session key is renegotiated, optionally followed a maximum amount of
1398time that may pass before the session key is renegotiated.
1399The first argument is specified in bytes and may have a suffix of
Damien Millerddfddf12006-01-31 21:39:03 +11001400.Sq K ,
1401.Sq M ,
Darren Tucker62388b22006-01-20 11:31:47 +11001402or
Damien Millerddfddf12006-01-31 21:39:03 +11001403.Sq G
Darren Tucker62388b22006-01-20 11:31:47 +11001404to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1405The default is between
Damien Miller45ee2b92006-03-15 11:56:18 +11001406.Sq 1G
Darren Tucker62388b22006-01-20 11:31:47 +11001407and
Damien Miller45ee2b92006-03-15 11:56:18 +11001408.Sq 4G ,
Darren Tucker62388b22006-01-20 11:31:47 +11001409depending on the cipher.
Darren Tuckerc53c2af2013-05-16 20:28:16 +10001410The optional second value is specified in seconds and may use any of the
1411units documented in the
Damien Millerfecfd112013-07-18 16:11:50 +10001412TIME FORMATS section of
Darren Tuckerc53c2af2013-05-16 20:28:16 +10001413.Xr sshd_config 5 .
1414The default value for
1415.Cm RekeyLimit
1416is
1417.Dq default none ,
1418which means that rekeying is performed after the cipher's default amount
1419of data has been sent or received and no time based rekeying is done.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001420.It Cm RemoteForward
Damien Millere9d001e2006-01-14 10:10:17 +11001421Specifies that a TCP port on the remote machine be forwarded over
Ben Lindstrom9f049032002-06-21 00:59:05 +00001422the secure channel to the specified host and port from the local machine.
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001423The first argument must be
Damien Millerf91ee4c2005-03-01 21:24:33 +11001424.Sm off
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001425.Oo Ar bind_address : Oc Ar port
Damien Millerf91ee4c2005-03-01 21:24:33 +11001426.Sm on
Darren Tucker5ede2ad2005-03-31 21:31:10 +10001427and the second argument must be
1428.Ar host : Ns Ar hostport .
Damien Miller7fa96602010-08-05 13:03:13 +10001429IPv6 addresses can be specified by enclosing addresses in square brackets.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001430Multiple forwardings may be specified, and additional
1431forwardings can be given on the command line.
Damien Millerde7532e2008-11-03 19:24:45 +11001432Privileged ports can be forwarded only when
1433logging in as root on the remote machine.
Damien Millere379e102009-02-14 16:34:39 +11001434.Pp
Damien Miller85c6d8a2009-02-14 16:34:21 +11001435If the
1436.Ar port
1437argument is
1438.Ql 0 ,
1439the listen port will be dynamically allocated on the server and reported
1440to the client at run time.
Damien Millerf91ee4c2005-03-01 21:24:33 +11001441.Pp
1442If the
1443.Ar bind_address
1444is not specified, the default is to only bind to loopback addresses.
1445If the
1446.Ar bind_address
1447is
1448.Ql *
1449or an empty string, then the forwarding is requested to listen on all
1450interfaces.
1451Specifying a remote
1452.Ar bind_address
Damien Millerf8c55462005-03-02 12:03:05 +11001453will only succeed if the server's
1454.Cm GatewayPorts
Damien Millerf91ee4c2005-03-01 21:24:33 +11001455option is enabled (see
Damien Millerf8c55462005-03-02 12:03:05 +11001456.Xr sshd_config 5 ) .
Damien Miller21771e22011-05-15 08:45:50 +10001457.It Cm RequestTTY
1458Specifies whether to request a pseudo-tty for the session.
1459The argument may be one of:
1460.Dq no
1461(never request a TTY),
1462.Dq yes
1463(always request a TTY when standard input is a TTY),
1464.Dq force
1465(always request a TTY) or
1466.Dq auto
1467(request a TTY when opening a login session).
1468This option mirrors the
1469.Fl t
1470and
1471.Fl T
1472flags for
1473.Xr ssh 1 .
djm@openbsd.org5e39a492014-12-04 02:24:32 +00001474.It Cm RevokedHostKeys
1475Specifies revoked host public keys.
1476Keys listed in this file will be refused for host authentication.
1477Note that if this file does not exist or is not readable,
1478then host authentication will be refused for all hosts.
1479Keys may be specified as a text file, listing one public key per line, or as
1480an OpenSSH Key Revocation List (KRL) as generated by
1481.Xr ssh-keygen 1 .
1482For more information on KRLs, see the KEY REVOCATION LISTS section in
1483.Xr ssh-keygen 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001484.It Cm RhostsRSAAuthentication
1485Specifies whether to try rhosts based authentication with RSA host
1486authentication.
1487The argument must be
1488.Dq yes
1489or
1490.Dq no .
1491The default is
1492.Dq no .
1493This option applies to protocol version 1 only and requires
Damien Miller45ee2b92006-03-15 11:56:18 +11001494.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001495to be setuid root.
1496.It Cm RSAAuthentication
1497Specifies whether to try RSA authentication.
1498The argument to this keyword must be
1499.Dq yes
1500or
1501.Dq no .
1502RSA authentication will only be
1503attempted if the identity file exists, or an authentication agent is
1504running.
1505The default is
1506.Dq yes .
1507Note that this option applies to protocol version 1 only.
Darren Tucker46bc0752004-05-02 22:11:30 +10001508.It Cm SendEnv
1509Specifies what variables from the local
1510.Xr environ 7
1511should be sent to the server.
Damien Miller45ee2b92006-03-15 11:56:18 +11001512The server must also support it, and the server must be configured to
Darren Tucker1e0c9bf2004-05-02 22:12:48 +10001513accept these environment variables.
dtucker@openbsd.org85b96ef2015-04-28 10:17:58 +00001514Note that the
1515.Ev TERM
jmc@openbsd.orgc1d5bcf2015-04-28 13:47:38 +00001516environment variable is always sent whenever a
dtucker@openbsd.org85b96ef2015-04-28 10:17:58 +00001517pseudo-terminal is requested as it is required by the protocol.
Darren Tucker46bc0752004-05-02 22:11:30 +10001518Refer to
1519.Cm AcceptEnv
1520in
1521.Xr sshd_config 5
1522for how to configure the server.
Damien Miller6def5512006-03-15 11:54:05 +11001523Variables are specified by name, which may contain wildcard characters.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +10001524Multiple environment variables may be separated by whitespace or spread
Darren Tucker46bc0752004-05-02 22:11:30 +10001525across multiple
1526.Cm SendEnv
1527directives.
1528The default is not to send any environment variables.
Damien Millerf54a4b92006-03-15 11:54:36 +11001529.Pp
1530See
1531.Sx PATTERNS
1532for more information on patterns.
Damien Miller509b0102003-12-17 16:33:10 +11001533.It Cm ServerAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +11001534Sets the number of server alive messages (see below) which may be
Damien Miller509b0102003-12-17 16:33:10 +11001535sent without
Damien Miller45ee2b92006-03-15 11:56:18 +11001536.Xr ssh 1
Damien Miller509b0102003-12-17 16:33:10 +11001537receiving any messages back from the server.
1538If this threshold is reached while server alive messages are being sent,
Damien Miller45ee2b92006-03-15 11:56:18 +11001539ssh will disconnect from the server, terminating the session.
Damien Miller509b0102003-12-17 16:33:10 +11001540It is important to note that the use of server alive messages is very
1541different from
1542.Cm TCPKeepAlive
1543(below).
1544The server alive messages are sent through the encrypted channel
1545and therefore will not be spoofable.
1546The TCP keepalive option enabled by
1547.Cm TCPKeepAlive
1548is spoofable.
1549The server alive mechanism is valuable when the client or
1550server depend on knowing when a connection has become inactive.
1551.Pp
1552The default value is 3.
1553If, for example,
1554.Cm ServerAliveInterval
Damien Miller45ee2b92006-03-15 11:56:18 +11001555(see below) is set to 15 and
Damien Miller509b0102003-12-17 16:33:10 +11001556.Cm ServerAliveCountMax
Damien Miller45ee2b92006-03-15 11:56:18 +11001557is left at the default, if the server becomes unresponsive,
1558ssh will disconnect after approximately 45 seconds.
Damien Miller957d4e42005-12-13 19:30:45 +11001559.It Cm ServerAliveInterval
1560Sets a timeout interval in seconds after which if no data has been received
1561from the server,
Damien Miller45ee2b92006-03-15 11:56:18 +11001562.Xr ssh 1
Damien Miller957d4e42005-12-13 19:30:45 +11001563will send a message through the encrypted
1564channel to request a response from the server.
1565The default
1566is 0, indicating that these messages will not be sent to the server.
Damien Miller7acefbb2014-07-18 14:11:24 +10001567.It Cm StreamLocalBindMask
1568Sets the octal file creation mode mask
1569.Pq umask
1570used when creating a Unix-domain socket file for local or remote
1571port forwarding.
1572This option is only used for port forwarding to a Unix-domain socket file.
1573.Pp
1574The default value is 0177, which creates a Unix-domain socket file that is
1575readable and writable only by the owner.
1576Note that not all operating systems honor the file mode on Unix-domain
1577socket files.
1578.It Cm StreamLocalBindUnlink
1579Specifies whether to remove an existing Unix-domain socket file for local
1580or remote port forwarding before creating a new one.
1581If the socket file already exists and
1582.Cm StreamLocalBindUnlink
1583is not enabled,
1584.Nm ssh
1585will be unable to forward the port to the Unix-domain socket file.
1586This option is only used for port forwarding to a Unix-domain socket file.
1587.Pp
1588The argument must be
1589.Dq yes
1590or
1591.Dq no .
1592The default is
1593.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001594.It Cm StrictHostKeyChecking
1595If this flag is set to
1596.Dq yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +11001597.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001598will never automatically add host keys to the
Damien Miller167ea5d2005-05-26 12:04:02 +10001599.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +00001600file, and refuses to connect to hosts whose host key has changed.
1601This provides maximum protection against trojan horse attacks,
Damien Miller45ee2b92006-03-15 11:56:18 +11001602though it can be annoying when the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001603.Pa /etc/ssh/ssh_known_hosts
Damien Miller45ee2b92006-03-15 11:56:18 +11001604file is poorly maintained or when connections to new hosts are
Ben Lindstrom9f049032002-06-21 00:59:05 +00001605frequently made.
1606This option forces the user to manually
1607add all new hosts.
1608If this flag is set to
1609.Dq no ,
Damien Miller45ee2b92006-03-15 11:56:18 +11001610ssh will automatically add new host keys to the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001611user known hosts files.
1612If this flag is set to
1613.Dq ask ,
1614new host keys
1615will be added to the user known host files only after the user
1616has confirmed that is what they really want to do, and
Damien Miller45ee2b92006-03-15 11:56:18 +11001617ssh will refuse to connect to hosts whose host key has changed.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001618The host keys of
1619known hosts will be verified automatically in all cases.
1620The argument must be
1621.Dq yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +11001622.Dq no ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001623or
1624.Dq ask .
1625The default is
1626.Dq ask .
Damien Miller12c150e2003-12-17 16:31:10 +11001627.It Cm TCPKeepAlive
1628Specifies whether the system should send TCP keepalive messages to the
1629other side.
1630If they are sent, death of the connection or crash of one
1631of the machines will be properly noticed.
1632However, this means that
1633connections will die if the route is down temporarily, and some people
1634find it annoying.
1635.Pp
1636The default is
1637.Dq yes
1638(to send TCP keepalive messages), and the client will notice
1639if the network goes down or the remote host dies.
1640This is important in scripts, and many users want it too.
1641.Pp
1642To disable TCP keepalive messages, the value should be set to
1643.Dq no .
Damien Millerd27b9472005-12-13 19:29:02 +11001644.It Cm Tunnel
Damien Miller991dba42006-07-10 20:16:27 +10001645Request
Damien Millerd27b9472005-12-13 19:29:02 +11001646.Xr tun 4
Damien Miller7746c392005-12-13 19:33:37 +11001647device forwarding between the client and the server.
Damien Millerd27b9472005-12-13 19:29:02 +11001648The argument must be
Damien Miller7b58e802005-12-13 19:33:19 +11001649.Dq yes ,
Damien Miller991dba42006-07-10 20:16:27 +10001650.Dq point-to-point
1651(layer 3),
1652.Dq ethernet
1653(layer 2),
Damien Millerd27b9472005-12-13 19:29:02 +11001654or
1655.Dq no .
Damien Miller991dba42006-07-10 20:16:27 +10001656Specifying
1657.Dq yes
1658requests the default tunnel mode, which is
1659.Dq point-to-point .
Damien Millerd27b9472005-12-13 19:29:02 +11001660The default is
1661.Dq no .
1662.It Cm TunnelDevice
Damien Miller991dba42006-07-10 20:16:27 +10001663Specifies the
Damien Millerd27b9472005-12-13 19:29:02 +11001664.Xr tun 4
Damien Miller991dba42006-07-10 20:16:27 +10001665devices to open on the client
1666.Pq Ar local_tun
1667and the server
1668.Pq Ar remote_tun .
1669.Pp
1670The argument must be
1671.Sm off
1672.Ar local_tun Op : Ar remote_tun .
1673.Sm on
1674The devices may be specified by numerical ID or the keyword
1675.Dq any ,
1676which uses the next available tunnel device.
1677If
1678.Ar remote_tun
1679is not specified, it defaults to
1680.Dq any .
1681The default is
1682.Dq any:any .
djm@openbsd.org1d1092b2015-01-26 12:16:36 +00001683.It Cm UpdateHostKeys
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001684Specifies whether
1685.Xr ssh 1
1686should accept notifications of additional hostkeys from the server sent
1687after authentication has completed and add them to
1688.Cm UserKnownHostsFile .
1689The argument must be
djm@openbsd.org523463a2015-02-16 22:13:32 +00001690.Dq yes ,
djm@openbsd.org15ad7502015-02-02 07:41:40 +00001691.Dq no
djm@openbsd.org523463a2015-02-16 22:13:32 +00001692(the default) or
1693.Dq ask .
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001694Enabling this option allows learning alternate hostkeys for a server
djm@openbsd.org1d1092b2015-01-26 12:16:36 +00001695and supports graceful key rotation by allowing a server to send replacement
1696public keys before old ones are removed.
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001697Additional hostkeys are only accepted if the key used to authenticate the
sobrado@openbsd.orge3cbb062015-09-22 08:33:23 +00001698host was already trusted or explicitly accepted by the user.
djm@openbsd.org523463a2015-02-16 22:13:32 +00001699If
1700.Cm UpdateHostKeys
1701is set to
1702.Dq ask ,
1703then the user is asked to confirm the modifications to the known_hosts file.
djm@openbsd.org44732de2015-02-20 22:17:21 +00001704Confirmation is currently incompatible with
1705.Cm ControlPersist ,
1706and will be disabled if it is enabled.
djm@openbsd.org8d4f8722015-01-26 03:04:45 +00001707.Pp
1708Presently, only
1709.Xr sshd 8
1710from OpenSSH 6.8 and greater support the
1711.Dq hostkeys@openssh.com
1712protocol extension used to inform the client of all the server's hostkeys.
Damien Millere8cd7412005-12-24 14:55:47 +11001713.It Cm UsePrivilegedPort
1714Specifies whether to use a privileged port for outgoing connections.
1715The argument must be
1716.Dq yes
1717or
1718.Dq no .
1719The default is
1720.Dq no .
1721If set to
Damien Miller45ee2b92006-03-15 11:56:18 +11001722.Dq yes ,
1723.Xr ssh 1
Damien Millere8cd7412005-12-24 14:55:47 +11001724must be setuid root.
1725Note that this option must be set to
1726.Dq yes
1727for
1728.Cm RhostsRSAAuthentication
1729with older servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001730.It Cm User
1731Specifies the user to log in as.
1732This can be useful when a different user name is used on different machines.
1733This saves the trouble of
1734having to remember to give the user name on the command line.
1735.It Cm UserKnownHostsFile
Damien Miller295ee632011-05-29 21:42:31 +10001736Specifies one or more files to use for the user
1737host key database, separated by whitespace.
1738The default is
1739.Pa ~/.ssh/known_hosts ,
1740.Pa ~/.ssh/known_hosts2 .
Damien Miller37876e92003-05-15 10:19:46 +10001741.It Cm VerifyHostKeyDNS
1742Specifies whether to verify the remote key using DNS and SSHFP resource
1743records.
Damien Miller150b5572003-11-17 21:19:29 +11001744If this option is set to
1745.Dq yes ,
Damien Millerfe448472003-11-17 21:19:49 +11001746the client will implicitly trust keys that match a secure fingerprint
Damien Miller150b5572003-11-17 21:19:29 +11001747from DNS.
1748Insecure fingerprints will be handled as if this option was set to
1749.Dq ask .
1750If this option is set to
1751.Dq ask ,
1752information on fingerprint match will be displayed, but the user will still
1753need to confirm new host keys according to the
1754.Cm StrictHostKeyChecking
1755option.
1756The argument must be
1757.Dq yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +11001758.Dq no ,
Damien Millerfe448472003-11-17 21:19:49 +11001759or
1760.Dq ask .
Damien Miller37876e92003-05-15 10:19:46 +10001761The default is
1762.Dq no .
Damien Miller45ee2b92006-03-15 11:56:18 +11001763.Pp
Damien Millerfecfd112013-07-18 16:11:50 +10001764See also VERIFYING HOST KEYS in
Damien Miller45ee2b92006-03-15 11:56:18 +11001765.Xr ssh 1 .
Damien Miller10288242008-06-30 00:04:03 +10001766.It Cm VisualHostKey
1767If this flag is set to
1768.Dq yes ,
1769an ASCII art representation of the remote host key fingerprint is
djm@openbsd.orgb79efde2014-12-21 23:12:42 +00001770printed in addition to the fingerprint string at login and
Damien Millera414cd32008-11-03 19:25:21 +11001771for unknown host keys.
Damien Miller10288242008-06-30 00:04:03 +10001772If this flag is set to
1773.Dq no ,
Damien Millera414cd32008-11-03 19:25:21 +11001774no fingerprint strings are printed at login and
djm@openbsd.orgb79efde2014-12-21 23:12:42 +00001775only the fingerprint string will be printed for unknown host keys.
Damien Miller10288242008-06-30 00:04:03 +10001776The default is
1777.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001778.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001779Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001780.Xr xauth 1
1781program.
1782The default is
1783.Pa /usr/X11R6/bin/xauth .
1784.El
Damien Millerb5282c22006-03-15 11:59:08 +11001785.Sh PATTERNS
1786A
1787.Em pattern
1788consists of zero or more non-whitespace characters,
1789.Sq *
1790(a wildcard that matches zero or more characters),
1791or
1792.Sq ?\&
1793(a wildcard that matches exactly one character).
1794For example, to specify a set of declarations for any host in the
1795.Dq .co.uk
1796set of domains,
1797the following pattern could be used:
1798.Pp
1799.Dl Host *.co.uk
1800.Pp
1801The following pattern
1802would match any host in the 192.168.0.[0-9] network range:
1803.Pp
1804.Dl Host 192.168.0.?
1805.Pp
1806A
1807.Em pattern-list
1808is a comma-separated list of patterns.
1809Patterns within pattern-lists may be negated
1810by preceding them with an exclamation mark
1811.Pq Sq !\& .
1812For example,
Damien Miller51682fa2013-10-17 11:48:31 +11001813to allow a key to be used from anywhere within an organization
Damien Millerb5282c22006-03-15 11:59:08 +11001814except from the
1815.Dq dialup
1816pool,
1817the following entry (in authorized_keys) could be used:
1818.Pp
1819.Dl from=\&"!*.dialup.example.com,*.example.com\&"
Ben Lindstrom9f049032002-06-21 00:59:05 +00001820.Sh FILES
1821.Bl -tag -width Ds
Damien Miller167ea5d2005-05-26 12:04:02 +10001822.It Pa ~/.ssh/config
Ben Lindstrom9f049032002-06-21 00:59:05 +00001823This is the per-user configuration file.
1824The format of this file is described above.
Damien Miller45ee2b92006-03-15 11:56:18 +11001825This file is used by the SSH client.
Damien Millerc970cb92004-04-20 20:12:53 +10001826Because of the potential for abuse, this file must have strict permissions:
1827read/write for the user, and not accessible by others.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001828.It Pa /etc/ssh/ssh_config
1829Systemwide configuration file.
1830This file provides defaults for those
1831values that are not specified in the user's configuration file, and
1832for those users who do not have a configuration file.
1833This file must be world-readable.
1834.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001835.Sh SEE ALSO
1836.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001837.Sh AUTHORS
1838OpenSSH is a derivative of the original and free
1839ssh 1.2.12 release by Tatu Ylonen.
1840Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1841Theo de Raadt and Dug Song
1842removed many bugs, re-added newer features and
1843created OpenSSH.
1844Markus Friedl contributed the support for SSH
1845protocol versions 1.5 and 2.0.