blob: d3e801df0da6d161665877bbaf89eb6bfdf26638 [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.\"
Darren Tucker427e4092012-10-05 11:02:39 +100036.\" $OpenBSD: ssh_config.5,v 1.158 2012/10/04 13:21:50 markus Exp $
37.Dd $Mdocdate: October 4 2012 $
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.
68The matched host name is the one given on the command line.
69.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
74The configuration file has the following format:
75.Pp
76Empty lines and lines starting with
77.Ql #
78are comments.
Ben Lindstrom9f049032002-06-21 00:59:05 +000079Otherwise a line is of the format
80.Dq keyword arguments .
81Configuration 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.
Damien Miller306d1182006-03-15 12:05:59 +110092Arguments may optionally be enclosed in double quotes
93.Pq \&"
94in order to represent arguments containing spaces.
Ben Lindstrom9f049032002-06-21 00:59:05 +000095.Pp
96The possible
97keywords and their meanings are as follows (note that
98keywords are case-insensitive and arguments are case-sensitive):
99.Bl -tag -width Ds
100.It Cm Host
101Restricts the following declarations (up to the next
102.Cm Host
103keyword) to be only for those hosts that match one of the patterns
104given after the keyword.
Damien Millerfa51b162008-11-03 19:17:33 +1100105If more than one pattern is provided, they should be separated by whitespace.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000106A single
Damien Miller208f1ed2006-03-15 11:56:03 +1100107.Ql *
Ben Lindstrom9f049032002-06-21 00:59:05 +0000108as a pattern can be used to provide global
109defaults for all hosts.
110The host is the
111.Ar hostname
Damien Miller208f1ed2006-03-15 11:56:03 +1100112argument given on the command line (i.e. the name is not converted to
Ben Lindstrom9f049032002-06-21 00:59:05 +0000113a canonicalized host name before matching).
Damien Millerf54a4b92006-03-15 11:54:36 +1100114.Pp
Damien Millerfe924212011-05-15 08:44:45 +1000115A pattern entry may be negated by prefixing it with an exclamation mark
116.Pq Sq !\& .
117If a negated entry is matched, then the
118.Cm Host
119entry is ignored, regardless of whether any other patterns on the line
120match.
121Negated matches are therefore useful to provide exceptions for wildcard
122matches.
123.Pp
Damien Millerf54a4b92006-03-15 11:54:36 +1100124See
125.Sx PATTERNS
126for more information on patterns.
Damien Miller20a8f972003-05-18 20:50:30 +1000127.It Cm AddressFamily
Damien Millerfbf486b2003-05-23 18:44:23 +1000128Specifies which address family to use when connecting.
129Valid arguments are
Damien Miller20a8f972003-05-18 20:50:30 +1000130.Dq any ,
131.Dq inet
Damien Miller45ee2b92006-03-15 11:56:18 +1100132(use IPv4 only), or
Damien Miller20a8f972003-05-18 20:50:30 +1000133.Dq inet6
Darren Tucker79a7acf2005-02-09 09:48:57 +1100134(use IPv6 only).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000135.It Cm BatchMode
136If set to
137.Dq yes ,
138passphrase/password querying will be disabled.
139This option is useful in scripts and other batch jobs where no user
140is present to supply the password.
141The argument must be
142.Dq yes
143or
144.Dq no .
145The default is
146.Dq no .
147.It Cm BindAddress
Darren Tucker89f4d472005-07-14 17:06:21 +1000148Use the specified address on the local machine as the source address of
Darren Tucker6c71d202005-07-14 17:06:50 +1000149the connection.
150Only useful on systems with more than one address.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000151Note that this option does not work if
152.Cm UsePrivilegedPort
153is set to
154.Dq yes .
155.It Cm ChallengeResponseAuthentication
Damien Miller1faa7132006-03-15 11:55:31 +1100156Specifies whether to use challenge-response authentication.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000157The argument to this keyword must be
158.Dq yes
159or
160.Dq no .
161The default is
162.Dq yes .
163.It Cm CheckHostIP
164If this flag is set to
165.Dq yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +1100166.Xr ssh 1
167will additionally check the host IP address in the
Ben Lindstrom9f049032002-06-21 00:59:05 +0000168.Pa known_hosts
169file.
170This allows ssh to detect if a host key changed due to DNS spoofing.
171If the option is set to
172.Dq no ,
173the check will not be executed.
174The default is
175.Dq yes .
176.It Cm Cipher
177Specifies the cipher to use for encrypting the session
178in protocol version 1.
179Currently,
180.Dq blowfish ,
181.Dq 3des ,
182and
183.Dq des
184are supported.
185.Ar des
186is only supported in the
Damien Miller45ee2b92006-03-15 11:56:18 +1100187.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000188client for interoperability with legacy protocol 1 implementations
189that do not support the
190.Ar 3des
Damien Miller495dca32003-04-01 21:42:14 +1000191cipher.
192Its use is strongly discouraged due to cryptographic weaknesses.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000193The default is
194.Dq 3des .
195.It Cm Ciphers
196Specifies the ciphers allowed for protocol version 2
197in order of preference.
198Multiple ciphers must be comma-separated.
Damien Miller05202ff2004-06-15 10:30:39 +1000199The supported ciphers are
200.Dq 3des-cbc ,
201.Dq aes128-cbc ,
202.Dq aes192-cbc ,
203.Dq aes256-cbc ,
204.Dq aes128-ctr ,
205.Dq aes192-ctr ,
206.Dq aes256-ctr ,
Damien Miller3710f272005-05-26 12:19:17 +1000207.Dq arcfour128 ,
208.Dq arcfour256 ,
Damien Miller05202ff2004-06-15 10:30:39 +1000209.Dq arcfour ,
210.Dq blowfish-cbc ,
211and
212.Dq cast128-cbc .
Damien Miller45ee2b92006-03-15 11:56:18 +1100213The default is:
214.Bd -literal -offset 3n
Damien Miller9aa72ba2009-01-28 16:34:00 +1100215aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,
216aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,
217aes256-cbc,arcfour
Ben Lindstrom9f049032002-06-21 00:59:05 +0000218.Ed
219.It Cm ClearAllForwardings
Damien Miller45ee2b92006-03-15 11:56:18 +1100220Specifies that all local, remote, and dynamic port forwardings
Ben Lindstrom9f049032002-06-21 00:59:05 +0000221specified in the configuration files or on the command line be
Damien Miller495dca32003-04-01 21:42:14 +1000222cleared.
223This option is primarily useful when used from the
Damien Miller45ee2b92006-03-15 11:56:18 +1100224.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000225command line to clear port forwardings set in
226configuration files, and is automatically set by
227.Xr scp 1
228and
229.Xr sftp 1 .
230The argument must be
231.Dq yes
232or
233.Dq no .
234The default is
235.Dq no .
236.It Cm Compression
237Specifies whether to use compression.
238The argument must be
239.Dq yes
240or
241.Dq no .
242The default is
243.Dq no .
244.It Cm CompressionLevel
245Specifies the compression level to use if compression is enabled.
246The argument must be an integer from 1 (fast) to 9 (slow, best).
247The default level is 6, which is good for most applications.
248The meaning of the values is the same as in
249.Xr gzip 1 .
250Note that this option applies to protocol version 1 only.
251.It Cm ConnectionAttempts
252Specifies the number of tries (one per second) to make before exiting.
253The argument must be an integer.
254This may be useful in scripts if the connection sometimes fails.
255The default is 1.
Damien Millerb78d5eb2003-05-16 11:39:04 +1000256.It Cm ConnectTimeout
Damien Miller45ee2b92006-03-15 11:56:18 +1100257Specifies the timeout (in seconds) used when connecting to the
258SSH server, instead of using the default system TCP timeout.
Damien Millerfbf486b2003-05-23 18:44:23 +1000259This value is used only when the target is down or really unreachable,
260not when it refuses the connection.
Damien Miller0e220db2004-06-15 10:34:08 +1000261.It Cm ControlMaster
262Enables the sharing of multiple sessions over a single network connection.
263When set to
Damien Miller45ee2b92006-03-15 11:56:18 +1100264.Dq yes ,
265.Xr ssh 1
Damien Miller0e220db2004-06-15 10:34:08 +1000266will listen for connections on a control socket specified using the
267.Cm ControlPath
268argument.
269Additional sessions can connect to this socket using the same
270.Cm ControlPath
271with
272.Cm ControlMaster
273set to
274.Dq no
Damien Miller2234bac2004-06-30 22:38:52 +1000275(the default).
Damien Miller713de762005-11-05 15:13:49 +1100276These sessions will try to reuse the master instance's network connection
Damien Millerb3bfbb72005-11-05 15:11:48 +1100277rather than initiating new ones, but will fall back to connecting normally
278if the control socket does not exist, or is not listening.
279.Pp
Damien Miller23f07702004-06-18 01:19:03 +1000280Setting this to
281.Dq ask
Damien Miller45ee2b92006-03-15 11:56:18 +1100282will cause ssh
Damien Miller23f07702004-06-18 01:19:03 +1000283to listen for control connections, but require confirmation using the
284.Ev SSH_ASKPASS
285program before they are accepted (see
286.Xr ssh-add 1
Damien Miller2234bac2004-06-30 22:38:52 +1000287for details).
Damien Millerdadfd4d2005-05-26 12:07:13 +1000288If the
289.Cm ControlPath
Damien Miller45ee2b92006-03-15 11:56:18 +1100290cannot be opened,
291ssh will continue without connecting to a master instance.
Damien Millerd14b1e72005-06-16 13:19:41 +1000292.Pp
Damien Miller13390022005-07-06 09:44:19 +1000293X11 and
Damien Millerfd94fba2005-07-06 09:44:59 +1000294.Xr ssh-agent 1
Damien Miller13390022005-07-06 09:44:19 +1000295forwarding is supported over these multiplexed connections, however the
Darren Tucker63551872005-12-20 16:14:15 +1100296display and agent forwarded will be the one belonging to the master
Damien Millerfd94fba2005-07-06 09:44:59 +1000297connection i.e. it is not possible to forward multiple displays or agents.
Damien Miller13390022005-07-06 09:44:19 +1000298.Pp
Damien Millerd14b1e72005-06-16 13:19:41 +1000299Two additional options allow for opportunistic multiplexing: try to use a
300master connection but fall back to creating a new one if one does not already
301exist.
302These options are:
303.Dq auto
304and
305.Dq autoask .
306The latter requires confirmation like the
307.Dq ask
308option.
Damien Miller0e220db2004-06-15 10:34:08 +1000309.It Cm ControlPath
Damien Miller6476cad2005-06-16 13:18:34 +1000310Specify the path to the control socket used for connection sharing as described
311in the
Damien Miller0e220db2004-06-15 10:34:08 +1000312.Cm ControlMaster
Damien Miller8f74c8f2005-06-26 08:56:03 +1000313section above or the string
314.Dq none
315to disable connection sharing.
Damien Miller6476cad2005-06-16 13:18:34 +1000316In the path,
Damien Millerdfc85fa2011-05-15 08:44:02 +1000317.Ql %L
318will be substituted by the first component of the local host name,
Damien Miller3ec54c72006-03-15 11:30:13 +1100319.Ql %l
Damien Millerdfc85fa2011-05-15 08:44:02 +1000320will be substituted by the local host name (including any domain name),
Damien Miller6476cad2005-06-16 13:18:34 +1000321.Ql %h
322will be substituted by the target host name,
Damien Miller486dd2e2011-05-15 08:47:18 +1000323.Ql %n
324will be substituted by the original target host name
325specified on the command line,
Damien Miller6476cad2005-06-16 13:18:34 +1000326.Ql %p
Damien Millerdfc85fa2011-05-15 08:44:02 +1000327the port,
Damien Miller6476cad2005-06-16 13:18:34 +1000328.Ql %r
Damien Millerdfc85fa2011-05-15 08:44:02 +1000329by the remote login username, and
330.Ql %u
331by the username of the user running
332.Xr ssh 1 .
Damien Millerd14b1e72005-06-16 13:19:41 +1000333It is recommended that any
334.Cm ControlPath
335used for opportunistic connection sharing include
Damien Miller20c2ec42006-03-15 11:31:01 +1100336at least %h, %p, and %r.
Damien Millerd14b1e72005-06-16 13:19:41 +1000337This ensures that shared connections are uniquely identified.
Damien Millere11e1ea2010-08-03 16:04:46 +1000338.It Cm ControlPersist
339When used in conjunction with
340.Cm ControlMaster ,
341specifies that the master connection should remain open
342in the background (waiting for future client connections)
343after the initial client connection has been closed.
344If set to
345.Dq no ,
346then the master connection will not be placed into the background,
347and will close as soon as the initial client connection is closed.
348If set to
349.Dq yes ,
350then the master connection will remain in the background indefinitely
351(until killed or closed via a mechanism such as the
352.Xr ssh 1
353.Dq Fl O No exit
354option).
355If set to a time in seconds, or a time in any of the formats documented in
356.Xr sshd_config 5 ,
357then the backgrounded master connection will automatically terminate
358after it has remained idle (with no client connections) for the
359specified time.
Damien Miller2234bac2004-06-30 22:38:52 +1000360.It Cm DynamicForward
Damien Millere9d001e2006-01-14 10:10:17 +1100361Specifies that a TCP port on the local machine be forwarded
Damien Miller2234bac2004-06-30 22:38:52 +1000362over the secure channel, and the application
363protocol is then used to determine where to connect to from the
364remote machine.
Darren Tuckerc8d64212005-10-03 18:13:42 +1000365.Pp
366The argument must be
367.Sm off
368.Oo Ar bind_address : Oc Ar port .
369.Sm on
Damien Miller7fa96602010-08-05 13:03:13 +1000370IPv6 addresses can be specified by enclosing addresses in square brackets.
Darren Tuckerc8d64212005-10-03 18:13:42 +1000371By default, the local port is bound in accordance with the
372.Cm GatewayPorts
373setting.
374However, an explicit
375.Ar bind_address
376may be used to bind the connection to a specific address.
377The
378.Ar bind_address
379of
380.Dq localhost
381indicates that the listening port be bound for local use only, while an
382empty address or
383.Sq *
384indicates that the port should be available from all interfaces.
385.Pp
Damien Miller2234bac2004-06-30 22:38:52 +1000386Currently the SOCKS4 and SOCKS5 protocols are supported, and
Damien Miller45ee2b92006-03-15 11:56:18 +1100387.Xr ssh 1
Damien Miller2234bac2004-06-30 22:38:52 +1000388will act as a SOCKS server.
389Multiple forwardings may be specified, and
390additional forwardings can be given on the command line.
391Only the superuser can forward privileged ports.
Darren Tucker674f71d2003-06-28 12:33:12 +1000392.It Cm EnableSSHKeysign
393Setting this option to
394.Dq yes
395in the global client configuration file
396.Pa /etc/ssh/ssh_config
397enables the use of the helper program
398.Xr ssh-keysign 8
399during
400.Cm HostbasedAuthentication .
401The argument must be
402.Dq yes
403or
404.Dq no .
405The default is
406.Dq no .
Darren Tuckerf132c672003-10-15 15:58:18 +1000407This option should be placed in the non-hostspecific section.
Darren Tucker674f71d2003-06-28 12:33:12 +1000408See
409.Xr ssh-keysign 8
410for more information.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000411.It Cm EscapeChar
412Sets the escape character (default:
413.Ql ~ ) .
414The escape character can also
415be set on the command line.
416The argument should be a single character,
417.Ql ^
418followed by a letter, or
419.Dq none
420to disable the escape
421character entirely (making the connection transparent for binary
422data).
Darren Tuckere7d4b192006-07-12 22:17:10 +1000423.It Cm ExitOnForwardFailure
424Specifies whether
425.Xr ssh 1
426should terminate the connection if it cannot set up all requested
Darren Tuckerfc5d1882007-08-15 22:20:22 +1000427dynamic, tunnel, local, and remote port forwardings.
Darren Tuckere7d4b192006-07-12 22:17:10 +1000428The argument must be
429.Dq yes
430or
431.Dq no .
432The default is
433.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000434.It Cm ForwardAgent
435Specifies whether the connection to the authentication agent (if any)
436will be forwarded to the remote machine.
437The argument must be
438.Dq yes
439or
440.Dq no .
441The default is
442.Dq no .
Damien Milleraf653042002-09-04 16:40:37 +1000443.Pp
Damien Miller495dca32003-04-01 21:42:14 +1000444Agent forwarding should be enabled with caution.
445Users with the ability to bypass file permissions on the remote host
446(for the agent's Unix-domain socket)
447can access the local agent through the forwarded connection.
448An attacker cannot obtain key material from the agent,
Damien Milleraf653042002-09-04 16:40:37 +1000449however they can perform operations on the keys that enable them to
450authenticate using the identities loaded into the agent.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000451.It Cm ForwardX11
452Specifies whether X11 connections will be automatically redirected
453over the secure channel and
454.Ev DISPLAY
455set.
456The argument must be
457.Dq yes
458or
459.Dq no .
460The default is
461.Dq no .
Damien Milleraf653042002-09-04 16:40:37 +1000462.Pp
Damien Miller495dca32003-04-01 21:42:14 +1000463X11 forwarding should be enabled with caution.
464Users with the ability to bypass file permissions on the remote host
Darren Tucker0a118da2003-10-15 15:54:32 +1000465(for the user's X11 authorization database)
Damien Miller495dca32003-04-01 21:42:14 +1000466can access the local X11 display through the forwarded connection.
Darren Tucker0a118da2003-10-15 15:54:32 +1000467An attacker may then be able to perform activities such as keystroke monitoring
468if the
469.Cm ForwardX11Trusted
470option is also enabled.
Damien Miller1ab6a512010-06-26 10:02:24 +1000471.It Cm ForwardX11Timeout
Damien Millercede1db2010-07-02 13:33:48 +1000472Specify a timeout for untrusted X11 forwarding
473using the format described in the
Damien Miller1ab6a512010-06-26 10:02:24 +1000474.Sx TIME FORMATS
475section of
476.Xr sshd_config 5 .
477X11 connections received by
478.Xr ssh 1
479after this time will be refused.
480The default is to disable untrusted X11 forwarding after twenty minutes has
481elapsed.
Darren Tucker0a118da2003-10-15 15:54:32 +1000482.It Cm ForwardX11Trusted
Darren Tuckerdcf6ec42004-05-13 13:03:56 +1000483If this option is set to
Damien Miller45ee2b92006-03-15 11:56:18 +1100484.Dq yes ,
485remote X11 clients will have full access to the original X11 display.
Damien Miller1717fd42005-03-01 21:17:31 +1100486.Pp
Darren Tucker0a118da2003-10-15 15:54:32 +1000487If this option is set to
Damien Miller45ee2b92006-03-15 11:56:18 +1100488.Dq no ,
489remote X11 clients will be considered untrusted and prevented
Darren Tucker0a118da2003-10-15 15:54:32 +1000490from stealing or tampering with data belonging to trusted X11
491clients.
Damien Miller1717fd42005-03-01 21:17:31 +1100492Furthermore, the
493.Xr xauth 1
494token used for the session will be set to expire after 20 minutes.
495Remote clients will be refused access after this time.
Darren Tucker0a118da2003-10-15 15:54:32 +1000496.Pp
497The default is
498.Dq no .
499.Pp
500See the X11 SECURITY extension specification for full details on
501the restrictions imposed on untrusted clients.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000502.It Cm GatewayPorts
503Specifies whether remote hosts are allowed to connect to local
504forwarded ports.
505By default,
Damien Miller45ee2b92006-03-15 11:56:18 +1100506.Xr ssh 1
Damien Miller495dca32003-04-01 21:42:14 +1000507binds local port forwardings to the loopback address.
508This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000509.Cm GatewayPorts
Damien Miller45ee2b92006-03-15 11:56:18 +1100510can be used to specify that ssh
Ben Lindstrom9f049032002-06-21 00:59:05 +0000511should bind local port forwardings to the wildcard address,
512thus allowing remote hosts to connect to forwarded ports.
513The argument must be
514.Dq yes
515or
516.Dq no .
517The default is
518.Dq no .
519.It Cm GlobalKnownHostsFile
Damien Miller295ee632011-05-29 21:42:31 +1000520Specifies one or more files to use for the global
521host key database, separated by whitespace.
522The default is
523.Pa /etc/ssh/ssh_known_hosts ,
524.Pa /etc/ssh/ssh_known_hosts2 .
Darren Tucker0efd1552003-08-26 11:49:55 +1000525.It Cm GSSAPIAuthentication
Damien Millerbaafb982003-12-17 16:32:23 +1100526Specifies whether user authentication based on GSSAPI is allowed.
Damien Millerc2b98272003-09-03 12:13:30 +1000527The default is
Darren Tuckera044f472003-10-15 15:52:03 +1000528.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000529Note that this option applies to protocol version 2 only.
530.It Cm GSSAPIDelegateCredentials
531Forward (delegate) credentials to the server.
532The default is
533.Dq no .
534Note that this option applies to protocol version 2 only.
Damien Millere1776152005-03-01 21:47:37 +1100535.It Cm HashKnownHosts
536Indicates that
Damien Miller45ee2b92006-03-15 11:56:18 +1100537.Xr ssh 1
Damien Millere1776152005-03-01 21:47:37 +1100538should hash host names and addresses when they are added to
Damien Miller167ea5d2005-05-26 12:04:02 +1000539.Pa ~/.ssh/known_hosts .
Damien Millere1776152005-03-01 21:47:37 +1100540These hashed names may be used normally by
Damien Miller45ee2b92006-03-15 11:56:18 +1100541.Xr ssh 1
Damien Millere1776152005-03-01 21:47:37 +1100542and
Damien Miller45ee2b92006-03-15 11:56:18 +1100543.Xr sshd 8 ,
Damien Millere1776152005-03-01 21:47:37 +1100544but they do not reveal identifying information should the file's contents
545be disclosed.
546The default is
547.Dq no .
Damien Miller858bb7d2006-08-05 11:34:51 +1000548Note that existing names and addresses in known hosts files
549will not be converted automatically,
550but may be manually hashed using
Damien Miller4b42d7f2005-03-01 21:48:35 +1100551.Xr ssh-keygen 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000552.It Cm HostbasedAuthentication
553Specifies whether to try rhosts based authentication with public key
554authentication.
555The argument must be
556.Dq yes
557or
558.Dq no .
559The default is
560.Dq no .
561This option applies to protocol version 2 only and
562is similar to
563.Cm RhostsRSAAuthentication .
564.It Cm HostKeyAlgorithms
565Specifies the protocol version 2 host key algorithms
566that the client wants to use in order of preference.
567The default for this option is:
Damien Millereb8b60e2010-08-31 22:41:14 +1000568.Bd -literal -offset 3n
569ecdsa-sha2-nistp256-cert-v01@openssh.com,
570ecdsa-sha2-nistp384-cert-v01@openssh.com,
571ecdsa-sha2-nistp521-cert-v01@openssh.com,
572ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,
573ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,
574ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
575ssh-rsa,ssh-dss
576.Ed
Damien Millerd925dcd2010-12-01 12:21:51 +1100577.Pp
578If hostkeys are known for the destination host then this default is modified
579to prefer their algorithms.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000580.It Cm HostKeyAlias
581Specifies an alias that should be used instead of the
582real host name when looking up or saving the host key
583in the host key database files.
Damien Miller45ee2b92006-03-15 11:56:18 +1100584This option is useful for tunneling SSH connections
Ben Lindstrom9f049032002-06-21 00:59:05 +0000585or for multiple servers running on a single host.
586.It Cm HostName
587Specifies the real host name to log into.
588This can be used to specify nicknames or abbreviations for hosts.
Damien Millerd0244d42010-07-16 13:56:43 +1000589If the hostname contains the character sequence
590.Ql %h ,
Damien Miller486dd2e2011-05-15 08:47:18 +1000591then this will be replaced with the host name specified on the command line
Damien Millerd0244d42010-07-16 13:56:43 +1000592(this is useful for manipulating unqualified names).
Damien Miller45ee2b92006-03-15 11:56:18 +1100593The default is the name given on the command line.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000594Numeric IP addresses are also permitted (both on the command line and in
595.Cm HostName
596specifications).
Damien Millerbd394c32004-03-08 23:12:36 +1100597.It Cm IdentitiesOnly
598Specifies that
Damien Miller45ee2b92006-03-15 11:56:18 +1100599.Xr ssh 1
Damien Millerbd394c32004-03-08 23:12:36 +1100600should only use the authentication identity files configured in the
Damien Miller1a812582004-04-20 20:13:32 +1000601.Nm
Damien Millerbd394c32004-03-08 23:12:36 +1100602files,
Damien Miller45ee2b92006-03-15 11:56:18 +1100603even if
604.Xr ssh-agent 1
Damien Millerbd394c32004-03-08 23:12:36 +1100605offers more identities.
606The argument to this keyword must be
607.Dq yes
608or
609.Dq no .
Damien Miller45ee2b92006-03-15 11:56:18 +1100610This option is intended for situations where ssh-agent
Damien Millerbd394c32004-03-08 23:12:36 +1100611offers many different identities.
612The default is
613.Dq no .
Damien Miller957d4e42005-12-13 19:30:45 +1100614.It Cm IdentityFile
Damien Miller71924332012-06-20 21:52:38 +1000615Specifies a file from which the user's DSA, ECDSA or RSA authentication
Damien Millereb8b60e2010-08-31 22:41:14 +1000616identity is read.
Damien Miller957d4e42005-12-13 19:30:45 +1100617The default is
618.Pa ~/.ssh/identity
619for protocol version 1, and
Damien Millereb8b60e2010-08-31 22:41:14 +1000620.Pa ~/.ssh/id_dsa ,
621.Pa ~/.ssh/id_ecdsa
Damien Miller957d4e42005-12-13 19:30:45 +1100622and
Damien Millereb8b60e2010-08-31 22:41:14 +1000623.Pa ~/.ssh/id_rsa
Damien Miller957d4e42005-12-13 19:30:45 +1100624for protocol version 2.
625Additionally, any identities represented by the authentication agent
626will be used for authentication.
Damien Miller5059d8d2010-03-05 21:31:11 +1100627.Xr ssh 1
628will try to load certificate information from the filename obtained by
629appending
630.Pa -cert.pub
631to the path of a specified
632.Cm IdentityFile .
Damien Miller6b1d53c2006-03-31 23:13:21 +1100633.Pp
Damien Miller957d4e42005-12-13 19:30:45 +1100634The file name may use the tilde
Damien Millerc6437cf2006-03-31 23:14:41 +1100635syntax to refer to a user's home directory or one of the following
Damien Miller6b1d53c2006-03-31 23:13:21 +1100636escape characters:
637.Ql %d
638(local user's home directory),
639.Ql %u
640(local user name),
641.Ql %l
642(local host name),
643.Ql %h
644(remote host name) or
Damien Millerdfc61832006-03-31 23:14:57 +1100645.Ql %r
Damien Miller6b1d53c2006-03-31 23:13:21 +1100646(remote user name).
647.Pp
Damien Miller957d4e42005-12-13 19:30:45 +1100648It is possible to have
649multiple identity files specified in configuration files; all these
650identities will be tried in sequence.
Damien Miller6029e072011-06-20 14:22:49 +1000651Multiple
652.Cm IdentityFile
653directives will add to the list of identities tried (this behaviour
654differs from that of other configuration directives).
Damien Miller0dac6fb2010-11-20 15:19:38 +1100655.It Cm IPQoS
656Specifies the IPv4 type-of-service or DSCP class for connections.
657Accepted values are
658.Dq af11 ,
659.Dq af12 ,
660.Dq af13 ,
Damien Millerf6e758c2011-09-22 21:37:13 +1000661.Dq af21 ,
Damien Miller0dac6fb2010-11-20 15:19:38 +1100662.Dq af22 ,
663.Dq af23 ,
664.Dq af31 ,
665.Dq af32 ,
666.Dq af33 ,
667.Dq af41 ,
668.Dq af42 ,
669.Dq af43 ,
670.Dq cs0 ,
671.Dq cs1 ,
672.Dq cs2 ,
673.Dq cs3 ,
674.Dq cs4 ,
675.Dq cs5 ,
676.Dq cs6 ,
677.Dq cs7 ,
678.Dq ef ,
679.Dq lowdelay ,
680.Dq throughput ,
681.Dq reliability ,
682or a numeric value.
Damien Miller928362d2010-12-26 14:26:45 +1100683This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100684If one argument is specified, it is used as the packet class unconditionally.
685If two values are specified, the first is automatically selected for
686interactive sessions and the second for non-interactive sessions.
687The default is
688.Dq lowdelay
689for interactive sessions and
690.Dq throughput
691for non-interactive sessions.
Damien Millercfb606c2007-10-26 14:24:48 +1000692.It Cm KbdInteractiveAuthentication
693Specifies whether to use keyboard-interactive authentication.
694The argument to this keyword must be
695.Dq yes
696or
697.Dq no .
698The default is
699.Dq yes .
Darren Tucker636ca902004-11-05 20:22:00 +1100700.It Cm KbdInteractiveDevices
701Specifies the list of methods to use in keyboard-interactive authentication.
702Multiple method names must be comma-separated.
703The default is to use the server specified list.
Damien Miller9cfbaec2006-03-15 11:57:55 +1100704The methods available vary depending on what the server supports.
705For an OpenSSH server,
706it may be zero or more of:
707.Dq bsdauth ,
708.Dq pam ,
709and
710.Dq skey .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000711.It Cm KexAlgorithms
712Specifies the available KEX (Key Exchange) algorithms.
713Multiple algorithms must be comma-separated.
Damien Miller7fe2b1f2010-09-24 22:11:53 +1000714The default is:
715.Bd -literal -offset indent
716ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
717diffie-hellman-group-exchange-sha256,
718diffie-hellman-group-exchange-sha1,
719diffie-hellman-group14-sha1,
720diffie-hellman-group1-sha1
721.Ed
Damien Millerd27b9472005-12-13 19:29:02 +1100722.It Cm LocalCommand
723Specifies a command to execute on the local machine after successfully
724connecting to the server.
725The command string extends to the end of the line, and is executed with
Darren Tucker63b31cb2007-12-02 23:09:30 +1100726the user's shell.
Darren Tuckerf6b01b72008-06-13 04:56:37 +1000727The following escape character substitutions will be performed:
728.Ql %d
729(local user's home directory),
730.Ql %h
731(remote host name),
732.Ql %l
733(local host name),
734.Ql %n
735(host name as provided on the command line),
736.Ql %p
737(remote port),
738.Ql %r
739(remote user name) or
740.Ql %u
741(local user name).
Darren Tucker78be8c52010-01-08 17:05:59 +1100742.Pp
743The command is run synchronously and does not have access to the
744session of the
745.Xr ssh 1
746that spawned it.
747It should not be used for interactive commands.
748.Pp
Damien Millerd27b9472005-12-13 19:29:02 +1100749This directive is ignored unless
750.Cm PermitLocalCommand
751has been enabled.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000752.It Cm LocalForward
Damien Millere9d001e2006-01-14 10:10:17 +1100753Specifies that a TCP port on the local machine be forwarded over
Ben Lindstrom9f049032002-06-21 00:59:05 +0000754the secure channel to the specified host and port from the remote machine.
Darren Tucker5ede2ad2005-03-31 21:31:10 +1000755The first argument must be
Damien Millerf91ee4c2005-03-01 21:24:33 +1100756.Sm off
Darren Tucker5ede2ad2005-03-31 21:31:10 +1000757.Oo Ar bind_address : Oc Ar port
Damien Millerf91ee4c2005-03-01 21:24:33 +1100758.Sm on
Darren Tucker5ede2ad2005-03-31 21:31:10 +1000759and the second argument must be
760.Ar host : Ns Ar hostport .
Damien Miller7fa96602010-08-05 13:03:13 +1000761IPv6 addresses can be specified by enclosing addresses in square brackets.
Damien Millerf8c55462005-03-02 12:03:05 +1100762Multiple forwardings may be specified, and additional forwardings can be
Damien Millerf91ee4c2005-03-01 21:24:33 +1100763given on the command line.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000764Only the superuser can forward privileged ports.
Damien Millerf91ee4c2005-03-01 21:24:33 +1100765By default, the local port is bound in accordance with the
766.Cm GatewayPorts
767setting.
768However, an explicit
769.Ar bind_address
770may be used to bind the connection to a specific address.
771The
772.Ar bind_address
773of
774.Dq localhost
Damien Millerf8c55462005-03-02 12:03:05 +1100775indicates that the listening port be bound for local use only, while an
776empty address or
777.Sq *
Damien Millerf91ee4c2005-03-01 21:24:33 +1100778indicates that the port should be available from all interfaces.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000779.It Cm LogLevel
780Gives the verbosity level that is used when logging messages from
Damien Miller45ee2b92006-03-15 11:56:18 +1100781.Xr ssh 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000782The possible values are:
Damien Miller45ee2b92006-03-15 11:56:18 +1100783QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000784The default is INFO.
785DEBUG and DEBUG1 are equivalent.
786DEBUG2 and DEBUG3 each specify higher levels of verbose output.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000787.It Cm MACs
788Specifies the MAC (message authentication code) algorithms
789in order of preference.
790The MAC algorithm is used in protocol version 2
791for data integrity protection.
792Multiple algorithms must be comma-separated.
Damien Miller45ee2b92006-03-15 11:56:18 +1100793The default is:
Damien Miller5e7c30b2007-06-11 14:06:32 +1000794.Bd -literal -offset indent
Darren Tucker427e4092012-10-05 11:02:39 +1000795hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,
Darren Tuckerecbf14a2012-07-02 18:53:37 +1000796hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,
797hmac-sha1-96,hmac-md5-96
Damien Miller5e7c30b2007-06-11 14:06:32 +1000798.Ed
Ben Lindstrom9f049032002-06-21 00:59:05 +0000799.It Cm NoHostAuthenticationForLocalhost
800This option can be used if the home directory is shared across machines.
801In this case localhost will refer to a different machine on each of
802the machines and the user will get many warnings about changed host keys.
803However, this option disables host authentication for localhost.
804The argument to this keyword must be
805.Dq yes
806or
807.Dq no .
808The default is to check the host key for localhost.
809.It Cm NumberOfPasswordPrompts
810Specifies the number of password prompts before giving up.
811The argument to this keyword must be an integer.
Damien Miller45ee2b92006-03-15 11:56:18 +1100812The default is 3.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000813.It Cm PasswordAuthentication
814Specifies whether to use password authentication.
815The argument to this keyword must be
816.Dq yes
817or
818.Dq no .
819The default is
820.Dq yes .
Damien Millerd27b9472005-12-13 19:29:02 +1100821.It Cm PermitLocalCommand
822Allow local command execution via the
823.Ic LocalCommand
824option or using the
Damien Miller4b2319f2005-12-13 19:30:27 +1100825.Ic !\& Ns Ar command
Damien Millerd27b9472005-12-13 19:29:02 +1100826escape sequence in
827.Xr ssh 1 .
828The argument must be
829.Dq yes
830or
831.Dq no .
832The default is
833.Dq no .
Damien Miller7ea845e2010-02-12 09:21:02 +1100834.It Cm PKCS11Provider
835Specifies which PKCS#11 provider to use.
Damien Miller8e1ea4e2010-11-20 15:20:10 +1100836The argument to this keyword is the PKCS#11 shared library
Damien Miller7ea845e2010-02-12 09:21:02 +1100837.Xr ssh 1
Damien Millera7618442010-02-12 09:26:02 +1100838should use to communicate with a PKCS#11 token providing the user's
Damien Miller7ea845e2010-02-12 09:21:02 +1100839private RSA key.
Damien Miller957d4e42005-12-13 19:30:45 +1100840.It Cm Port
841Specifies the port number to connect on the remote host.
Damien Miller45ee2b92006-03-15 11:56:18 +1100842The default is 22.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000843.It Cm PreferredAuthentications
844Specifies the order in which the client should try protocol 2
Damien Millerfbf486b2003-05-23 18:44:23 +1000845authentication methods.
Darren Tucker1adc2bd2005-03-14 23:14:20 +1100846This allows a client to prefer one method (e.g.\&
Ben Lindstrom9f049032002-06-21 00:59:05 +0000847.Cm keyboard-interactive )
Darren Tucker1adc2bd2005-03-14 23:14:20 +1100848over another method (e.g.\&
Damien Miller544378d2010-04-16 15:52:24 +1000849.Cm password ) .
850The default is:
851.Bd -literal -offset indent
852gssapi-with-mic,hostbased,publickey,
853keyboard-interactive,password
854.Ed
Ben Lindstrom9f049032002-06-21 00:59:05 +0000855.It Cm Protocol
856Specifies the protocol versions
Damien Miller45ee2b92006-03-15 11:56:18 +1100857.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000858should support in order of preference.
859The possible values are
Damien Miller45ee2b92006-03-15 11:56:18 +1100860.Sq 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000861and
Damien Miller45ee2b92006-03-15 11:56:18 +1100862.Sq 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000863Multiple versions must be comma-separated.
Darren Tuckerbad50762009-10-11 21:51:08 +1100864When this option is set to
Darren Tucker7a4a7652009-10-11 21:51:40 +1100865.Dq 2,1
Darren Tuckerbad50762009-10-11 21:51:08 +1100866.Nm ssh
867will try version 2 and fall back to version 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000868if version 2 is not available.
Darren Tuckerbad50762009-10-11 21:51:08 +1100869The default is
Darren Tucker7a4a7652009-10-11 21:51:40 +1100870.Sq 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000871.It Cm ProxyCommand
872Specifies the command to use to connect to the server.
873The command
874string extends to the end of the line, and is executed with
Darren Tucker63b31cb2007-12-02 23:09:30 +1100875the user's shell.
Damien Millerc4eddee2010-04-18 08:07:43 +1000876In the command string, any occurrence of
Ben Lindstrom9f049032002-06-21 00:59:05 +0000877.Ql %h
878will be substituted by the host name to
Damien Millerb1b17042010-04-16 15:54:19 +1000879connect,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000880.Ql %p
Damien Millerc4eddee2010-04-18 08:07:43 +1000881by the port, and
882.Ql %r
Damien Millerb1b17042010-04-16 15:54:19 +1000883by the remote user name.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000884The command can be basically anything,
885and should read from its standard input and write to its standard output.
886It should eventually connect an
887.Xr sshd 8
888server running on some machine, or execute
889.Ic sshd -i
890somewhere.
891Host key management will be done using the
892HostName of the host being connected (defaulting to the name typed by
893the user).
Damien Miller495dca32003-04-01 21:42:14 +1000894Setting the command to
895.Dq none
Damien Miller9f1e33a2003-02-24 11:57:32 +1100896disables this option entirely.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000897Note that
898.Cm CheckHostIP
899is not available for connects with a proxy command.
900.Pp
Damien Millerebcfedc2005-05-26 12:13:56 +1000901This directive is useful in conjunction with
902.Xr nc 1
903and its proxy support.
Damien Millerdfec2942005-05-26 12:14:32 +1000904For example, the following directive would connect via an HTTP proxy at
Damien Millerebcfedc2005-05-26 12:13:56 +1000905192.0.2.0:
906.Bd -literal -offset 3n
907ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p
908.Ed
Ben Lindstrom9f049032002-06-21 00:59:05 +0000909.It Cm PubkeyAuthentication
910Specifies whether to try public key authentication.
911The argument to this keyword must be
912.Dq yes
913or
914.Dq no .
915The default is
916.Dq yes .
917This option applies to protocol version 2 only.
Darren Tucker62388b22006-01-20 11:31:47 +1100918.It Cm RekeyLimit
919Specifies the maximum amount of data that may be transmitted before the
Damien Millerddfddf12006-01-31 21:39:03 +1100920session key is renegotiated.
Darren Tucker62388b22006-01-20 11:31:47 +1100921The argument is the number of bytes, with an optional suffix of
Damien Millerddfddf12006-01-31 21:39:03 +1100922.Sq K ,
923.Sq M ,
Darren Tucker62388b22006-01-20 11:31:47 +1100924or
Damien Millerddfddf12006-01-31 21:39:03 +1100925.Sq G
Darren Tucker62388b22006-01-20 11:31:47 +1100926to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
927The default is between
Damien Miller45ee2b92006-03-15 11:56:18 +1100928.Sq 1G
Darren Tucker62388b22006-01-20 11:31:47 +1100929and
Damien Miller45ee2b92006-03-15 11:56:18 +1100930.Sq 4G ,
Darren Tucker62388b22006-01-20 11:31:47 +1100931depending on the cipher.
Damien Millerddfddf12006-01-31 21:39:03 +1100932This option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000933.It Cm RemoteForward
Damien Millere9d001e2006-01-14 10:10:17 +1100934Specifies that a TCP port on the remote machine be forwarded over
Ben Lindstrom9f049032002-06-21 00:59:05 +0000935the secure channel to the specified host and port from the local machine.
Darren Tucker5ede2ad2005-03-31 21:31:10 +1000936The first argument must be
Damien Millerf91ee4c2005-03-01 21:24:33 +1100937.Sm off
Darren Tucker5ede2ad2005-03-31 21:31:10 +1000938.Oo Ar bind_address : Oc Ar port
Damien Millerf91ee4c2005-03-01 21:24:33 +1100939.Sm on
Darren Tucker5ede2ad2005-03-31 21:31:10 +1000940and the second argument must be
941.Ar host : Ns Ar hostport .
Damien Miller7fa96602010-08-05 13:03:13 +1000942IPv6 addresses can be specified by enclosing addresses in square brackets.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000943Multiple forwardings may be specified, and additional
944forwardings can be given on the command line.
Damien Millerde7532e2008-11-03 19:24:45 +1100945Privileged ports can be forwarded only when
946logging in as root on the remote machine.
Damien Millere379e102009-02-14 16:34:39 +1100947.Pp
Damien Miller85c6d8a2009-02-14 16:34:21 +1100948If the
949.Ar port
950argument is
951.Ql 0 ,
952the listen port will be dynamically allocated on the server and reported
953to the client at run time.
Damien Millerf91ee4c2005-03-01 21:24:33 +1100954.Pp
955If the
956.Ar bind_address
957is not specified, the default is to only bind to loopback addresses.
958If the
959.Ar bind_address
960is
961.Ql *
962or an empty string, then the forwarding is requested to listen on all
963interfaces.
964Specifying a remote
965.Ar bind_address
Damien Millerf8c55462005-03-02 12:03:05 +1100966will only succeed if the server's
967.Cm GatewayPorts
Damien Millerf91ee4c2005-03-01 21:24:33 +1100968option is enabled (see
Damien Millerf8c55462005-03-02 12:03:05 +1100969.Xr sshd_config 5 ) .
Damien Miller21771e22011-05-15 08:45:50 +1000970.It Cm RequestTTY
971Specifies whether to request a pseudo-tty for the session.
972The argument may be one of:
973.Dq no
974(never request a TTY),
975.Dq yes
976(always request a TTY when standard input is a TTY),
977.Dq force
978(always request a TTY) or
979.Dq auto
980(request a TTY when opening a login session).
981This option mirrors the
982.Fl t
983and
984.Fl T
985flags for
986.Xr ssh 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000987.It Cm RhostsRSAAuthentication
988Specifies whether to try rhosts based authentication with RSA host
989authentication.
990The argument must be
991.Dq yes
992or
993.Dq no .
994The default is
995.Dq no .
996This option applies to protocol version 1 only and requires
Damien Miller45ee2b92006-03-15 11:56:18 +1100997.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000998to be setuid root.
999.It Cm RSAAuthentication
1000Specifies whether to try RSA authentication.
1001The argument to this keyword must be
1002.Dq yes
1003or
1004.Dq no .
1005RSA authentication will only be
1006attempted if the identity file exists, or an authentication agent is
1007running.
1008The default is
1009.Dq yes .
1010Note that this option applies to protocol version 1 only.
Darren Tucker46bc0752004-05-02 22:11:30 +10001011.It Cm SendEnv
1012Specifies what variables from the local
1013.Xr environ 7
1014should be sent to the server.
Damien Miller45ee2b92006-03-15 11:56:18 +11001015Note that environment passing is only supported for protocol 2.
1016The server must also support it, and the server must be configured to
Darren Tucker1e0c9bf2004-05-02 22:12:48 +10001017accept these environment variables.
Darren Tucker46bc0752004-05-02 22:11:30 +10001018Refer to
1019.Cm AcceptEnv
1020in
1021.Xr sshd_config 5
1022for how to configure the server.
Damien Miller6def5512006-03-15 11:54:05 +11001023Variables are specified by name, which may contain wildcard characters.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +10001024Multiple environment variables may be separated by whitespace or spread
Darren Tucker46bc0752004-05-02 22:11:30 +10001025across multiple
1026.Cm SendEnv
1027directives.
1028The default is not to send any environment variables.
Damien Millerf54a4b92006-03-15 11:54:36 +11001029.Pp
1030See
1031.Sx PATTERNS
1032for more information on patterns.
Damien Miller509b0102003-12-17 16:33:10 +11001033.It Cm ServerAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +11001034Sets the number of server alive messages (see below) which may be
Damien Miller509b0102003-12-17 16:33:10 +11001035sent without
Damien Miller45ee2b92006-03-15 11:56:18 +11001036.Xr ssh 1
Damien Miller509b0102003-12-17 16:33:10 +11001037receiving any messages back from the server.
1038If this threshold is reached while server alive messages are being sent,
Damien Miller45ee2b92006-03-15 11:56:18 +11001039ssh will disconnect from the server, terminating the session.
Damien Miller509b0102003-12-17 16:33:10 +11001040It is important to note that the use of server alive messages is very
1041different from
1042.Cm TCPKeepAlive
1043(below).
1044The server alive messages are sent through the encrypted channel
1045and therefore will not be spoofable.
1046The TCP keepalive option enabled by
1047.Cm TCPKeepAlive
1048is spoofable.
1049The server alive mechanism is valuable when the client or
1050server depend on knowing when a connection has become inactive.
1051.Pp
1052The default value is 3.
1053If, for example,
1054.Cm ServerAliveInterval
Damien Miller45ee2b92006-03-15 11:56:18 +11001055(see below) is set to 15 and
Damien Miller509b0102003-12-17 16:33:10 +11001056.Cm ServerAliveCountMax
Damien Miller45ee2b92006-03-15 11:56:18 +11001057is left at the default, if the server becomes unresponsive,
1058ssh will disconnect after approximately 45 seconds.
Damien Millercc3e8ba2006-03-15 12:06:55 +11001059This option applies to protocol version 2 only.
Damien Miller957d4e42005-12-13 19:30:45 +11001060.It Cm ServerAliveInterval
1061Sets a timeout interval in seconds after which if no data has been received
1062from the server,
Damien Miller45ee2b92006-03-15 11:56:18 +11001063.Xr ssh 1
Damien Miller957d4e42005-12-13 19:30:45 +11001064will send a message through the encrypted
1065channel to request a response from the server.
1066The default
1067is 0, indicating that these messages will not be sent to the server.
1068This option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001069.It Cm StrictHostKeyChecking
1070If this flag is set to
1071.Dq yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +11001072.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001073will never automatically add host keys to the
Damien Miller167ea5d2005-05-26 12:04:02 +10001074.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +00001075file, and refuses to connect to hosts whose host key has changed.
1076This provides maximum protection against trojan horse attacks,
Damien Miller45ee2b92006-03-15 11:56:18 +11001077though it can be annoying when the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001078.Pa /etc/ssh/ssh_known_hosts
Damien Miller45ee2b92006-03-15 11:56:18 +11001079file is poorly maintained or when connections to new hosts are
Ben Lindstrom9f049032002-06-21 00:59:05 +00001080frequently made.
1081This option forces the user to manually
1082add all new hosts.
1083If this flag is set to
1084.Dq no ,
Damien Miller45ee2b92006-03-15 11:56:18 +11001085ssh will automatically add new host keys to the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001086user known hosts files.
1087If this flag is set to
1088.Dq ask ,
1089new host keys
1090will be added to the user known host files only after the user
1091has confirmed that is what they really want to do, and
Damien Miller45ee2b92006-03-15 11:56:18 +11001092ssh will refuse to connect to hosts whose host key has changed.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001093The host keys of
1094known hosts will be verified automatically in all cases.
1095The argument must be
1096.Dq yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +11001097.Dq no ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001098or
1099.Dq ask .
1100The default is
1101.Dq ask .
Damien Miller12c150e2003-12-17 16:31:10 +11001102.It Cm TCPKeepAlive
1103Specifies whether the system should send TCP keepalive messages to the
1104other side.
1105If they are sent, death of the connection or crash of one
1106of the machines will be properly noticed.
1107However, this means that
1108connections will die if the route is down temporarily, and some people
1109find it annoying.
1110.Pp
1111The default is
1112.Dq yes
1113(to send TCP keepalive messages), and the client will notice
1114if the network goes down or the remote host dies.
1115This is important in scripts, and many users want it too.
1116.Pp
1117To disable TCP keepalive messages, the value should be set to
1118.Dq no .
Damien Millerd27b9472005-12-13 19:29:02 +11001119.It Cm Tunnel
Damien Miller991dba42006-07-10 20:16:27 +10001120Request
Damien Millerd27b9472005-12-13 19:29:02 +11001121.Xr tun 4
Damien Miller7746c392005-12-13 19:33:37 +11001122device forwarding between the client and the server.
Damien Millerd27b9472005-12-13 19:29:02 +11001123The argument must be
Damien Miller7b58e802005-12-13 19:33:19 +11001124.Dq yes ,
Damien Miller991dba42006-07-10 20:16:27 +10001125.Dq point-to-point
1126(layer 3),
1127.Dq ethernet
1128(layer 2),
Damien Millerd27b9472005-12-13 19:29:02 +11001129or
1130.Dq no .
Damien Miller991dba42006-07-10 20:16:27 +10001131Specifying
1132.Dq yes
1133requests the default tunnel mode, which is
1134.Dq point-to-point .
Damien Millerd27b9472005-12-13 19:29:02 +11001135The default is
1136.Dq no .
1137.It Cm TunnelDevice
Damien Miller991dba42006-07-10 20:16:27 +10001138Specifies the
Damien Millerd27b9472005-12-13 19:29:02 +11001139.Xr tun 4
Damien Miller991dba42006-07-10 20:16:27 +10001140devices to open on the client
1141.Pq Ar local_tun
1142and the server
1143.Pq Ar remote_tun .
1144.Pp
1145The argument must be
1146.Sm off
1147.Ar local_tun Op : Ar remote_tun .
1148.Sm on
1149The devices may be specified by numerical ID or the keyword
1150.Dq any ,
1151which uses the next available tunnel device.
1152If
1153.Ar remote_tun
1154is not specified, it defaults to
1155.Dq any .
1156The default is
1157.Dq any:any .
Damien Millere8cd7412005-12-24 14:55:47 +11001158.It Cm UsePrivilegedPort
1159Specifies whether to use a privileged port for outgoing connections.
1160The argument must be
1161.Dq yes
1162or
1163.Dq no .
1164The default is
1165.Dq no .
1166If set to
Damien Miller45ee2b92006-03-15 11:56:18 +11001167.Dq yes ,
1168.Xr ssh 1
Damien Millere8cd7412005-12-24 14:55:47 +11001169must be setuid root.
1170Note that this option must be set to
1171.Dq yes
1172for
1173.Cm RhostsRSAAuthentication
1174with older servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001175.It Cm User
1176Specifies the user to log in as.
1177This can be useful when a different user name is used on different machines.
1178This saves the trouble of
1179having to remember to give the user name on the command line.
1180.It Cm UserKnownHostsFile
Damien Miller295ee632011-05-29 21:42:31 +10001181Specifies one or more files to use for the user
1182host key database, separated by whitespace.
1183The default is
1184.Pa ~/.ssh/known_hosts ,
1185.Pa ~/.ssh/known_hosts2 .
Damien Miller37876e92003-05-15 10:19:46 +10001186.It Cm VerifyHostKeyDNS
1187Specifies whether to verify the remote key using DNS and SSHFP resource
1188records.
Damien Miller150b5572003-11-17 21:19:29 +11001189If this option is set to
1190.Dq yes ,
Damien Millerfe448472003-11-17 21:19:49 +11001191the client will implicitly trust keys that match a secure fingerprint
Damien Miller150b5572003-11-17 21:19:29 +11001192from DNS.
1193Insecure fingerprints will be handled as if this option was set to
1194.Dq ask .
1195If this option is set to
1196.Dq ask ,
1197information on fingerprint match will be displayed, but the user will still
1198need to confirm new host keys according to the
1199.Cm StrictHostKeyChecking
1200option.
1201The argument must be
1202.Dq yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +11001203.Dq no ,
Damien Millerfe448472003-11-17 21:19:49 +11001204or
1205.Dq ask .
Damien Miller37876e92003-05-15 10:19:46 +10001206The default is
1207.Dq no .
Damien Millereacbb4f2003-06-02 19:10:41 +10001208Note that this option applies to protocol version 2 only.
Damien Miller45ee2b92006-03-15 11:56:18 +11001209.Pp
1210See also
1211.Sx VERIFYING HOST KEYS
1212in
1213.Xr ssh 1 .
Damien Miller10288242008-06-30 00:04:03 +10001214.It Cm VisualHostKey
1215If this flag is set to
1216.Dq yes ,
1217an ASCII art representation of the remote host key fingerprint is
Damien Millera414cd32008-11-03 19:25:21 +11001218printed in addition to the hex fingerprint string at login and
1219for unknown host keys.
Damien Miller10288242008-06-30 00:04:03 +10001220If this flag is set to
1221.Dq no ,
Damien Millera414cd32008-11-03 19:25:21 +11001222no fingerprint strings are printed at login and
1223only the hex fingerprint string will be printed for unknown host keys.
Damien Miller10288242008-06-30 00:04:03 +10001224The default is
1225.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001226.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001227Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001228.Xr xauth 1
1229program.
1230The default is
1231.Pa /usr/X11R6/bin/xauth .
1232.El
Damien Millerb5282c22006-03-15 11:59:08 +11001233.Sh PATTERNS
1234A
1235.Em pattern
1236consists of zero or more non-whitespace characters,
1237.Sq *
1238(a wildcard that matches zero or more characters),
1239or
1240.Sq ?\&
1241(a wildcard that matches exactly one character).
1242For example, to specify a set of declarations for any host in the
1243.Dq .co.uk
1244set of domains,
1245the following pattern could be used:
1246.Pp
1247.Dl Host *.co.uk
1248.Pp
1249The following pattern
1250would match any host in the 192.168.0.[0-9] network range:
1251.Pp
1252.Dl Host 192.168.0.?
1253.Pp
1254A
1255.Em pattern-list
1256is a comma-separated list of patterns.
1257Patterns within pattern-lists may be negated
1258by preceding them with an exclamation mark
1259.Pq Sq !\& .
1260For example,
1261to allow a key to be used from anywhere within an organisation
1262except from the
1263.Dq dialup
1264pool,
1265the following entry (in authorized_keys) could be used:
1266.Pp
1267.Dl from=\&"!*.dialup.example.com,*.example.com\&"
Ben Lindstrom9f049032002-06-21 00:59:05 +00001268.Sh FILES
1269.Bl -tag -width Ds
Damien Miller167ea5d2005-05-26 12:04:02 +10001270.It Pa ~/.ssh/config
Ben Lindstrom9f049032002-06-21 00:59:05 +00001271This is the per-user configuration file.
1272The format of this file is described above.
Damien Miller45ee2b92006-03-15 11:56:18 +11001273This file is used by the SSH client.
Damien Millerc970cb92004-04-20 20:12:53 +10001274Because of the potential for abuse, this file must have strict permissions:
1275read/write for the user, and not accessible by others.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001276.It Pa /etc/ssh/ssh_config
1277Systemwide configuration file.
1278This file provides defaults for those
1279values that are not specified in the user's configuration file, and
1280for those users who do not have a configuration file.
1281This file must be world-readable.
1282.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001283.Sh SEE ALSO
1284.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001285.Sh AUTHORS
1286OpenSSH is a derivative of the original and free
1287ssh 1.2.12 release by Tatu Ylonen.
1288Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1289Theo de Raadt and Dug Song
1290removed many bugs, re-added newer features and
1291created OpenSSH.
1292Markus Friedl contributed the support for SSH
1293protocol versions 1.5 and 2.0.