blob: 50bcae82f66104d6e82a1afd24d6859126721bf4 [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.\"
Damien Miller928362d2010-12-26 14:26:45 +110036.\" $OpenBSD: ssh_config.5,v 1.146 2010/12/08 04:02:47 djm Exp $
37.Dd $Mdocdate: December 8 2010 $
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
115See
116.Sx PATTERNS
117for more information on patterns.
Damien Miller20a8f972003-05-18 20:50:30 +1000118.It Cm AddressFamily
Damien Millerfbf486b2003-05-23 18:44:23 +1000119Specifies which address family to use when connecting.
120Valid arguments are
Damien Miller20a8f972003-05-18 20:50:30 +1000121.Dq any ,
122.Dq inet
Damien Miller45ee2b92006-03-15 11:56:18 +1100123(use IPv4 only), or
Damien Miller20a8f972003-05-18 20:50:30 +1000124.Dq inet6
Darren Tucker79a7acf2005-02-09 09:48:57 +1100125(use IPv6 only).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000126.It Cm BatchMode
127If set to
128.Dq yes ,
129passphrase/password querying will be disabled.
130This option is useful in scripts and other batch jobs where no user
131is present to supply the password.
132The argument must be
133.Dq yes
134or
135.Dq no .
136The default is
137.Dq no .
138.It Cm BindAddress
Darren Tucker89f4d472005-07-14 17:06:21 +1000139Use the specified address on the local machine as the source address of
Darren Tucker6c71d202005-07-14 17:06:50 +1000140the connection.
141Only useful on systems with more than one address.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000142Note that this option does not work if
143.Cm UsePrivilegedPort
144is set to
145.Dq yes .
146.It Cm ChallengeResponseAuthentication
Damien Miller1faa7132006-03-15 11:55:31 +1100147Specifies whether to use challenge-response authentication.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000148The argument to this keyword must be
149.Dq yes
150or
151.Dq no .
152The default is
153.Dq yes .
154.It Cm CheckHostIP
155If this flag is set to
156.Dq yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +1100157.Xr ssh 1
158will additionally check the host IP address in the
Ben Lindstrom9f049032002-06-21 00:59:05 +0000159.Pa known_hosts
160file.
161This allows ssh to detect if a host key changed due to DNS spoofing.
162If the option is set to
163.Dq no ,
164the check will not be executed.
165The default is
166.Dq yes .
167.It Cm Cipher
168Specifies the cipher to use for encrypting the session
169in protocol version 1.
170Currently,
171.Dq blowfish ,
172.Dq 3des ,
173and
174.Dq des
175are supported.
176.Ar des
177is only supported in the
Damien Miller45ee2b92006-03-15 11:56:18 +1100178.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000179client for interoperability with legacy protocol 1 implementations
180that do not support the
181.Ar 3des
Damien Miller495dca32003-04-01 21:42:14 +1000182cipher.
183Its use is strongly discouraged due to cryptographic weaknesses.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000184The default is
185.Dq 3des .
186.It Cm Ciphers
187Specifies the ciphers allowed for protocol version 2
188in order of preference.
189Multiple ciphers must be comma-separated.
Damien Miller05202ff2004-06-15 10:30:39 +1000190The supported ciphers are
191.Dq 3des-cbc ,
192.Dq aes128-cbc ,
193.Dq aes192-cbc ,
194.Dq aes256-cbc ,
195.Dq aes128-ctr ,
196.Dq aes192-ctr ,
197.Dq aes256-ctr ,
Damien Miller3710f272005-05-26 12:19:17 +1000198.Dq arcfour128 ,
199.Dq arcfour256 ,
Damien Miller05202ff2004-06-15 10:30:39 +1000200.Dq arcfour ,
201.Dq blowfish-cbc ,
202and
203.Dq cast128-cbc .
Damien Miller45ee2b92006-03-15 11:56:18 +1100204The default is:
205.Bd -literal -offset 3n
Damien Miller9aa72ba2009-01-28 16:34:00 +1100206aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,
207aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,
208aes256-cbc,arcfour
Ben Lindstrom9f049032002-06-21 00:59:05 +0000209.Ed
210.It Cm ClearAllForwardings
Damien Miller45ee2b92006-03-15 11:56:18 +1100211Specifies that all local, remote, and dynamic port forwardings
Ben Lindstrom9f049032002-06-21 00:59:05 +0000212specified in the configuration files or on the command line be
Damien Miller495dca32003-04-01 21:42:14 +1000213cleared.
214This option is primarily useful when used from the
Damien Miller45ee2b92006-03-15 11:56:18 +1100215.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000216command line to clear port forwardings set in
217configuration files, and is automatically set by
218.Xr scp 1
219and
220.Xr sftp 1 .
221The argument must be
222.Dq yes
223or
224.Dq no .
225The default is
226.Dq no .
227.It Cm Compression
228Specifies whether to use compression.
229The argument must be
230.Dq yes
231or
232.Dq no .
233The default is
234.Dq no .
235.It Cm CompressionLevel
236Specifies the compression level to use if compression is enabled.
237The argument must be an integer from 1 (fast) to 9 (slow, best).
238The default level is 6, which is good for most applications.
239The meaning of the values is the same as in
240.Xr gzip 1 .
241Note that this option applies to protocol version 1 only.
242.It Cm ConnectionAttempts
243Specifies the number of tries (one per second) to make before exiting.
244The argument must be an integer.
245This may be useful in scripts if the connection sometimes fails.
246The default is 1.
Damien Millerb78d5eb2003-05-16 11:39:04 +1000247.It Cm ConnectTimeout
Damien Miller45ee2b92006-03-15 11:56:18 +1100248Specifies the timeout (in seconds) used when connecting to the
249SSH server, instead of using the default system TCP timeout.
Damien Millerfbf486b2003-05-23 18:44:23 +1000250This value is used only when the target is down or really unreachable,
251not when it refuses the connection.
Damien Miller0e220db2004-06-15 10:34:08 +1000252.It Cm ControlMaster
253Enables the sharing of multiple sessions over a single network connection.
254When set to
Damien Miller45ee2b92006-03-15 11:56:18 +1100255.Dq yes ,
256.Xr ssh 1
Damien Miller0e220db2004-06-15 10:34:08 +1000257will listen for connections on a control socket specified using the
258.Cm ControlPath
259argument.
260Additional sessions can connect to this socket using the same
261.Cm ControlPath
262with
263.Cm ControlMaster
264set to
265.Dq no
Damien Miller2234bac2004-06-30 22:38:52 +1000266(the default).
Damien Miller713de762005-11-05 15:13:49 +1100267These sessions will try to reuse the master instance's network connection
Damien Millerb3bfbb72005-11-05 15:11:48 +1100268rather than initiating new ones, but will fall back to connecting normally
269if the control socket does not exist, or is not listening.
270.Pp
Damien Miller23f07702004-06-18 01:19:03 +1000271Setting this to
272.Dq ask
Damien Miller45ee2b92006-03-15 11:56:18 +1100273will cause ssh
Damien Miller23f07702004-06-18 01:19:03 +1000274to listen for control connections, but require confirmation using the
275.Ev SSH_ASKPASS
276program before they are accepted (see
277.Xr ssh-add 1
Damien Miller2234bac2004-06-30 22:38:52 +1000278for details).
Damien Millerdadfd4d2005-05-26 12:07:13 +1000279If the
280.Cm ControlPath
Damien Miller45ee2b92006-03-15 11:56:18 +1100281cannot be opened,
282ssh will continue without connecting to a master instance.
Damien Millerd14b1e72005-06-16 13:19:41 +1000283.Pp
Damien Miller13390022005-07-06 09:44:19 +1000284X11 and
Damien Millerfd94fba2005-07-06 09:44:59 +1000285.Xr ssh-agent 1
Damien Miller13390022005-07-06 09:44:19 +1000286forwarding is supported over these multiplexed connections, however the
Darren Tucker63551872005-12-20 16:14:15 +1100287display and agent forwarded will be the one belonging to the master
Damien Millerfd94fba2005-07-06 09:44:59 +1000288connection i.e. it is not possible to forward multiple displays or agents.
Damien Miller13390022005-07-06 09:44:19 +1000289.Pp
Damien Millerd14b1e72005-06-16 13:19:41 +1000290Two additional options allow for opportunistic multiplexing: try to use a
291master connection but fall back to creating a new one if one does not already
292exist.
293These options are:
294.Dq auto
295and
296.Dq autoask .
297The latter requires confirmation like the
298.Dq ask
299option.
Damien Miller0e220db2004-06-15 10:34:08 +1000300.It Cm ControlPath
Damien Miller6476cad2005-06-16 13:18:34 +1000301Specify the path to the control socket used for connection sharing as described
302in the
Damien Miller0e220db2004-06-15 10:34:08 +1000303.Cm ControlMaster
Damien Miller8f74c8f2005-06-26 08:56:03 +1000304section above or the string
305.Dq none
306to disable connection sharing.
Damien Miller6476cad2005-06-16 13:18:34 +1000307In the path,
Damien Miller3ec54c72006-03-15 11:30:13 +1100308.Ql %l
309will be substituted by the local host name,
Damien Miller6476cad2005-06-16 13:18:34 +1000310.Ql %h
311will be substituted by the target host name,
312.Ql %p
Damien Miller45ee2b92006-03-15 11:56:18 +1100313the port, and
Damien Miller6476cad2005-06-16 13:18:34 +1000314.Ql %r
315by the remote login username.
Damien Millerd14b1e72005-06-16 13:19:41 +1000316It is recommended that any
317.Cm ControlPath
318used for opportunistic connection sharing include
Damien Miller20c2ec42006-03-15 11:31:01 +1100319at least %h, %p, and %r.
Damien Millerd14b1e72005-06-16 13:19:41 +1000320This ensures that shared connections are uniquely identified.
Damien Millere11e1ea2010-08-03 16:04:46 +1000321.It Cm ControlPersist
322When used in conjunction with
323.Cm ControlMaster ,
324specifies that the master connection should remain open
325in the background (waiting for future client connections)
326after the initial client connection has been closed.
327If set to
328.Dq no ,
329then the master connection will not be placed into the background,
330and will close as soon as the initial client connection is closed.
331If set to
332.Dq yes ,
333then the master connection will remain in the background indefinitely
334(until killed or closed via a mechanism such as the
335.Xr ssh 1
336.Dq Fl O No exit
337option).
338If set to a time in seconds, or a time in any of the formats documented in
339.Xr sshd_config 5 ,
340then the backgrounded master connection will automatically terminate
341after it has remained idle (with no client connections) for the
342specified time.
Damien Miller2234bac2004-06-30 22:38:52 +1000343.It Cm DynamicForward
Damien Millere9d001e2006-01-14 10:10:17 +1100344Specifies that a TCP port on the local machine be forwarded
Damien Miller2234bac2004-06-30 22:38:52 +1000345over the secure channel, and the application
346protocol is then used to determine where to connect to from the
347remote machine.
Darren Tuckerc8d64212005-10-03 18:13:42 +1000348.Pp
349The argument must be
350.Sm off
351.Oo Ar bind_address : Oc Ar port .
352.Sm on
Damien Miller7fa96602010-08-05 13:03:13 +1000353IPv6 addresses can be specified by enclosing addresses in square brackets.
Darren Tuckerc8d64212005-10-03 18:13:42 +1000354By default, the local port is bound in accordance with the
355.Cm GatewayPorts
356setting.
357However, an explicit
358.Ar bind_address
359may be used to bind the connection to a specific address.
360The
361.Ar bind_address
362of
363.Dq localhost
364indicates that the listening port be bound for local use only, while an
365empty address or
366.Sq *
367indicates that the port should be available from all interfaces.
368.Pp
Damien Miller2234bac2004-06-30 22:38:52 +1000369Currently the SOCKS4 and SOCKS5 protocols are supported, and
Damien Miller45ee2b92006-03-15 11:56:18 +1100370.Xr ssh 1
Damien Miller2234bac2004-06-30 22:38:52 +1000371will act as a SOCKS server.
372Multiple forwardings may be specified, and
373additional forwardings can be given on the command line.
374Only the superuser can forward privileged ports.
Darren Tucker674f71d2003-06-28 12:33:12 +1000375.It Cm EnableSSHKeysign
376Setting this option to
377.Dq yes
378in the global client configuration file
379.Pa /etc/ssh/ssh_config
380enables the use of the helper program
381.Xr ssh-keysign 8
382during
383.Cm HostbasedAuthentication .
384The argument must be
385.Dq yes
386or
387.Dq no .
388The default is
389.Dq no .
Darren Tuckerf132c672003-10-15 15:58:18 +1000390This option should be placed in the non-hostspecific section.
Darren Tucker674f71d2003-06-28 12:33:12 +1000391See
392.Xr ssh-keysign 8
393for more information.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000394.It Cm EscapeChar
395Sets the escape character (default:
396.Ql ~ ) .
397The escape character can also
398be set on the command line.
399The argument should be a single character,
400.Ql ^
401followed by a letter, or
402.Dq none
403to disable the escape
404character entirely (making the connection transparent for binary
405data).
Darren Tuckere7d4b192006-07-12 22:17:10 +1000406.It Cm ExitOnForwardFailure
407Specifies whether
408.Xr ssh 1
409should terminate the connection if it cannot set up all requested
Darren Tuckerfc5d1882007-08-15 22:20:22 +1000410dynamic, tunnel, local, and remote port forwardings.
Darren Tuckere7d4b192006-07-12 22:17:10 +1000411The argument must be
412.Dq yes
413or
414.Dq no .
415The default is
416.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000417.It Cm ForwardAgent
418Specifies whether the connection to the authentication agent (if any)
419will be forwarded to the remote machine.
420The argument must be
421.Dq yes
422or
423.Dq no .
424The default is
425.Dq no .
Damien Milleraf653042002-09-04 16:40:37 +1000426.Pp
Damien Miller495dca32003-04-01 21:42:14 +1000427Agent forwarding should be enabled with caution.
428Users with the ability to bypass file permissions on the remote host
429(for the agent's Unix-domain socket)
430can access the local agent through the forwarded connection.
431An attacker cannot obtain key material from the agent,
Damien Milleraf653042002-09-04 16:40:37 +1000432however they can perform operations on the keys that enable them to
433authenticate using the identities loaded into the agent.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000434.It Cm ForwardX11
435Specifies whether X11 connections will be automatically redirected
436over the secure channel and
437.Ev DISPLAY
438set.
439The argument must be
440.Dq yes
441or
442.Dq no .
443The default is
444.Dq no .
Damien Milleraf653042002-09-04 16:40:37 +1000445.Pp
Damien Miller495dca32003-04-01 21:42:14 +1000446X11 forwarding should be enabled with caution.
447Users with the ability to bypass file permissions on the remote host
Darren Tucker0a118da2003-10-15 15:54:32 +1000448(for the user's X11 authorization database)
Damien Miller495dca32003-04-01 21:42:14 +1000449can access the local X11 display through the forwarded connection.
Darren Tucker0a118da2003-10-15 15:54:32 +1000450An attacker may then be able to perform activities such as keystroke monitoring
451if the
452.Cm ForwardX11Trusted
453option is also enabled.
Damien Miller1ab6a512010-06-26 10:02:24 +1000454.It Cm ForwardX11Timeout
Damien Millercede1db2010-07-02 13:33:48 +1000455Specify a timeout for untrusted X11 forwarding
456using the format described in the
Damien Miller1ab6a512010-06-26 10:02:24 +1000457.Sx TIME FORMATS
458section of
459.Xr sshd_config 5 .
460X11 connections received by
461.Xr ssh 1
462after this time will be refused.
463The default is to disable untrusted X11 forwarding after twenty minutes has
464elapsed.
Darren Tucker0a118da2003-10-15 15:54:32 +1000465.It Cm ForwardX11Trusted
Darren Tuckerdcf6ec42004-05-13 13:03:56 +1000466If this option is set to
Damien Miller45ee2b92006-03-15 11:56:18 +1100467.Dq yes ,
468remote X11 clients will have full access to the original X11 display.
Damien Miller1717fd42005-03-01 21:17:31 +1100469.Pp
Darren Tucker0a118da2003-10-15 15:54:32 +1000470If this option is set to
Damien Miller45ee2b92006-03-15 11:56:18 +1100471.Dq no ,
472remote X11 clients will be considered untrusted and prevented
Darren Tucker0a118da2003-10-15 15:54:32 +1000473from stealing or tampering with data belonging to trusted X11
474clients.
Damien Miller1717fd42005-03-01 21:17:31 +1100475Furthermore, the
476.Xr xauth 1
477token used for the session will be set to expire after 20 minutes.
478Remote clients will be refused access after this time.
Darren Tucker0a118da2003-10-15 15:54:32 +1000479.Pp
480The default is
481.Dq no .
482.Pp
483See the X11 SECURITY extension specification for full details on
484the restrictions imposed on untrusted clients.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000485.It Cm GatewayPorts
486Specifies whether remote hosts are allowed to connect to local
487forwarded ports.
488By default,
Damien Miller45ee2b92006-03-15 11:56:18 +1100489.Xr ssh 1
Damien Miller495dca32003-04-01 21:42:14 +1000490binds local port forwardings to the loopback address.
491This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000492.Cm GatewayPorts
Damien Miller45ee2b92006-03-15 11:56:18 +1100493can be used to specify that ssh
Ben Lindstrom9f049032002-06-21 00:59:05 +0000494should bind local port forwardings to the wildcard address,
495thus allowing remote hosts to connect to forwarded ports.
496The argument must be
497.Dq yes
498or
499.Dq no .
500The default is
501.Dq no .
502.It Cm GlobalKnownHostsFile
503Specifies a file to use for the global
504host key database instead of
505.Pa /etc/ssh/ssh_known_hosts .
Darren Tucker0efd1552003-08-26 11:49:55 +1000506.It Cm GSSAPIAuthentication
Damien Millerbaafb982003-12-17 16:32:23 +1100507Specifies whether user authentication based on GSSAPI is allowed.
Damien Millerc2b98272003-09-03 12:13:30 +1000508The default is
Darren Tuckera044f472003-10-15 15:52:03 +1000509.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000510Note that this option applies to protocol version 2 only.
511.It Cm GSSAPIDelegateCredentials
512Forward (delegate) credentials to the server.
513The default is
514.Dq no .
515Note that this option applies to protocol version 2 only.
Damien Millere1776152005-03-01 21:47:37 +1100516.It Cm HashKnownHosts
517Indicates that
Damien Miller45ee2b92006-03-15 11:56:18 +1100518.Xr ssh 1
Damien Millere1776152005-03-01 21:47:37 +1100519should hash host names and addresses when they are added to
Damien Miller167ea5d2005-05-26 12:04:02 +1000520.Pa ~/.ssh/known_hosts .
Damien Millere1776152005-03-01 21:47:37 +1100521These hashed names may be used normally by
Damien Miller45ee2b92006-03-15 11:56:18 +1100522.Xr ssh 1
Damien Millere1776152005-03-01 21:47:37 +1100523and
Damien Miller45ee2b92006-03-15 11:56:18 +1100524.Xr sshd 8 ,
Damien Millere1776152005-03-01 21:47:37 +1100525but they do not reveal identifying information should the file's contents
526be disclosed.
527The default is
528.Dq no .
Damien Miller858bb7d2006-08-05 11:34:51 +1000529Note that existing names and addresses in known hosts files
530will not be converted automatically,
531but may be manually hashed using
Damien Miller4b42d7f2005-03-01 21:48:35 +1100532.Xr ssh-keygen 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000533.It Cm HostbasedAuthentication
534Specifies whether to try rhosts based authentication with public key
535authentication.
536The argument must be
537.Dq yes
538or
539.Dq no .
540The default is
541.Dq no .
542This option applies to protocol version 2 only and
543is similar to
544.Cm RhostsRSAAuthentication .
545.It Cm HostKeyAlgorithms
546Specifies the protocol version 2 host key algorithms
547that the client wants to use in order of preference.
548The default for this option is:
Damien Millereb8b60e2010-08-31 22:41:14 +1000549.Bd -literal -offset 3n
550ecdsa-sha2-nistp256-cert-v01@openssh.com,
551ecdsa-sha2-nistp384-cert-v01@openssh.com,
552ecdsa-sha2-nistp521-cert-v01@openssh.com,
553ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,
554ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,
555ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
556ssh-rsa,ssh-dss
557.Ed
Damien Millerd925dcd2010-12-01 12:21:51 +1100558.Pp
559If hostkeys are known for the destination host then this default is modified
560to prefer their algorithms.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000561.It Cm HostKeyAlias
562Specifies an alias that should be used instead of the
563real host name when looking up or saving the host key
564in the host key database files.
Damien Miller45ee2b92006-03-15 11:56:18 +1100565This option is useful for tunneling SSH connections
Ben Lindstrom9f049032002-06-21 00:59:05 +0000566or for multiple servers running on a single host.
567.It Cm HostName
568Specifies the real host name to log into.
569This can be used to specify nicknames or abbreviations for hosts.
Damien Millerd0244d42010-07-16 13:56:43 +1000570If the hostname contains the character sequence
571.Ql %h ,
572then this will be replaced with the host name specified on the commandline
573(this is useful for manipulating unqualified names).
Damien Miller45ee2b92006-03-15 11:56:18 +1100574The default is the name given on the command line.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000575Numeric IP addresses are also permitted (both on the command line and in
576.Cm HostName
577specifications).
Damien Millerbd394c32004-03-08 23:12:36 +1100578.It Cm IdentitiesOnly
579Specifies that
Damien Miller45ee2b92006-03-15 11:56:18 +1100580.Xr ssh 1
Damien Millerbd394c32004-03-08 23:12:36 +1100581should only use the authentication identity files configured in the
Damien Miller1a812582004-04-20 20:13:32 +1000582.Nm
Damien Millerbd394c32004-03-08 23:12:36 +1100583files,
Damien Miller45ee2b92006-03-15 11:56:18 +1100584even if
585.Xr ssh-agent 1
Damien Millerbd394c32004-03-08 23:12:36 +1100586offers more identities.
587The argument to this keyword must be
588.Dq yes
589or
590.Dq no .
Damien Miller45ee2b92006-03-15 11:56:18 +1100591This option is intended for situations where ssh-agent
Damien Millerbd394c32004-03-08 23:12:36 +1100592offers many different identities.
593The default is
594.Dq no .
Damien Miller957d4e42005-12-13 19:30:45 +1100595.It Cm IdentityFile
Damien Millereb8b60e2010-08-31 22:41:14 +1000596Specifies a file from which the user's DSA, ECDSA or DSA authentication
597identity is read.
Damien Miller957d4e42005-12-13 19:30:45 +1100598The default is
599.Pa ~/.ssh/identity
600for protocol version 1, and
Damien Millereb8b60e2010-08-31 22:41:14 +1000601.Pa ~/.ssh/id_dsa ,
602.Pa ~/.ssh/id_ecdsa
Damien Miller957d4e42005-12-13 19:30:45 +1100603and
Damien Millereb8b60e2010-08-31 22:41:14 +1000604.Pa ~/.ssh/id_rsa
Damien Miller957d4e42005-12-13 19:30:45 +1100605for protocol version 2.
606Additionally, any identities represented by the authentication agent
607will be used for authentication.
Damien Miller5059d8d2010-03-05 21:31:11 +1100608.Xr ssh 1
609will try to load certificate information from the filename obtained by
610appending
611.Pa -cert.pub
612to the path of a specified
613.Cm IdentityFile .
Damien Miller6b1d53c2006-03-31 23:13:21 +1100614.Pp
Damien Miller957d4e42005-12-13 19:30:45 +1100615The file name may use the tilde
Damien Millerc6437cf2006-03-31 23:14:41 +1100616syntax to refer to a user's home directory or one of the following
Damien Miller6b1d53c2006-03-31 23:13:21 +1100617escape characters:
618.Ql %d
619(local user's home directory),
620.Ql %u
621(local user name),
622.Ql %l
623(local host name),
624.Ql %h
625(remote host name) or
Damien Millerdfc61832006-03-31 23:14:57 +1100626.Ql %r
Damien Miller6b1d53c2006-03-31 23:13:21 +1100627(remote user name).
628.Pp
Damien Miller957d4e42005-12-13 19:30:45 +1100629It is possible to have
630multiple identity files specified in configuration files; all these
631identities will be tried in sequence.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100632.It Cm IPQoS
633Specifies the IPv4 type-of-service or DSCP class for connections.
634Accepted values are
635.Dq af11 ,
636.Dq af12 ,
637.Dq af13 ,
638.Dq af14 ,
639.Dq af22 ,
640.Dq af23 ,
641.Dq af31 ,
642.Dq af32 ,
643.Dq af33 ,
644.Dq af41 ,
645.Dq af42 ,
646.Dq af43 ,
647.Dq cs0 ,
648.Dq cs1 ,
649.Dq cs2 ,
650.Dq cs3 ,
651.Dq cs4 ,
652.Dq cs5 ,
653.Dq cs6 ,
654.Dq cs7 ,
655.Dq ef ,
656.Dq lowdelay ,
657.Dq throughput ,
658.Dq reliability ,
659or a numeric value.
Damien Miller928362d2010-12-26 14:26:45 +1100660This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100661If one argument is specified, it is used as the packet class unconditionally.
662If two values are specified, the first is automatically selected for
663interactive sessions and the second for non-interactive sessions.
664The default is
665.Dq lowdelay
666for interactive sessions and
667.Dq throughput
668for non-interactive sessions.
Damien Millercfb606c2007-10-26 14:24:48 +1000669.It Cm KbdInteractiveAuthentication
670Specifies whether to use keyboard-interactive authentication.
671The argument to this keyword must be
672.Dq yes
673or
674.Dq no .
675The default is
676.Dq yes .
Darren Tucker636ca902004-11-05 20:22:00 +1100677.It Cm KbdInteractiveDevices
678Specifies the list of methods to use in keyboard-interactive authentication.
679Multiple method names must be comma-separated.
680The default is to use the server specified list.
Damien Miller9cfbaec2006-03-15 11:57:55 +1100681The methods available vary depending on what the server supports.
682For an OpenSSH server,
683it may be zero or more of:
684.Dq bsdauth ,
685.Dq pam ,
686and
687.Dq skey .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000688.It Cm KexAlgorithms
689Specifies the available KEX (Key Exchange) algorithms.
690Multiple algorithms must be comma-separated.
Damien Miller7fe2b1f2010-09-24 22:11:53 +1000691The default is:
692.Bd -literal -offset indent
693ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
694diffie-hellman-group-exchange-sha256,
695diffie-hellman-group-exchange-sha1,
696diffie-hellman-group14-sha1,
697diffie-hellman-group1-sha1
698.Ed
Damien Millerd27b9472005-12-13 19:29:02 +1100699.It Cm LocalCommand
700Specifies a command to execute on the local machine after successfully
701connecting to the server.
702The command string extends to the end of the line, and is executed with
Darren Tucker63b31cb2007-12-02 23:09:30 +1100703the user's shell.
Darren Tuckerf6b01b72008-06-13 04:56:37 +1000704The following escape character substitutions will be performed:
705.Ql %d
706(local user's home directory),
707.Ql %h
708(remote host name),
709.Ql %l
710(local host name),
711.Ql %n
712(host name as provided on the command line),
713.Ql %p
714(remote port),
715.Ql %r
716(remote user name) or
717.Ql %u
718(local user name).
Darren Tucker78be8c52010-01-08 17:05:59 +1100719.Pp
720The command is run synchronously and does not have access to the
721session of the
722.Xr ssh 1
723that spawned it.
724It should not be used for interactive commands.
725.Pp
Damien Millerd27b9472005-12-13 19:29:02 +1100726This directive is ignored unless
727.Cm PermitLocalCommand
728has been enabled.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000729.It Cm LocalForward
Damien Millere9d001e2006-01-14 10:10:17 +1100730Specifies that a TCP port on the local machine be forwarded over
Ben Lindstrom9f049032002-06-21 00:59:05 +0000731the secure channel to the specified host and port from the remote machine.
Darren Tucker5ede2ad2005-03-31 21:31:10 +1000732The first argument must be
Damien Millerf91ee4c2005-03-01 21:24:33 +1100733.Sm off
Darren Tucker5ede2ad2005-03-31 21:31:10 +1000734.Oo Ar bind_address : Oc Ar port
Damien Millerf91ee4c2005-03-01 21:24:33 +1100735.Sm on
Darren Tucker5ede2ad2005-03-31 21:31:10 +1000736and the second argument must be
737.Ar host : Ns Ar hostport .
Damien Miller7fa96602010-08-05 13:03:13 +1000738IPv6 addresses can be specified by enclosing addresses in square brackets.
Damien Millerf8c55462005-03-02 12:03:05 +1100739Multiple forwardings may be specified, and additional forwardings can be
Damien Millerf91ee4c2005-03-01 21:24:33 +1100740given on the command line.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000741Only the superuser can forward privileged ports.
Damien Millerf91ee4c2005-03-01 21:24:33 +1100742By default, the local port is bound in accordance with the
743.Cm GatewayPorts
744setting.
745However, an explicit
746.Ar bind_address
747may be used to bind the connection to a specific address.
748The
749.Ar bind_address
750of
751.Dq localhost
Damien Millerf8c55462005-03-02 12:03:05 +1100752indicates that the listening port be bound for local use only, while an
753empty address or
754.Sq *
Damien Millerf91ee4c2005-03-01 21:24:33 +1100755indicates that the port should be available from all interfaces.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000756.It Cm LogLevel
757Gives the verbosity level that is used when logging messages from
Damien Miller45ee2b92006-03-15 11:56:18 +1100758.Xr ssh 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000759The possible values are:
Damien Miller45ee2b92006-03-15 11:56:18 +1100760QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000761The default is INFO.
762DEBUG and DEBUG1 are equivalent.
763DEBUG2 and DEBUG3 each specify higher levels of verbose output.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000764.It Cm MACs
765Specifies the MAC (message authentication code) algorithms
766in order of preference.
767The MAC algorithm is used in protocol version 2
768for data integrity protection.
769Multiple algorithms must be comma-separated.
Damien Miller45ee2b92006-03-15 11:56:18 +1100770The default is:
Damien Miller5e7c30b2007-06-11 14:06:32 +1000771.Bd -literal -offset indent
772hmac-md5,hmac-sha1,umac-64@openssh.com,
773hmac-ripemd160,hmac-sha1-96,hmac-md5-96
774.Ed
Ben Lindstrom9f049032002-06-21 00:59:05 +0000775.It Cm NoHostAuthenticationForLocalhost
776This option can be used if the home directory is shared across machines.
777In this case localhost will refer to a different machine on each of
778the machines and the user will get many warnings about changed host keys.
779However, this option disables host authentication for localhost.
780The argument to this keyword must be
781.Dq yes
782or
783.Dq no .
784The default is to check the host key for localhost.
785.It Cm NumberOfPasswordPrompts
786Specifies the number of password prompts before giving up.
787The argument to this keyword must be an integer.
Damien Miller45ee2b92006-03-15 11:56:18 +1100788The default is 3.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000789.It Cm PasswordAuthentication
790Specifies whether to use password authentication.
791The argument to this keyword must be
792.Dq yes
793or
794.Dq no .
795The default is
796.Dq yes .
Damien Millerd27b9472005-12-13 19:29:02 +1100797.It Cm PermitLocalCommand
798Allow local command execution via the
799.Ic LocalCommand
800option or using the
Damien Miller4b2319f2005-12-13 19:30:27 +1100801.Ic !\& Ns Ar command
Damien Millerd27b9472005-12-13 19:29:02 +1100802escape sequence in
803.Xr ssh 1 .
804The argument must be
805.Dq yes
806or
807.Dq no .
808The default is
809.Dq no .
Damien Miller7ea845e2010-02-12 09:21:02 +1100810.It Cm PKCS11Provider
811Specifies which PKCS#11 provider to use.
Damien Miller8e1ea4e2010-11-20 15:20:10 +1100812The argument to this keyword is the PKCS#11 shared library
Damien Miller7ea845e2010-02-12 09:21:02 +1100813.Xr ssh 1
Damien Millera7618442010-02-12 09:26:02 +1100814should use to communicate with a PKCS#11 token providing the user's
Damien Miller7ea845e2010-02-12 09:21:02 +1100815private RSA key.
Damien Miller957d4e42005-12-13 19:30:45 +1100816.It Cm Port
817Specifies the port number to connect on the remote host.
Damien Miller45ee2b92006-03-15 11:56:18 +1100818The default is 22.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000819.It Cm PreferredAuthentications
820Specifies the order in which the client should try protocol 2
Damien Millerfbf486b2003-05-23 18:44:23 +1000821authentication methods.
Darren Tucker1adc2bd2005-03-14 23:14:20 +1100822This allows a client to prefer one method (e.g.\&
Ben Lindstrom9f049032002-06-21 00:59:05 +0000823.Cm keyboard-interactive )
Darren Tucker1adc2bd2005-03-14 23:14:20 +1100824over another method (e.g.\&
Damien Miller544378d2010-04-16 15:52:24 +1000825.Cm password ) .
826The default is:
827.Bd -literal -offset indent
828gssapi-with-mic,hostbased,publickey,
829keyboard-interactive,password
830.Ed
Ben Lindstrom9f049032002-06-21 00:59:05 +0000831.It Cm Protocol
832Specifies the protocol versions
Damien Miller45ee2b92006-03-15 11:56:18 +1100833.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000834should support in order of preference.
835The possible values are
Damien Miller45ee2b92006-03-15 11:56:18 +1100836.Sq 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000837and
Damien Miller45ee2b92006-03-15 11:56:18 +1100838.Sq 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000839Multiple versions must be comma-separated.
Darren Tuckerbad50762009-10-11 21:51:08 +1100840When this option is set to
Darren Tucker7a4a7652009-10-11 21:51:40 +1100841.Dq 2,1
Darren Tuckerbad50762009-10-11 21:51:08 +1100842.Nm ssh
843will try version 2 and fall back to version 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000844if version 2 is not available.
Darren Tuckerbad50762009-10-11 21:51:08 +1100845The default is
Darren Tucker7a4a7652009-10-11 21:51:40 +1100846.Sq 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000847.It Cm ProxyCommand
848Specifies the command to use to connect to the server.
849The command
850string extends to the end of the line, and is executed with
Darren Tucker63b31cb2007-12-02 23:09:30 +1100851the user's shell.
Damien Millerc4eddee2010-04-18 08:07:43 +1000852In the command string, any occurrence of
Ben Lindstrom9f049032002-06-21 00:59:05 +0000853.Ql %h
854will be substituted by the host name to
Damien Millerb1b17042010-04-16 15:54:19 +1000855connect,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000856.Ql %p
Damien Millerc4eddee2010-04-18 08:07:43 +1000857by the port, and
858.Ql %r
Damien Millerb1b17042010-04-16 15:54:19 +1000859by the remote user name.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000860The command can be basically anything,
861and should read from its standard input and write to its standard output.
862It should eventually connect an
863.Xr sshd 8
864server running on some machine, or execute
865.Ic sshd -i
866somewhere.
867Host key management will be done using the
868HostName of the host being connected (defaulting to the name typed by
869the user).
Damien Miller495dca32003-04-01 21:42:14 +1000870Setting the command to
871.Dq none
Damien Miller9f1e33a2003-02-24 11:57:32 +1100872disables this option entirely.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000873Note that
874.Cm CheckHostIP
875is not available for connects with a proxy command.
876.Pp
Damien Millerebcfedc2005-05-26 12:13:56 +1000877This directive is useful in conjunction with
878.Xr nc 1
879and its proxy support.
Damien Millerdfec2942005-05-26 12:14:32 +1000880For example, the following directive would connect via an HTTP proxy at
Damien Millerebcfedc2005-05-26 12:13:56 +1000881192.0.2.0:
882.Bd -literal -offset 3n
883ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p
884.Ed
Ben Lindstrom9f049032002-06-21 00:59:05 +0000885.It Cm PubkeyAuthentication
886Specifies whether to try public key authentication.
887The argument to this keyword must be
888.Dq yes
889or
890.Dq no .
891The default is
892.Dq yes .
893This option applies to protocol version 2 only.
Darren Tucker62388b22006-01-20 11:31:47 +1100894.It Cm RekeyLimit
895Specifies the maximum amount of data that may be transmitted before the
Damien Millerddfddf12006-01-31 21:39:03 +1100896session key is renegotiated.
Darren Tucker62388b22006-01-20 11:31:47 +1100897The argument is the number of bytes, with an optional suffix of
Damien Millerddfddf12006-01-31 21:39:03 +1100898.Sq K ,
899.Sq M ,
Darren Tucker62388b22006-01-20 11:31:47 +1100900or
Damien Millerddfddf12006-01-31 21:39:03 +1100901.Sq G
Darren Tucker62388b22006-01-20 11:31:47 +1100902to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
903The default is between
Damien Miller45ee2b92006-03-15 11:56:18 +1100904.Sq 1G
Darren Tucker62388b22006-01-20 11:31:47 +1100905and
Damien Miller45ee2b92006-03-15 11:56:18 +1100906.Sq 4G ,
Darren Tucker62388b22006-01-20 11:31:47 +1100907depending on the cipher.
Damien Millerddfddf12006-01-31 21:39:03 +1100908This option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000909.It Cm RemoteForward
Damien Millere9d001e2006-01-14 10:10:17 +1100910Specifies that a TCP port on the remote machine be forwarded over
Ben Lindstrom9f049032002-06-21 00:59:05 +0000911the secure channel to the specified host and port from the local machine.
Darren Tucker5ede2ad2005-03-31 21:31:10 +1000912The first argument must be
Damien Millerf91ee4c2005-03-01 21:24:33 +1100913.Sm off
Darren Tucker5ede2ad2005-03-31 21:31:10 +1000914.Oo Ar bind_address : Oc Ar port
Damien Millerf91ee4c2005-03-01 21:24:33 +1100915.Sm on
Darren Tucker5ede2ad2005-03-31 21:31:10 +1000916and the second argument must be
917.Ar host : Ns Ar hostport .
Damien Miller7fa96602010-08-05 13:03:13 +1000918IPv6 addresses can be specified by enclosing addresses in square brackets.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000919Multiple forwardings may be specified, and additional
920forwardings can be given on the command line.
Damien Millerde7532e2008-11-03 19:24:45 +1100921Privileged ports can be forwarded only when
922logging in as root on the remote machine.
Damien Millere379e102009-02-14 16:34:39 +1100923.Pp
Damien Miller85c6d8a2009-02-14 16:34:21 +1100924If the
925.Ar port
926argument is
927.Ql 0 ,
928the listen port will be dynamically allocated on the server and reported
929to the client at run time.
Damien Millerf91ee4c2005-03-01 21:24:33 +1100930.Pp
931If the
932.Ar bind_address
933is not specified, the default is to only bind to loopback addresses.
934If the
935.Ar bind_address
936is
937.Ql *
938or an empty string, then the forwarding is requested to listen on all
939interfaces.
940Specifying a remote
941.Ar bind_address
Damien Millerf8c55462005-03-02 12:03:05 +1100942will only succeed if the server's
943.Cm GatewayPorts
Damien Millerf91ee4c2005-03-01 21:24:33 +1100944option is enabled (see
Damien Millerf8c55462005-03-02 12:03:05 +1100945.Xr sshd_config 5 ) .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000946.It Cm RhostsRSAAuthentication
947Specifies whether to try rhosts based authentication with RSA host
948authentication.
949The argument must be
950.Dq yes
951or
952.Dq no .
953The default is
954.Dq no .
955This option applies to protocol version 1 only and requires
Damien Miller45ee2b92006-03-15 11:56:18 +1100956.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000957to be setuid root.
958.It Cm RSAAuthentication
959Specifies whether to try RSA authentication.
960The argument to this keyword must be
961.Dq yes
962or
963.Dq no .
964RSA authentication will only be
965attempted if the identity file exists, or an authentication agent is
966running.
967The default is
968.Dq yes .
969Note that this option applies to protocol version 1 only.
Darren Tucker46bc0752004-05-02 22:11:30 +1000970.It Cm SendEnv
971Specifies what variables from the local
972.Xr environ 7
973should be sent to the server.
Damien Miller45ee2b92006-03-15 11:56:18 +1100974Note that environment passing is only supported for protocol 2.
975The server must also support it, and the server must be configured to
Darren Tucker1e0c9bf2004-05-02 22:12:48 +1000976accept these environment variables.
Darren Tucker46bc0752004-05-02 22:11:30 +1000977Refer to
978.Cm AcceptEnv
979in
980.Xr sshd_config 5
981for how to configure the server.
Damien Miller6def5512006-03-15 11:54:05 +1100982Variables are specified by name, which may contain wildcard characters.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +1000983Multiple environment variables may be separated by whitespace or spread
Darren Tucker46bc0752004-05-02 22:11:30 +1000984across multiple
985.Cm SendEnv
986directives.
987The default is not to send any environment variables.
Damien Millerf54a4b92006-03-15 11:54:36 +1100988.Pp
989See
990.Sx PATTERNS
991for more information on patterns.
Damien Miller509b0102003-12-17 16:33:10 +1100992.It Cm ServerAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +1100993Sets the number of server alive messages (see below) which may be
Damien Miller509b0102003-12-17 16:33:10 +1100994sent without
Damien Miller45ee2b92006-03-15 11:56:18 +1100995.Xr ssh 1
Damien Miller509b0102003-12-17 16:33:10 +1100996receiving any messages back from the server.
997If this threshold is reached while server alive messages are being sent,
Damien Miller45ee2b92006-03-15 11:56:18 +1100998ssh will disconnect from the server, terminating the session.
Damien Miller509b0102003-12-17 16:33:10 +1100999It is important to note that the use of server alive messages is very
1000different from
1001.Cm TCPKeepAlive
1002(below).
1003The server alive messages are sent through the encrypted channel
1004and therefore will not be spoofable.
1005The TCP keepalive option enabled by
1006.Cm TCPKeepAlive
1007is spoofable.
1008The server alive mechanism is valuable when the client or
1009server depend on knowing when a connection has become inactive.
1010.Pp
1011The default value is 3.
1012If, for example,
1013.Cm ServerAliveInterval
Damien Miller45ee2b92006-03-15 11:56:18 +11001014(see below) is set to 15 and
Damien Miller509b0102003-12-17 16:33:10 +11001015.Cm ServerAliveCountMax
Damien Miller45ee2b92006-03-15 11:56:18 +11001016is left at the default, if the server becomes unresponsive,
1017ssh will disconnect after approximately 45 seconds.
Damien Millercc3e8ba2006-03-15 12:06:55 +11001018This option applies to protocol version 2 only.
Damien Miller957d4e42005-12-13 19:30:45 +11001019.It Cm ServerAliveInterval
1020Sets a timeout interval in seconds after which if no data has been received
1021from the server,
Damien Miller45ee2b92006-03-15 11:56:18 +11001022.Xr ssh 1
Damien Miller957d4e42005-12-13 19:30:45 +11001023will send a message through the encrypted
1024channel to request a response from the server.
1025The default
1026is 0, indicating that these messages will not be sent to the server.
1027This option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001028.It Cm StrictHostKeyChecking
1029If this flag is set to
1030.Dq yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +11001031.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001032will never automatically add host keys to the
Damien Miller167ea5d2005-05-26 12:04:02 +10001033.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +00001034file, and refuses to connect to hosts whose host key has changed.
1035This provides maximum protection against trojan horse attacks,
Damien Miller45ee2b92006-03-15 11:56:18 +11001036though it can be annoying when the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001037.Pa /etc/ssh/ssh_known_hosts
Damien Miller45ee2b92006-03-15 11:56:18 +11001038file is poorly maintained or when connections to new hosts are
Ben Lindstrom9f049032002-06-21 00:59:05 +00001039frequently made.
1040This option forces the user to manually
1041add all new hosts.
1042If this flag is set to
1043.Dq no ,
Damien Miller45ee2b92006-03-15 11:56:18 +11001044ssh will automatically add new host keys to the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001045user known hosts files.
1046If this flag is set to
1047.Dq ask ,
1048new host keys
1049will be added to the user known host files only after the user
1050has confirmed that is what they really want to do, and
Damien Miller45ee2b92006-03-15 11:56:18 +11001051ssh will refuse to connect to hosts whose host key has changed.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001052The host keys of
1053known hosts will be verified automatically in all cases.
1054The argument must be
1055.Dq yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +11001056.Dq no ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001057or
1058.Dq ask .
1059The default is
1060.Dq ask .
Damien Miller12c150e2003-12-17 16:31:10 +11001061.It Cm TCPKeepAlive
1062Specifies whether the system should send TCP keepalive messages to the
1063other side.
1064If they are sent, death of the connection or crash of one
1065of the machines will be properly noticed.
1066However, this means that
1067connections will die if the route is down temporarily, and some people
1068find it annoying.
1069.Pp
1070The default is
1071.Dq yes
1072(to send TCP keepalive messages), and the client will notice
1073if the network goes down or the remote host dies.
1074This is important in scripts, and many users want it too.
1075.Pp
1076To disable TCP keepalive messages, the value should be set to
1077.Dq no .
Damien Millerd27b9472005-12-13 19:29:02 +11001078.It Cm Tunnel
Damien Miller991dba42006-07-10 20:16:27 +10001079Request
Damien Millerd27b9472005-12-13 19:29:02 +11001080.Xr tun 4
Damien Miller7746c392005-12-13 19:33:37 +11001081device forwarding between the client and the server.
Damien Millerd27b9472005-12-13 19:29:02 +11001082The argument must be
Damien Miller7b58e802005-12-13 19:33:19 +11001083.Dq yes ,
Damien Miller991dba42006-07-10 20:16:27 +10001084.Dq point-to-point
1085(layer 3),
1086.Dq ethernet
1087(layer 2),
Damien Millerd27b9472005-12-13 19:29:02 +11001088or
1089.Dq no .
Damien Miller991dba42006-07-10 20:16:27 +10001090Specifying
1091.Dq yes
1092requests the default tunnel mode, which is
1093.Dq point-to-point .
Damien Millerd27b9472005-12-13 19:29:02 +11001094The default is
1095.Dq no .
1096.It Cm TunnelDevice
Damien Miller991dba42006-07-10 20:16:27 +10001097Specifies the
Damien Millerd27b9472005-12-13 19:29:02 +11001098.Xr tun 4
Damien Miller991dba42006-07-10 20:16:27 +10001099devices to open on the client
1100.Pq Ar local_tun
1101and the server
1102.Pq Ar remote_tun .
1103.Pp
1104The argument must be
1105.Sm off
1106.Ar local_tun Op : Ar remote_tun .
1107.Sm on
1108The devices may be specified by numerical ID or the keyword
1109.Dq any ,
1110which uses the next available tunnel device.
1111If
1112.Ar remote_tun
1113is not specified, it defaults to
1114.Dq any .
1115The default is
1116.Dq any:any .
Damien Millere8cd7412005-12-24 14:55:47 +11001117.It Cm UsePrivilegedPort
1118Specifies whether to use a privileged port for outgoing connections.
1119The argument must be
1120.Dq yes
1121or
1122.Dq no .
1123The default is
1124.Dq no .
1125If set to
Damien Miller45ee2b92006-03-15 11:56:18 +11001126.Dq yes ,
1127.Xr ssh 1
Damien Millere8cd7412005-12-24 14:55:47 +11001128must be setuid root.
1129Note that this option must be set to
1130.Dq yes
1131for
1132.Cm RhostsRSAAuthentication
1133with older servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001134.It Cm User
1135Specifies the user to log in as.
1136This can be useful when a different user name is used on different machines.
1137This saves the trouble of
1138having to remember to give the user name on the command line.
1139.It Cm UserKnownHostsFile
1140Specifies a file to use for the user
1141host key database instead of
Damien Miller167ea5d2005-05-26 12:04:02 +10001142.Pa ~/.ssh/known_hosts .
Damien Miller37876e92003-05-15 10:19:46 +10001143.It Cm VerifyHostKeyDNS
1144Specifies whether to verify the remote key using DNS and SSHFP resource
1145records.
Damien Miller150b5572003-11-17 21:19:29 +11001146If this option is set to
1147.Dq yes ,
Damien Millerfe448472003-11-17 21:19:49 +11001148the client will implicitly trust keys that match a secure fingerprint
Damien Miller150b5572003-11-17 21:19:29 +11001149from DNS.
1150Insecure fingerprints will be handled as if this option was set to
1151.Dq ask .
1152If this option is set to
1153.Dq ask ,
1154information on fingerprint match will be displayed, but the user will still
1155need to confirm new host keys according to the
1156.Cm StrictHostKeyChecking
1157option.
1158The argument must be
1159.Dq yes ,
Damien Miller45ee2b92006-03-15 11:56:18 +11001160.Dq no ,
Damien Millerfe448472003-11-17 21:19:49 +11001161or
1162.Dq ask .
Damien Miller37876e92003-05-15 10:19:46 +10001163The default is
1164.Dq no .
Damien Millereacbb4f2003-06-02 19:10:41 +10001165Note that this option applies to protocol version 2 only.
Damien Miller45ee2b92006-03-15 11:56:18 +11001166.Pp
1167See also
1168.Sx VERIFYING HOST KEYS
1169in
1170.Xr ssh 1 .
Damien Miller10288242008-06-30 00:04:03 +10001171.It Cm VisualHostKey
1172If this flag is set to
1173.Dq yes ,
1174an ASCII art representation of the remote host key fingerprint is
Damien Millera414cd32008-11-03 19:25:21 +11001175printed in addition to the hex fingerprint string at login and
1176for unknown host keys.
Damien Miller10288242008-06-30 00:04:03 +10001177If this flag is set to
1178.Dq no ,
Damien Millera414cd32008-11-03 19:25:21 +11001179no fingerprint strings are printed at login and
1180only the hex fingerprint string will be printed for unknown host keys.
Damien Miller10288242008-06-30 00:04:03 +10001181The default is
1182.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001183.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001184Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001185.Xr xauth 1
1186program.
1187The default is
1188.Pa /usr/X11R6/bin/xauth .
1189.El
Damien Millerb5282c22006-03-15 11:59:08 +11001190.Sh PATTERNS
1191A
1192.Em pattern
1193consists of zero or more non-whitespace characters,
1194.Sq *
1195(a wildcard that matches zero or more characters),
1196or
1197.Sq ?\&
1198(a wildcard that matches exactly one character).
1199For example, to specify a set of declarations for any host in the
1200.Dq .co.uk
1201set of domains,
1202the following pattern could be used:
1203.Pp
1204.Dl Host *.co.uk
1205.Pp
1206The following pattern
1207would match any host in the 192.168.0.[0-9] network range:
1208.Pp
1209.Dl Host 192.168.0.?
1210.Pp
1211A
1212.Em pattern-list
1213is a comma-separated list of patterns.
1214Patterns within pattern-lists may be negated
1215by preceding them with an exclamation mark
1216.Pq Sq !\& .
1217For example,
1218to allow a key to be used from anywhere within an organisation
1219except from the
1220.Dq dialup
1221pool,
1222the following entry (in authorized_keys) could be used:
1223.Pp
1224.Dl from=\&"!*.dialup.example.com,*.example.com\&"
Ben Lindstrom9f049032002-06-21 00:59:05 +00001225.Sh FILES
1226.Bl -tag -width Ds
Damien Miller167ea5d2005-05-26 12:04:02 +10001227.It Pa ~/.ssh/config
Ben Lindstrom9f049032002-06-21 00:59:05 +00001228This is the per-user configuration file.
1229The format of this file is described above.
Damien Miller45ee2b92006-03-15 11:56:18 +11001230This file is used by the SSH client.
Damien Millerc970cb92004-04-20 20:12:53 +10001231Because of the potential for abuse, this file must have strict permissions:
1232read/write for the user, and not accessible by others.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001233.It Pa /etc/ssh/ssh_config
1234Systemwide configuration file.
1235This file provides defaults for those
1236values that are not specified in the user's configuration file, and
1237for those users who do not have a configuration file.
1238This file must be world-readable.
1239.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001240.Sh SEE ALSO
1241.Xr ssh 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001242.Sh AUTHORS
1243OpenSSH is a derivative of the original and free
1244ssh 1.2.12 release by Tatu Ylonen.
1245Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1246Theo de Raadt and Dug Song
1247removed many bugs, re-added newer features and
1248created OpenSSH.
1249Markus Friedl contributed the support for SSH
1250protocol versions 1.5 and 2.0.