Annotation of src/usr.bin/ssh/ssh_config.5, Revision 1.10
1.1 stevesk 1: .\" -*- nroff -*-
2: .\"
3: .\" Author: Tatu Ylonen <ylo@cs.hut.fi>
4: .\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
5: .\" All rights reserved
6: .\"
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".
12: .\"
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.
16: .\"
17: .\" Redistribution and use in source and binary forms, with or without
18: .\" modification, are permitted provided that the following conditions
19: .\" are met:
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.
25: .\"
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.
36: .\"
1.10 ! djm 37: .\" $OpenBSD: ssh_config.5,v 1.9 2003/05/15 14:55:25 djm Exp $
1.1 stevesk 38: .Dd September 25, 1999
39: .Dt SSH_CONFIG 5
40: .Os
41: .Sh NAME
42: .Nm ssh_config
43: .Nd OpenSSH SSH client configuration files
44: .Sh SYNOPSIS
45: .Bl -tag -width Ds -compact
46: .It Pa $HOME/.ssh/config
47: .It Pa /etc/ssh/ssh_config
48: .El
49: .Sh DESCRIPTION
50: .Nm ssh
51: obtains configuration data from the following sources in
52: the following order:
1.2 stevesk 53: .Bl -enum -offset indent -compact
54: .It
55: command-line options
56: .It
57: user's configuration file
58: .Pq Pa $HOME/.ssh/config
59: .It
60: system-wide configuration file
61: .Pq Pa /etc/ssh/ssh_config
62: .El
1.1 stevesk 63: .Pp
64: For each parameter, the first obtained value
65: will be used.
66: The configuration files contain sections bracketed by
67: .Dq Host
68: specifications, and that section is only applied for hosts that
69: match one of the patterns given in the specification.
70: The matched host name is the one given on the command line.
71: .Pp
72: Since the first obtained value for each parameter is used, more
73: host-specific declarations should be given near the beginning of the
74: file, and general defaults at the end.
75: .Pp
76: The configuration file has the following format:
77: .Pp
78: Empty lines and lines starting with
79: .Ql #
80: are comments.
81: .Pp
82: Otherwise a line is of the format
83: .Dq keyword arguments .
84: Configuration options may be separated by whitespace or
85: optional whitespace and exactly one
86: .Ql = ;
87: the latter format is useful to avoid the need to quote whitespace
88: when specifying configuration options using the
89: .Nm ssh ,
90: .Nm scp
91: and
92: .Nm sftp
93: .Fl o
94: option.
95: .Pp
96: The possible
97: keywords and their meanings are as follows (note that
98: keywords are case-insensitive and arguments are case-sensitive):
99: .Bl -tag -width Ds
100: .It Cm Host
101: Restricts the following declarations (up to the next
102: .Cm Host
103: keyword) to be only for those hosts that match one of the patterns
104: given after the keyword.
105: .Ql \&*
106: and
107: .Ql ?
108: can be used as wildcards in the
109: patterns.
110: A single
111: .Ql \&*
112: as a pattern can be used to provide global
113: defaults for all hosts.
114: The host is the
115: .Ar hostname
116: argument given on the command line (i.e., the name is not converted to
117: a canonicalized host name before matching).
1.10 ! djm 118: .It Cm AddressFamily
! 119: Specifies which address family to use when connecting. Valid arguments are
! 120: .Dq any ,
! 121: .Dq inet
! 122: (Use IPv4 only) or
! 123: .Dq inet6
! 124: (Use IPv6 only.)
1.1 stevesk 125: .It Cm AFSTokenPassing
126: Specifies whether to pass AFS tokens to remote host.
127: The argument to this keyword must be
128: .Dq yes
129: or
130: .Dq no .
131: This option applies to protocol version 1 only.
132: .It Cm BatchMode
133: If set to
134: .Dq yes ,
135: passphrase/password querying will be disabled.
136: This option is useful in scripts and other batch jobs where no user
137: is present to supply the password.
138: The argument must be
139: .Dq yes
140: or
141: .Dq no .
142: The default is
143: .Dq no .
144: .It Cm BindAddress
145: Specify the interface to transmit from on machines with multiple
146: interfaces or aliased addresses.
147: Note that this option does not work if
148: .Cm UsePrivilegedPort
149: is set to
150: .Dq yes .
151: .It Cm ChallengeResponseAuthentication
152: Specifies whether to use challenge response authentication.
153: The argument to this keyword must be
154: .Dq yes
155: or
156: .Dq no .
157: The default is
158: .Dq yes .
159: .It Cm CheckHostIP
160: If this flag is set to
161: .Dq yes ,
162: ssh will additionally check the host IP address in the
163: .Pa known_hosts
164: file.
165: This allows ssh to detect if a host key changed due to DNS spoofing.
166: If the option is set to
167: .Dq no ,
168: the check will not be executed.
169: The default is
170: .Dq yes .
171: .It Cm Cipher
172: Specifies the cipher to use for encrypting the session
173: in protocol version 1.
174: Currently,
175: .Dq blowfish ,
176: .Dq 3des ,
177: and
178: .Dq des
179: are supported.
180: .Ar des
181: is only supported in the
182: .Nm ssh
183: client for interoperability with legacy protocol 1 implementations
184: that do not support the
185: .Ar 3des
1.7 jmc 186: cipher.
187: Its use is strongly discouraged due to cryptographic weaknesses.
1.1 stevesk 188: The default is
189: .Dq 3des .
190: .It Cm Ciphers
191: Specifies the ciphers allowed for protocol version 2
192: in order of preference.
193: Multiple ciphers must be comma-separated.
194: The default is
195: .Pp
196: .Bd -literal
197: ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,
198: aes192-cbc,aes256-cbc''
199: .Ed
200: .It Cm ClearAllForwardings
201: Specifies that all local, remote and dynamic port forwardings
202: specified in the configuration files or on the command line be
1.7 jmc 203: cleared.
204: This option is primarily useful when used from the
1.1 stevesk 205: .Nm ssh
206: command line to clear port forwardings set in
207: configuration files, and is automatically set by
208: .Xr scp 1
209: and
210: .Xr sftp 1 .
211: The argument must be
212: .Dq yes
213: or
214: .Dq no .
215: The default is
216: .Dq no .
217: .It Cm Compression
218: Specifies whether to use compression.
219: The argument must be
220: .Dq yes
221: or
222: .Dq no .
223: The default is
224: .Dq no .
225: .It Cm CompressionLevel
226: Specifies the compression level to use if compression is enabled.
227: The argument must be an integer from 1 (fast) to 9 (slow, best).
228: The default level is 6, which is good for most applications.
229: The meaning of the values is the same as in
230: .Xr gzip 1 .
231: Note that this option applies to protocol version 1 only.
232: .It Cm ConnectionAttempts
233: Specifies the number of tries (one per second) to make before exiting.
234: The argument must be an integer.
235: This may be useful in scripts if the connection sometimes fails.
236: The default is 1.
1.9 djm 237: .It Cm ConnectTimeout
238: Specifies the timeout (in seconds) used when connecting to the ssh
239: server, instead of using the default system TCP timeout. This value is
240: used only when the target is down or really unreachable, not when it
241: refuses the connection.
1.1 stevesk 242: .It Cm DynamicForward
243: Specifies that a TCP/IP port on the local machine be forwarded
244: over the secure channel, and the application
245: protocol is then used to determine where to connect to from the
1.7 jmc 246: remote machine.
247: The argument must be a port number.
1.1 stevesk 248: Currently the SOCKS4 protocol is supported, and
249: .Nm ssh
250: will act as a SOCKS4 server.
251: Multiple forwardings may be specified, and
1.7 jmc 252: additional forwardings can be given on the command line.
253: Only the superuser can forward privileged ports.
1.1 stevesk 254: .It Cm EscapeChar
255: Sets the escape character (default:
256: .Ql ~ ) .
257: The escape character can also
258: be set on the command line.
259: The argument should be a single character,
260: .Ql ^
261: followed by a letter, or
262: .Dq none
263: to disable the escape
264: character entirely (making the connection transparent for binary
265: data).
266: .It Cm ForwardAgent
267: Specifies whether the connection to the authentication agent (if any)
268: will be forwarded to the remote machine.
269: The argument must be
270: .Dq yes
271: or
272: .Dq no .
273: The default is
274: .Dq no .
1.3 stevesk 275: .Pp
1.7 jmc 276: Agent forwarding should be enabled with caution.
277: Users with the ability to bypass file permissions on the remote host
278: (for the agent's Unix-domain socket)
279: can access the local agent through the forwarded connection.
280: An attacker cannot obtain key material from the agent,
1.3 stevesk 281: however they can perform operations on the keys that enable them to
282: authenticate using the identities loaded into the agent.
1.1 stevesk 283: .It Cm ForwardX11
284: Specifies whether X11 connections will be automatically redirected
285: over the secure channel and
286: .Ev DISPLAY
287: set.
288: The argument must be
289: .Dq yes
290: or
291: .Dq no .
292: The default is
293: .Dq no .
1.3 stevesk 294: .Pp
1.7 jmc 295: X11 forwarding should be enabled with caution.
296: Users with the ability to bypass file permissions on the remote host
297: (for the user's X authorization database)
298: can access the local X11 display through the forwarded connection.
299: An attacker may then be able to perform activities such as keystroke monitoring.
1.1 stevesk 300: .It Cm GatewayPorts
301: Specifies whether remote hosts are allowed to connect to local
302: forwarded ports.
303: By default,
304: .Nm ssh
1.7 jmc 305: binds local port forwardings to the loopback address.
306: This prevents other remote hosts from connecting to forwarded ports.
1.1 stevesk 307: .Cm GatewayPorts
308: can be used to specify that
309: .Nm ssh
310: should bind local port forwardings to the wildcard address,
311: thus allowing remote hosts to connect to forwarded ports.
312: The argument must be
313: .Dq yes
314: or
315: .Dq no .
316: The default is
317: .Dq no .
318: .It Cm GlobalKnownHostsFile
319: Specifies a file to use for the global
320: host key database instead of
321: .Pa /etc/ssh/ssh_known_hosts .
322: .It Cm HostbasedAuthentication
323: Specifies whether to try rhosts based authentication with public key
324: authentication.
325: The argument must be
326: .Dq yes
327: or
328: .Dq no .
329: The default is
330: .Dq no .
331: This option applies to protocol version 2 only and
332: is similar to
333: .Cm RhostsRSAAuthentication .
334: .It Cm HostKeyAlgorithms
335: Specifies the protocol version 2 host key algorithms
336: that the client wants to use in order of preference.
337: The default for this option is:
338: .Dq ssh-rsa,ssh-dss .
339: .It Cm HostKeyAlias
340: Specifies an alias that should be used instead of the
341: real host name when looking up or saving the host key
342: in the host key database files.
343: This option is useful for tunneling ssh connections
344: or for multiple servers running on a single host.
345: .It Cm HostName
346: Specifies the real host name to log into.
347: This can be used to specify nicknames or abbreviations for hosts.
348: Default is the name given on the command line.
349: Numeric IP addresses are also permitted (both on the command line and in
350: .Cm HostName
351: specifications).
352: .It Cm IdentityFile
353: Specifies a file from which the user's RSA or DSA authentication identity
354: is read. The default is
355: .Pa $HOME/.ssh/identity
356: for protocol version 1, and
357: .Pa $HOME/.ssh/id_rsa
358: and
359: .Pa $HOME/.ssh/id_dsa
360: for protocol version 2.
361: Additionally, any identities represented by the authentication agent
362: will be used for authentication.
363: The file name may use the tilde
364: syntax to refer to a user's home directory.
365: It is possible to have
366: multiple identity files specified in configuration files; all these
367: identities will be tried in sequence.
368: .It Cm KeepAlive
369: Specifies whether the system should send TCP keepalive messages to the
370: other side.
371: If they are sent, death of the connection or crash of one
372: of the machines will be properly noticed.
373: However, this means that
374: connections will die if the route is down temporarily, and some people
375: find it annoying.
376: .Pp
377: The default is
378: .Dq yes
379: (to send keepalives), and the client will notice
380: if the network goes down or the remote host dies.
381: This is important in scripts, and many users want it too.
382: .Pp
383: To disable keepalives, the value should be set to
384: .Dq no .
385: .It Cm KerberosAuthentication
386: Specifies whether Kerberos authentication will be used.
387: The argument to this keyword must be
388: .Dq yes
389: or
390: .Dq no .
391: .It Cm KerberosTgtPassing
392: Specifies whether a Kerberos TGT will be forwarded to the server.
393: This will only work if the Kerberos server is actually an AFS kaserver.
394: The argument to this keyword must be
395: .Dq yes
396: or
397: .Dq no .
398: .It Cm LocalForward
399: Specifies that a TCP/IP port on the local machine be forwarded over
400: the secure channel to the specified host and port from the remote machine.
401: The first argument must be a port number, and the second must be
402: .Ar host:port .
403: IPv6 addresses can be specified with an alternative syntax:
404: .Ar host/port .
405: Multiple forwardings may be specified, and additional
406: forwardings can be given on the command line.
407: Only the superuser can forward privileged ports.
408: .It Cm LogLevel
409: Gives the verbosity level that is used when logging messages from
410: .Nm ssh .
411: The possible values are:
412: QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2 and DEBUG3.
1.7 jmc 413: The default is INFO.
414: DEBUG and DEBUG1 are equivalent.
415: DEBUG2 and DEBUG3 each specify higher levels of verbose output.
1.1 stevesk 416: .It Cm MACs
417: Specifies the MAC (message authentication code) algorithms
418: in order of preference.
419: The MAC algorithm is used in protocol version 2
420: for data integrity protection.
421: Multiple algorithms must be comma-separated.
422: The default is
423: .Dq hmac-md5,hmac-sha1,hmac-ripemd160,hmac-sha1-96,hmac-md5-96 .
424: .It Cm NoHostAuthenticationForLocalhost
425: This option can be used if the home directory is shared across machines.
426: In this case localhost will refer to a different machine on each of
427: the machines and the user will get many warnings about changed host keys.
428: However, this option disables host authentication for localhost.
429: The argument to this keyword must be
430: .Dq yes
431: or
432: .Dq no .
433: The default is to check the host key for localhost.
434: .It Cm NumberOfPasswordPrompts
435: Specifies the number of password prompts before giving up.
436: The argument to this keyword must be an integer.
437: Default is 3.
438: .It Cm PasswordAuthentication
439: Specifies whether to use password authentication.
440: The argument to this keyword must be
441: .Dq yes
442: or
443: .Dq no .
444: The default is
445: .Dq yes .
446: .It Cm Port
447: Specifies the port number to connect on the remote host.
448: Default is 22.
449: .It Cm PreferredAuthentications
450: Specifies the order in which the client should try protocol 2
451: authentication methods. This allows a client to prefer one method (e.g.
452: .Cm keyboard-interactive )
453: over another method (e.g.
454: .Cm password )
455: The default for this option is:
456: .Dq hostbased,publickey,keyboard-interactive,password .
457: .It Cm Protocol
458: Specifies the protocol versions
459: .Nm ssh
460: should support in order of preference.
461: The possible values are
462: .Dq 1
463: and
464: .Dq 2 .
465: Multiple versions must be comma-separated.
466: The default is
467: .Dq 2,1 .
468: This means that
469: .Nm ssh
470: tries version 2 and falls back to version 1
471: if version 2 is not available.
472: .It Cm ProxyCommand
473: Specifies the command to use to connect to the server.
474: The command
475: string extends to the end of the line, and is executed with
476: .Pa /bin/sh .
477: In the command string,
478: .Ql %h
479: will be substituted by the host name to
480: connect and
481: .Ql %p
482: by the port.
483: The command can be basically anything,
484: and should read from its standard input and write to its standard output.
485: It should eventually connect an
486: .Xr sshd 8
487: server running on some machine, or execute
488: .Ic sshd -i
489: somewhere.
490: Host key management will be done using the
491: HostName of the host being connected (defaulting to the name typed by
492: the user).
1.7 jmc 493: Setting the command to
494: .Dq none
1.6 markus 495: disables this option entirely.
1.1 stevesk 496: Note that
497: .Cm CheckHostIP
498: is not available for connects with a proxy command.
499: .Pp
500: .It Cm PubkeyAuthentication
501: Specifies whether to try public key authentication.
502: The argument to this keyword must be
503: .Dq yes
504: or
505: .Dq no .
506: The default is
507: .Dq yes .
508: This option applies to protocol version 2 only.
509: .It Cm RemoteForward
510: Specifies that a TCP/IP port on the remote machine be forwarded over
511: the secure channel to the specified host and port from the local machine.
512: The first argument must be a port number, and the second must be
513: .Ar host:port .
514: IPv6 addresses can be specified with an alternative syntax:
515: .Ar host/port .
516: Multiple forwardings may be specified, and additional
517: forwardings can be given on the command line.
518: Only the superuser can forward privileged ports.
519: .It Cm RhostsAuthentication
520: Specifies whether to try rhosts based authentication.
521: Note that this
522: declaration only affects the client side and has no effect whatsoever
523: on security.
524: Most servers do not permit RhostsAuthentication because it
525: is not secure (see
526: .Cm RhostsRSAAuthentication ) .
527: The argument to this keyword must be
528: .Dq yes
529: or
530: .Dq no .
531: The default is
532: .Dq no .
1.4 stevesk 533: This option applies to protocol version 1 only and requires
534: .Nm ssh
535: to be setuid root and
536: .Cm UsePrivilegedPort
537: to be set to
538: .Dq yes .
1.1 stevesk 539: .It Cm RhostsRSAAuthentication
540: Specifies whether to try rhosts based authentication with RSA host
541: authentication.
542: The argument must be
543: .Dq yes
544: or
545: .Dq no .
546: The default is
547: .Dq no .
548: This option applies to protocol version 1 only and requires
549: .Nm ssh
550: to be setuid root.
551: .It Cm RSAAuthentication
552: Specifies whether to try RSA authentication.
553: The argument to this keyword must be
554: .Dq yes
555: or
556: .Dq no .
557: RSA authentication will only be
558: attempted if the identity file exists, or an authentication agent is
559: running.
560: The default is
561: .Dq yes .
562: Note that this option applies to protocol version 1 only.
563: .It Cm SmartcardDevice
564: Specifies which smartcard device to use. The argument to this keyword is
565: the device
566: .Nm ssh
567: should use to communicate with a smartcard used for storing the user's
568: private RSA key. By default, no device is specified and smartcard support
569: is not activated.
570: .It Cm StrictHostKeyChecking
571: If this flag is set to
572: .Dq yes ,
573: .Nm ssh
574: will never automatically add host keys to the
575: .Pa $HOME/.ssh/known_hosts
576: file, and refuses to connect to hosts whose host key has changed.
577: This provides maximum protection against trojan horse attacks,
578: however, can be annoying when the
579: .Pa /etc/ssh/ssh_known_hosts
580: file is poorly maintained, or connections to new hosts are
581: frequently made.
582: This option forces the user to manually
583: add all new hosts.
584: If this flag is set to
585: .Dq no ,
586: .Nm ssh
587: will automatically add new host keys to the
588: user known hosts files.
589: If this flag is set to
590: .Dq ask ,
591: new host keys
592: will be added to the user known host files only after the user
593: has confirmed that is what they really want to do, and
594: .Nm ssh
595: will refuse to connect to hosts whose host key has changed.
596: The host keys of
597: known hosts will be verified automatically in all cases.
598: The argument must be
599: .Dq yes ,
600: .Dq no
601: or
602: .Dq ask .
603: The default is
604: .Dq ask .
605: .It Cm UsePrivilegedPort
606: Specifies whether to use a privileged port for outgoing connections.
607: The argument must be
608: .Dq yes
609: or
610: .Dq no .
611: The default is
612: .Dq no .
1.4 stevesk 613: If set to
614: .Dq yes
615: .Nm ssh
616: must be setuid root.
1.1 stevesk 617: Note that this option must be set to
618: .Dq yes
619: if
620: .Cm RhostsAuthentication
621: and
622: .Cm RhostsRSAAuthentication
623: authentications are needed with older servers.
624: .It Cm User
625: Specifies the user to log in as.
626: This can be useful when a different user name is used on different machines.
627: This saves the trouble of
628: having to remember to give the user name on the command line.
629: .It Cm UserKnownHostsFile
630: Specifies a file to use for the user
631: host key database instead of
632: .Pa $HOME/.ssh/known_hosts .
1.8 jakob 633: .It Cm VerifyHostKeyDNS
634: Specifies whether to verify the remote key using DNS and SSHFP resource
635: records.
636: The default is
637: .Dq no .
1.1 stevesk 638: .It Cm XAuthLocation
1.5 stevesk 639: Specifies the full pathname of the
1.1 stevesk 640: .Xr xauth 1
641: program.
642: The default is
643: .Pa /usr/X11R6/bin/xauth .
644: .El
645: .Sh FILES
646: .Bl -tag -width Ds
647: .It Pa $HOME/.ssh/config
648: This is the per-user configuration file.
649: The format of this file is described above.
650: This file is used by the
651: .Nm ssh
652: client.
653: This file does not usually contain any sensitive information,
654: but the recommended permissions are read/write for the user, and not
655: accessible by others.
656: .It Pa /etc/ssh/ssh_config
657: Systemwide configuration file.
658: This file provides defaults for those
659: values that are not specified in the user's configuration file, and
660: for those users who do not have a configuration file.
661: This file must be world-readable.
662: .El
663: .Sh AUTHORS
664: OpenSSH is a derivative of the original and free
665: ssh 1.2.12 release by Tatu Ylonen.
666: Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
667: Theo de Raadt and Dug Song
668: removed many bugs, re-added newer features and
669: created OpenSSH.
670: Markus Friedl contributed the support for SSH
671: protocol versions 1.5 and 2.0.
672: .Sh SEE ALSO
673: .Xr ssh 1