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 .Dd September 25, 1999
43 .Nd OpenSSH SSH client configuration files
45 .Bl -tag -width Ds -compact
46 .It Pa $HOME/.ssh/config
47 .It Pa /etc/ssh/ssh_config
51 obtains configuration data from the following sources in
53 .Bl -enum -offset indent -compact
57 user's configuration file
58 .Pq Pa $HOME/.ssh/config
60 GSSAPI configuration file (GssapiAuthentication, GssapiDelegateCredentials)
61 .Pq Pa $HOME/.ssh/config.gssapi
63 Kerberos configuration file (KerberosAuthentication, KerberosTgtPassing)
64 .Pq Pa $HOME/.ssh/config.krb
66 AFS configuration file (AfsTokenPassing)
67 .Pq Pa $HOME/.ssh/config.afs
69 system-wide configuration file
70 .Pq Pa /etc/ssh/ssh_config
73 For each parameter, the first obtained value
75 The configuration files contain sections bracketed by
77 specifications, and that section is only applied for hosts that
78 match one of the patterns given in the specification.
79 The matched host name is the one given on the command line.
81 Since the first obtained value for each parameter is used, more
82 host-specific declarations should be given near the beginning of the
83 file, and general defaults at the end.
85 The configuration file has the following format:
87 Empty lines and lines starting with
91 Otherwise a line is of the format
92 .Dq keyword arguments .
93 Configuration options may be separated by whitespace or
94 optional whitespace and exactly one
96 the latter format is useful to avoid the need to quote whitespace
97 when specifying configuration options using the
106 keywords and their meanings are as follows (note that
107 keywords are case-insensitive and arguments are case-sensitive):
110 Restricts the following declarations (up to the next
112 keyword) to be only for those hosts that match one of the patterns
113 given after the keyword.
117 can be used as wildcards in the
121 as a pattern can be used to provide global
122 defaults for all hosts.
125 argument given on the command line (i.e., the name is not converted to
126 a canonicalized host name before matching).
127 .It Cm AFSTokenPassing
128 Specifies whether to pass AFS tokens to remote host.
129 The argument to this keyword must be
133 This option applies to protocol version 1 only.
137 passphrase/password querying will be disabled.
138 This option is useful in scripts and other batch jobs where no user
139 is present to supply the password.
147 Specify the interface to transmit from on machines with multiple
148 interfaces or aliased addresses.
149 Note that this option does not work if
150 .Cm UsePrivilegedPort
153 .It Cm ChallengeResponseAuthentication
154 Specifies whether to use challenge response authentication.
155 The argument to this keyword must be
162 If this flag is set to
164 ssh will additionally check the host IP address in the
167 This allows ssh to detect if a host key changed due to DNS spoofing.
168 If the option is set to
170 the check will not be executed.
174 Specifies the cipher to use for encrypting the session
175 in protocol version 1.
183 is only supported in the
185 client for interoperability with legacy protocol 1 implementations
186 that do not support the
188 cipher. Its use is strongly discouraged due to cryptographic
193 Specifies the ciphers allowed for protocol version 2
194 in order of preference.
195 Multiple ciphers must be comma-separated.
199 ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,
200 aes192-cbc,aes256-cbc''
202 .It Cm ClearAllForwardings
203 Specifies that all local, remote and dynamic port forwardings
204 specified in the configuration files or on the command line be
205 cleared. This option is primarily useful when used from the
207 command line to clear port forwardings set in
208 configuration files, and is automatically set by
219 Specifies whether to use compression.
226 .It Cm CompressionLevel
227 Specifies the compression level to use if compression is enabled.
228 The argument must be an integer from 1 (fast) to 9 (slow, best).
229 The default level is 6, which is good for most applications.
230 The meaning of the values is the same as in
232 Note that this option applies to protocol version 1 only.
233 .It Cm ConnectionAttempts
234 Specifies the number of tries (one per second) to make before exiting.
235 The argument must be an integer.
236 This may be useful in scripts if the connection sometimes fails.
238 .It Cm DynamicForward
239 Specifies that a TCP/IP port on the local machine be forwarded
240 over the secure channel, and the application
241 protocol is then used to determine where to connect to from the
242 remote machine. The argument must be a port number.
243 Currently the SOCKS4 protocol is supported, and
245 will act as a SOCKS4 server.
246 Multiple forwardings may be specified, and
247 additional forwardings can be given on the command line. Only
248 the superuser can forward privileged ports.
250 Sets the escape character (default:
252 The escape character can also
253 be set on the command line.
254 The argument should be a single character,
256 followed by a letter, or
258 to disable the escape
259 character entirely (making the connection transparent for binary
262 Specifies whether the connection to the authentication agent (if any)
263 will be forwarded to the remote machine.
271 Agent forwarding should be enabled with caution. Users with the
272 ability to bypass file permissions on the remote host (for the agent's
273 Unix-domain socket) can access the local agent through the forwarded
274 connection. An attacker cannot obtain key material from the agent,
275 however they can perform operations on the keys that enable them to
276 authenticate using the identities loaded into the agent.
278 Specifies whether X11 connections will be automatically redirected
279 over the secure channel and
289 X11 forwarding should be enabled with caution. Users with the ability
290 to bypass file permissions on the remote host (for the user's X
291 authorization database) can access the local X11 display through the
292 forwarded connection. An attacker may then be able to perform
293 activities such as keystroke monitoring.
295 Specifies whether remote hosts are allowed to connect to local
299 binds local port forwardings to the loopback address. This
300 prevents other remote hosts from connecting to forwarded ports.
302 can be used to specify that
304 should bind local port forwardings to the wildcard address,
305 thus allowing remote hosts to connect to forwarded ports.
312 .It Cm GlobalKnownHostsFile
313 Specifies a file to use for the global
314 host key database instead of
315 .Pa /etc/ssh/ssh_known_hosts .
316 .It Cm GssapiAuthentication
317 Specifies whether authentication based on GSSAPI may be used, either using
318 the result of a successful key exchange, or using GSSAPI user
322 .It Cm GssapiKeyExchange
323 Specifies whether key exchange based on GSSAPI may be used. When using
324 GSSAPI key exchange the server need not have a host key.
327 .It Cm GssapiDelegateCredentials
328 Specifies whether GSSAPI credentials will be delegated (forwarded) to
332 .It Cm HostbasedAuthentication
333 Specifies whether to try rhosts based authentication with public key
341 This option applies to protocol version 2 only and
343 .Cm RhostsRSAAuthentication .
344 .It Cm HostKeyAlgorithms
345 Specifies the protocol version 2 host key algorithms
346 that the client wants to use in order of preference.
347 The default for this option is:
348 .Dq ssh-rsa,ssh-dss .
350 Specifies an alias that should be used instead of the
351 real host name when looking up or saving the host key
352 in the host key database files.
353 This option is useful for tunneling ssh connections
354 or for multiple servers running on a single host.
356 Specifies the real host name to log into.
357 This can be used to specify nicknames or abbreviations for hosts.
358 Default is the name given on the command line.
359 Numeric IP addresses are also permitted (both on the command line and in
363 Specifies a file from which the user's RSA or DSA authentication identity
364 is read. The default is
365 .Pa $HOME/.ssh/identity
366 for protocol version 1, and
367 .Pa $HOME/.ssh/id_rsa
369 .Pa $HOME/.ssh/id_dsa
370 for protocol version 2.
371 Additionally, any identities represented by the authentication agent
372 will be used for authentication.
373 The file name may use the tilde
374 syntax to refer to a user's home directory.
375 It is possible to have
376 multiple identity files specified in configuration files; all these
377 identities will be tried in sequence.
379 Specifies whether the system should send TCP keepalive messages to the
381 If they are sent, death of the connection or crash of one
382 of the machines will be properly noticed.
383 However, this means that
384 connections will die if the route is down temporarily, and some people
389 (to send keepalives), and the client will notice
390 if the network goes down or the remote host dies.
391 This is important in scripts, and many users want it too.
393 To disable keepalives, the value should be set to
395 .It Cm KerberosAuthentication
396 Specifies whether Kerberos authentication will be used.
397 The argument to this keyword must be
401 .It Cm KerberosTgtPassing
402 Specifies whether a Kerberos TGT will be forwarded to the server.
403 This will only work if the Kerberos server is actually an AFS kaserver.
404 The argument to this keyword must be
409 Specifies that a TCP/IP port on the local machine be forwarded over
410 the secure channel to the specified host and port from the remote machine.
411 The first argument must be a port number, and the second must be
413 IPv6 addresses can be specified with an alternative syntax:
415 Multiple forwardings may be specified, and additional
416 forwardings can be given on the command line.
417 Only the superuser can forward privileged ports.
419 Gives the verbosity level that is used when logging messages from
421 The possible values are:
422 QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2 and DEBUG3.
423 The default is INFO. DEBUG and DEBUG1 are equivalent. DEBUG2
424 and DEBUG3 each specify higher levels of verbose output.
426 Specifies the MAC (message authentication code) algorithms
427 in order of preference.
428 The MAC algorithm is used in protocol version 2
429 for data integrity protection.
430 Multiple algorithms must be comma-separated.
432 .Dq hmac-md5,hmac-sha1,hmac-ripemd160,hmac-sha1-96,hmac-md5-96 .
433 .It Cm NoHostAuthenticationForLocalhost
434 This option can be used if the home directory is shared across machines.
435 In this case localhost will refer to a different machine on each of
436 the machines and the user will get many warnings about changed host keys.
437 However, this option disables host authentication for localhost.
438 The argument to this keyword must be
442 The default is to check the host key for localhost.
443 .It Cm NumberOfPasswordPrompts
444 Specifies the number of password prompts before giving up.
445 The argument to this keyword must be an integer.
447 .It Cm PasswordAuthentication
448 Specifies whether to use password authentication.
449 The argument to this keyword must be
456 Specifies the port number to connect on the remote host.
458 .It Cm PreferredAuthentications
459 Specifies the order in which the client should try protocol 2
460 authentication methods. This allows a client to prefer one method (e.g.
461 .Cm keyboard-interactive )
462 over another method (e.g.
464 The default for this option is:
465 .Dq hostbased,external-keyx,gssapi,publickey,keyboard-interactive,password .
467 Specifies the protocol versions
469 should support in order of preference.
470 The possible values are
474 Multiple versions must be comma-separated.
479 tries version 2 and falls back to version 1
480 if version 2 is not available.
482 Specifies the command to use to connect to the server.
484 string extends to the end of the line, and is executed with
486 In the command string,
488 will be substituted by the host name to
492 The command can be basically anything,
493 and should read from its standard input and write to its standard output.
494 It should eventually connect an
496 server running on some machine, or execute
499 Host key management will be done using the
500 HostName of the host being connected (defaulting to the name typed by
504 is not available for connects with a proxy command.
506 .It Cm PubkeyAuthentication
507 Specifies whether to try public key authentication.
508 The argument to this keyword must be
514 This option applies to protocol version 2 only.
516 Specifies that a TCP/IP port on the remote machine be forwarded over
517 the secure channel to the specified host and port from the local machine.
518 The first argument must be a port number, and the second must be
520 IPv6 addresses can be specified with an alternative syntax:
522 Multiple forwardings may be specified, and additional
523 forwardings can be given on the command line.
524 Only the superuser can forward privileged ports.
525 .It Cm RhostsAuthentication
526 Specifies whether to try rhosts based authentication.
528 declaration only affects the client side and has no effect whatsoever
530 Most servers do not permit RhostsAuthentication because it
532 .Cm RhostsRSAAuthentication ) .
533 The argument to this keyword must be
539 This option applies to protocol version 1 only and requires
541 to be setuid root and
542 .Cm UsePrivilegedPort
545 .It Cm RhostsRSAAuthentication
546 Specifies whether to try rhosts based authentication with RSA host
554 This option applies to protocol version 1 only and requires
557 .It Cm RSAAuthentication
558 Specifies whether to try RSA authentication.
559 The argument to this keyword must be
563 RSA authentication will only be
564 attempted if the identity file exists, or an authentication agent is
568 Note that this option applies to protocol version 1 only.
569 .It Cm SmartcardDevice
570 Specifies which smartcard device to use. The argument to this keyword is
573 should use to communicate with a smartcard used for storing the user's
574 private RSA key. By default, no device is specified and smartcard support
576 .It Cm StrictHostKeyChecking
577 If this flag is set to
580 will never automatically add host keys to the
581 .Pa $HOME/.ssh/known_hosts
582 file, and refuses to connect to hosts whose host key has changed.
583 This provides maximum protection against trojan horse attacks,
584 however, can be annoying when the
585 .Pa /etc/ssh/ssh_known_hosts
586 file is poorly maintained, or connections to new hosts are
588 This option forces the user to manually
590 If this flag is set to
593 will automatically add new host keys to the
594 user known hosts files.
595 If this flag is set to
598 will be added to the user known host files only after the user
599 has confirmed that is what they really want to do, and
601 will refuse to connect to hosts whose host key has changed.
603 known hosts will be verified automatically in all cases.
611 .It Cm UsePrivilegedPort
612 Specifies whether to use a privileged port for outgoing connections.
623 Note that this option must be set to
626 .Cm RhostsAuthentication
628 .Cm RhostsRSAAuthentication
629 authentications are needed with older servers.
631 Specifies the user to log in as.
632 This can be useful when a different user name is used on different machines.
633 This saves the trouble of
634 having to remember to give the user name on the command line.
635 .It Cm UserKnownHostsFile
636 Specifies a file to use for the user
637 host key database instead of
638 .Pa $HOME/.ssh/known_hosts .
640 Specifies the full pathname of the
644 .Pa /usr/X11R6/bin/xauth .
648 .It Pa $HOME/.ssh/config
649 This is the per-user configuration file.
650 The format of this file is described above.
651 This file is used by the
654 This file does not usually contain any sensitive information,
655 but the recommended permissions are read/write for the user, and not
656 accessible by others.
657 .It Pa /etc/ssh/ssh_config
658 Systemwide configuration file.
659 This file provides defaults for those
660 values that are not specified in the user's configuration file, and
661 for those users who do not have a configuration file.
662 This file must be world-readable.
665 OpenSSH is a derivative of the original and free
666 ssh 1.2.12 release by Tatu Ylonen.
667 Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
668 Theo de Raadt and Dug Song
669 removed many bugs, re-added newer features and
671 Markus Friedl contributed the support for SSH
672 protocol versions 1.5 and 2.0.