3 .\" Author: Tatu Ylonen <ylo@cs.hut.fi>
4 .\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
5 .\" All rights reserved
7 .\" As far as I am concerned, the code I have written for this software
8 .\" can be used freely for any purpose. Any derived versions of this
9 .\" software must be clearly marked as such, and if the derived work is
10 .\" incompatible with the protocol description in the RFC file, it must be
11 .\" called by a name other than "ssh" or "Secure Shell".
13 .\" Copyright (c) 1999,2000 Markus Friedl. All rights reserved.
14 .\" Copyright (c) 1999 Aaron Campbell. All rights reserved.
15 .\" Copyright (c) 1999 Theo de Raadt. All rights reserved.
17 .\" Redistribution and use in source and binary forms, with or without
18 .\" modification, are permitted provided that the following conditions
20 .\" 1. Redistributions of source code must retain the above copyright
21 .\" notice, this list of conditions and the following disclaimer.
22 .\" 2. Redistributions in binary form must reproduce the above copyright
23 .\" notice, this list of conditions and the following disclaimer in the
24 .\" documentation and/or other materials provided with the distribution.
26 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
27 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
28 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
29 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
30 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
31 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 .\" $OpenBSD: ssh_config.5,v 1.5 2002/08/29 22:54:10 stevesk Exp $
38 .\" $FreeBSD: src/crypto/openssh/ssh_config.5,v 1.4.2.4 2003/02/11 12:11:54 des Exp $
39 .\" $DragonFly: src/crypto/openssh/Attic/ssh_config.5,v 1.2 2003/06/17 04:24:36 dillon Exp $
40 .Dd September 25, 1999
45 .Nd OpenSSH SSH client configuration files
47 .Bl -tag -width Ds -compact
48 .It Pa $HOME/.ssh/config
49 .It Pa /etc/ssh/ssh_config
53 obtains configuration data from the following sources in
55 .Bl -enum -offset indent -compact
59 user's configuration file
60 .Pq Pa $HOME/.ssh/config
62 system-wide configuration file
63 .Pq Pa /etc/ssh/ssh_config
66 For each parameter, the first obtained value
68 The configuration files contain sections bracketed by
70 specifications, and that section is only applied for hosts that
71 match one of the patterns given in the specification.
72 The matched host name is the one given on the command line.
74 Since the first obtained value for each parameter is used, more
75 host-specific declarations should be given near the beginning of the
76 file, and general defaults at the end.
78 The configuration file has the following format:
80 Empty lines and lines starting with
84 Otherwise a line is of the format
85 .Dq keyword arguments .
86 Configuration options may be separated by whitespace or
87 optional whitespace and exactly one
89 the latter format is useful to avoid the need to quote whitespace
90 when specifying configuration options using the
99 keywords and their meanings are as follows (note that
100 keywords are case-insensitive and arguments are case-sensitive):
103 Restricts the following declarations (up to the next
105 keyword) to be only for those hosts that match one of the patterns
106 given after the keyword.
110 can be used as wildcards in the
114 as a pattern can be used to provide global
115 defaults for all hosts.
118 argument given on the command line (i.e., the name is not converted to
119 a canonicalized host name before matching).
120 .It Cm AFSTokenPassing
121 Specifies whether to pass AFS tokens to remote host.
122 The argument to this keyword must be
126 This option applies to protocol version 1 only.
130 passphrase/password querying will be disabled.
131 This option is useful in scripts and other batch jobs where no user
132 is present to supply the password.
140 Specify the interface to transmit from on machines with multiple
141 interfaces or aliased addresses.
142 Note that this option does not work if
143 .Cm UsePrivilegedPort
146 .It Cm ChallengeResponseAuthentication
147 Specifies whether to use challenge response authentication.
148 The argument to this keyword must be
155 If this flag is set to
157 ssh will additionally check the host IP address in the
160 This allows ssh to detect if a host key changed due to DNS spoofing.
161 If the option is set to
163 the check will not be executed.
167 Specifies the cipher to use for encrypting the session
168 in protocol version 1.
176 is only supported in the
178 client for interoperability with legacy protocol 1 implementations
179 that do not support the
181 cipher. Its use is strongly discouraged due to cryptographic
186 Specifies the ciphers allowed for protocol version 2
187 in order of preference.
188 Multiple ciphers must be comma-separated.
192 ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,
193 aes192-cbc,aes256-cbc''
195 .It Cm ClearAllForwardings
196 Specifies that all local, remote and dynamic port forwardings
197 specified in the configuration files or on the command line be
198 cleared. This option is primarily useful when used from the
200 command line to clear port forwardings set in
201 configuration files, and is automatically set by
212 Specifies whether to use compression.
219 .It Cm CompressionLevel
220 Specifies the compression level to use if compression is enabled.
221 The argument must be an integer from 1 (fast) to 9 (slow, best).
222 The default level is 6, which is good for most applications.
223 The meaning of the values is the same as in
225 Note that this option applies to protocol version 1 only.
226 .It Cm ConnectionAttempts
227 Specifies the number of tries (one per second) to make before exiting.
228 The argument must be an integer.
229 This may be useful in scripts if the connection sometimes fails.
231 .It Cm DynamicForward
232 Specifies that a TCP/IP port on the local machine be forwarded
233 over the secure channel, and the application
234 protocol is then used to determine where to connect to from the
235 remote machine. The argument must be a port number.
236 Currently the SOCKS4 protocol is supported, and
238 will act as a SOCKS4 server.
239 Multiple forwardings may be specified, and
240 additional forwardings can be given on the command line. Only
241 the superuser can forward privileged ports.
243 Sets the escape character (default:
245 The escape character can also
246 be set on the command line.
247 The argument should be a single character,
249 followed by a letter, or
251 to disable the escape
252 character entirely (making the connection transparent for binary
255 Specifies whether the connection to the authentication agent (if any)
256 will be forwarded to the remote machine.
264 Agent forwarding should be enabled with caution. Users with the
265 ability to bypass file permissions on the remote host (for the agent's
266 Unix-domain socket) can access the local agent through the forwarded
267 connection. An attacker cannot obtain key material from the agent,
268 however they can perform operations on the keys that enable them to
269 authenticate using the identities loaded into the agent.
271 Specifies whether X11 connections will be automatically redirected
272 over the secure channel and
282 X11 forwarding should be enabled with caution. Users with the ability
283 to bypass file permissions on the remote host (for the user's X
284 authorization database) can access the local X11 display through the
285 forwarded connection. An attacker may then be able to perform
286 activities such as keystroke monitoring.
288 Specifies whether remote hosts are allowed to connect to local
292 binds local port forwardings to the loopback address. This
293 prevents other remote hosts from connecting to forwarded ports.
295 can be used to specify that
297 should bind local port forwardings to the wildcard address,
298 thus allowing remote hosts to connect to forwarded ports.
305 .It Cm GlobalKnownHostsFile
306 Specifies a file to use for the global
307 host key database instead of
308 .Pa /etc/ssh/ssh_known_hosts .
309 .It Cm HostbasedAuthentication
310 Specifies whether to try rhosts based authentication with public key
318 This option applies to protocol version 2 only and
320 .Cm RhostsRSAAuthentication .
321 .It Cm HostKeyAlgorithms
322 Specifies the protocol version 2 host key algorithms
323 that the client wants to use in order of preference.
324 The default for this option is:
325 .Dq ssh-rsa,ssh-dss .
327 Specifies an alias that should be used instead of the
328 real host name when looking up or saving the host key
329 in the host key database files.
330 This option is useful for tunneling ssh connections
331 or for multiple servers running on a single host.
333 Specifies the real host name to log into.
334 This can be used to specify nicknames or abbreviations for hosts.
335 Default is the name given on the command line.
336 Numeric IP addresses are also permitted (both on the command line and in
340 Specifies a file from which the user's RSA or DSA authentication identity
341 is read. The default is
342 .Pa $HOME/.ssh/identity
343 for protocol version 1, and
344 .Pa $HOME/.ssh/id_rsa
346 .Pa $HOME/.ssh/id_dsa
347 for protocol version 2.
348 Additionally, any identities represented by the authentication agent
349 will be used for authentication.
350 The file name may use the tilde
351 syntax to refer to a user's home directory.
352 It is possible to have
353 multiple identity files specified in configuration files; all these
354 identities will be tried in sequence.
356 Specifies whether the system should send TCP keepalive messages to the
358 If they are sent, death of the connection or crash of one
359 of the machines will be properly noticed.
360 However, this means that
361 connections will die if the route is down temporarily, and some people
366 (to send keepalives), and the client will notice
367 if the network goes down or the remote host dies.
368 This is important in scripts, and many users want it too.
370 To disable keepalives, the value should be set to
372 .It Cm KerberosAuthentication
373 Specifies whether Kerberos authentication will be used.
374 The argument to this keyword must be
378 .It Cm KerberosTgtPassing
379 Specifies whether a Kerberos TGT will be forwarded to the server.
380 This will only work if the Kerberos server is actually an AFS kaserver.
381 The argument to this keyword must be
386 Specifies that a TCP/IP port on the local machine be forwarded over
387 the secure channel to the specified host and port from the remote machine.
388 The first argument must be a port number, and the second must be
390 IPv6 addresses can be specified with an alternative syntax:
392 Multiple forwardings may be specified, and additional
393 forwardings can be given on the command line.
394 Only the superuser can forward privileged ports.
396 Gives the verbosity level that is used when logging messages from
398 The possible values are:
399 QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2 and DEBUG3.
400 The default is INFO. DEBUG and DEBUG1 are equivalent. DEBUG2
401 and DEBUG3 each specify higher levels of verbose output.
403 Specifies the MAC (message authentication code) algorithms
404 in order of preference.
405 The MAC algorithm is used in protocol version 2
406 for data integrity protection.
407 Multiple algorithms must be comma-separated.
409 .Dq hmac-md5,hmac-sha1,hmac-ripemd160,hmac-sha1-96,hmac-md5-96 .
410 .It Cm NoHostAuthenticationForLocalhost
411 This option can be used if the home directory is shared across machines.
412 In this case localhost will refer to a different machine on each of
413 the machines and the user will get many warnings about changed host keys.
414 However, this option disables host authentication for localhost.
415 The argument to this keyword must be
419 The default is to check the host key for localhost.
420 .It Cm NumberOfPasswordPrompts
421 Specifies the number of password prompts before giving up.
422 The argument to this keyword must be an integer.
424 .It Cm PasswordAuthentication
425 Specifies whether to use password authentication.
426 The argument to this keyword must be
433 Specifies the port number to connect on the remote host.
435 .It Cm PreferredAuthentications
436 Specifies the order in which the client should try protocol 2
437 authentication methods. This allows a client to prefer one method (e.g.
438 .Cm keyboard-interactive )
439 over another method (e.g.
441 The default for this option is:
442 .Dq hostbased,publickey,keyboard-interactive,password .
444 Specifies the protocol versions
446 should support in order of preference.
447 The possible values are
451 Multiple versions must be comma-separated.
456 tries version 2 and falls back to version 1
457 if version 2 is not available.
459 Specifies the command to use to connect to the server.
461 string extends to the end of the line, and is executed with
463 In the command string,
465 will be substituted by the host name to
469 The command can be basically anything,
470 and should read from its standard input and write to its standard output.
471 It should eventually connect an
473 server running on some machine, or execute
476 Host key management will be done using the
477 HostName of the host being connected (defaulting to the name typed by
481 is not available for connects with a proxy command.
483 .It Cm PubkeyAuthentication
484 Specifies whether to try public key authentication.
485 The argument to this keyword must be
491 This option applies to protocol version 2 only.
493 Specifies that a TCP/IP port on the remote machine be forwarded over
494 the secure channel to the specified host and port from the local machine.
495 The first argument must be a port number, and the second must be
497 IPv6 addresses can be specified with an alternative syntax:
499 Multiple forwardings may be specified, and additional
500 forwardings can be given on the command line.
501 Only the superuser can forward privileged ports.
502 .It Cm RhostsAuthentication
503 Specifies whether to try rhosts based authentication.
505 declaration only affects the client side and has no effect whatsoever
507 Most servers do not permit RhostsAuthentication because it
509 .Cm RhostsRSAAuthentication ) .
510 The argument to this keyword must be
516 This option applies to protocol version 1 only and requires
518 to be setuid root and
519 .Cm UsePrivilegedPort
522 .It Cm RhostsRSAAuthentication
523 Specifies whether to try rhosts based authentication with RSA host
531 This option applies to protocol version 1 only and requires
534 .It Cm RSAAuthentication
535 Specifies whether to try RSA authentication.
536 The argument to this keyword must be
540 RSA authentication will only be
541 attempted if the identity file exists, or an authentication agent is
545 Note that this option applies to protocol version 1 only.
546 .It Cm SmartcardDevice
547 Specifies which smartcard device to use. The argument to this keyword is
550 should use to communicate with a smartcard used for storing the user's
551 private RSA key. By default, no device is specified and smartcard support
553 .It Cm StrictHostKeyChecking
554 If this flag is set to
557 will never automatically add host keys to the
558 .Pa $HOME/.ssh/known_hosts
559 file, and refuses to connect to hosts whose host key has changed.
560 This provides maximum protection against trojan horse attacks,
561 however, can be annoying when the
562 .Pa /etc/ssh/ssh_known_hosts
563 file is poorly maintained, or connections to new hosts are
565 This option forces the user to manually
567 If this flag is set to
570 will automatically add new host keys to the
571 user known hosts files.
572 If this flag is set to
575 will be added to the user known host files only after the user
576 has confirmed that is what they really want to do, and
578 will refuse to connect to hosts whose host key has changed.
580 known hosts will be verified automatically in all cases.
588 .It Cm UsePrivilegedPort
589 Specifies whether to use a privileged port for outgoing connections.
600 Note that this option must be set to
603 .Cm RhostsAuthentication
605 .Cm RhostsRSAAuthentication
606 authentications are needed with older servers.
608 Specifies the user to log in as.
609 This can be useful when a different user name is used on different machines.
610 This saves the trouble of
611 having to remember to give the user name on the command line.
612 .It Cm UserKnownHostsFile
613 Specifies a file to use for the user
614 host key database instead of
615 .Pa $HOME/.ssh/known_hosts .
616 .It Cm VersionAddendum
617 Specifies a string to append to the regular version string to identify
618 OS- or site-specific modifications.
620 .Dq FreeBSD-20030201 .
622 Specifies the full pathname of the
626 .Pa /usr/X11R6/bin/xauth .
630 .It Pa $HOME/.ssh/config
631 This is the per-user configuration file.
632 The format of this file is described above.
633 This file is used by the
636 This file does not usually contain any sensitive information,
637 but the recommended permissions are read/write for the user, and not
638 accessible by others.
639 .It Pa /etc/ssh/ssh_config
640 Systemwide configuration file.
641 This file provides defaults for those
642 values that are not specified in the user's configuration file, and
643 for those users who do not have a configuration file.
644 This file must be world-readable.
647 OpenSSH is a derivative of the original and free
648 ssh 1.2.12 release by Tatu Ylonen.
649 Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
650 Theo de Raadt and Dug Song
651 removed many bugs, re-added newer features and
653 Markus Friedl contributed the support for SSH
654 protocol versions 1.5 and 2.0.