Annotation of src/usr.bin/ssh/ssh_config.5, Revision 1.180
1.1 stevesk 1: .\"
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: .\"
1.180 ! djm 36: .\" $OpenBSD: ssh_config.5,v 1.179 2013/11/02 22:39:19 markus Exp $
! 37: .Dd $Mdocdate: November 2 2013 $
1.1 stevesk 38: .Dt SSH_CONFIG 5
39: .Os
40: .Sh NAME
41: .Nm ssh_config
42: .Nd OpenSSH SSH client configuration files
43: .Sh SYNOPSIS
1.98 jmc 44: .Nm ~/.ssh/config
45: .Nm /etc/ssh/ssh_config
1.1 stevesk 46: .Sh DESCRIPTION
1.84 jmc 47: .Xr ssh 1
1.1 stevesk 48: obtains configuration data from the following sources in
49: the following order:
1.79 jmc 50: .Pp
1.2 stevesk 51: .Bl -enum -offset indent -compact
52: .It
53: command-line options
54: .It
55: user's configuration file
1.50 djm 56: .Pq Pa ~/.ssh/config
1.2 stevesk 57: .It
58: system-wide configuration file
59: .Pq Pa /etc/ssh/ssh_config
60: .El
1.1 stevesk 61: .Pp
62: For each parameter, the first obtained value
63: will be used.
1.41 jmc 64: The configuration files contain sections separated by
1.1 stevesk 65: .Dq Host
66: specifications, and that section is only applied for hosts that
67: match one of the patterns given in the specification.
68: The matched host name is the one given on the command line.
69: .Pp
70: Since the first obtained value for each parameter is used, more
71: host-specific declarations should be given near the beginning of the
72: file, and general defaults at the end.
1.80 jmc 73: .Pp
1.1 stevesk 74: The configuration file has the following format:
75: .Pp
76: Empty lines and lines starting with
77: .Ql #
78: are comments.
79: Otherwise a line is of the format
80: .Dq keyword arguments .
81: Configuration options may be separated by whitespace or
82: optional whitespace and exactly one
83: .Ql = ;
84: the latter format is useful to avoid the need to quote whitespace
85: when specifying configuration options using the
86: .Nm ssh ,
1.87 jmc 87: .Nm scp ,
1.1 stevesk 88: and
89: .Nm sftp
90: .Fl o
91: option.
1.88 dtucker 92: Arguments may optionally be enclosed in double quotes
93: .Pq \&"
94: in order to represent arguments containing spaces.
1.1 stevesk 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
1.169 djm 103: or
104: .Cm Match
1.1 stevesk 105: keyword) to be only for those hosts that match one of the patterns
106: given after the keyword.
1.112 krw 107: If more than one pattern is provided, they should be separated by whitespace.
1.1 stevesk 108: A single
1.83 jmc 109: .Ql *
1.1 stevesk 110: as a pattern can be used to provide global
111: defaults for all hosts.
112: The host is the
113: .Ar hostname
1.83 jmc 114: argument given on the command line (i.e. the name is not converted to
1.1 stevesk 115: a canonicalized host name before matching).
1.148 djm 116: .Pp
117: A pattern entry may be negated by prefixing it with an exclamation mark
118: .Pq Sq !\& .
119: If a negated entry is matched, then the
120: .Cm Host
121: entry is ignored, regardless of whether any other patterns on the line
122: match.
123: Negated matches are therefore useful to provide exceptions for wildcard
124: matches.
1.81 jmc 125: .Pp
126: See
127: .Sx PATTERNS
128: for more information on patterns.
1.170 jmc 129: .It Cm Match
1.169 djm 130: Restricts the following declarations (up to the next
131: .Cm Host
132: or
133: .Cm Match
134: keyword) to be used only when the conditions following the
135: .Cm Match
136: keyword are satisfied.
1.178 dtucker 137: Match conditions are specified using one or more keyword/criteria pairs
138: or the single token
139: .Cm all
140: which matches all criteria.
1.169 djm 141: The available keywords are:
1.176 djm 142: .Cm exec ,
1.169 djm 143: .Cm host ,
144: .Cm originalhost ,
145: .Cm user ,
146: and
147: .Cm localuser .
148: .Pp
1.177 jmc 149: The
1.176 djm 150: .Cm exec
1.177 jmc 151: keyword executes the specified command under the user's shell.
1.169 djm 152: If the command returns a zero exit status then the condition is considered true.
153: Commands containing whitespace characters must be quoted.
1.175 djm 154: The following character sequences in the command will be expanded prior to
155: execution:
156: .Ql %L
157: will be substituted by the first component of the local host name,
158: .Ql %l
159: will be substituted by the local host name (including any domain name),
160: .Ql %h
161: will be substituted by the target host name,
162: .Ql %n
163: will be substituted by the original target host name
1.176 djm 164: specified on the command-line,
1.175 djm 165: .Ql %p
166: the destination port,
167: .Ql %r
168: by the remote login username, and
169: .Ql %u
170: by the username of the user running
171: .Xr ssh 1 .
1.169 djm 172: .Pp
173: The other keywords' criteria must be single entries or comma-separated
174: lists and may use the wildcard and negation operators described in the
175: .Sx PATTERNS
176: section.
177: The criteria for the
178: .Cm host
179: keyword are matched against the target hostname, after any substitution
180: by the
181: .Cm Hostname
182: option.
183: The
184: .Cm originalhost
185: keyword matches against the hostname as it was specified on the command-line.
186: The
187: .Cm user
188: keyword matches against the target username on the remote host.
189: The
190: .Cm localuser
191: keyword matches against the name of the local user running
192: .Xr ssh 1
193: (this keyword may be useful in system-wide
194: .Nm
195: files).
1.10 djm 196: .It Cm AddressFamily
1.11 jmc 197: Specifies which address family to use when connecting.
198: Valid arguments are
1.10 djm 199: .Dq any ,
200: .Dq inet
1.84 jmc 201: (use IPv4 only), or
1.10 djm 202: .Dq inet6
1.40 jmc 203: (use IPv6 only).
1.1 stevesk 204: .It Cm BatchMode
205: If set to
206: .Dq yes ,
207: passphrase/password querying will be disabled.
208: This option is useful in scripts and other batch jobs where no user
209: is present to supply the password.
210: The argument must be
211: .Dq yes
212: or
213: .Dq no .
214: The default is
215: .Dq no .
216: .It Cm BindAddress
1.60 dtucker 217: Use the specified address on the local machine as the source address of
1.61 jmc 218: the connection.
219: Only useful on systems with more than one address.
1.1 stevesk 220: Note that this option does not work if
221: .Cm UsePrivilegedPort
222: is set to
223: .Dq yes .
1.171 djm 224: .It Cm CanonicalDomains
1.172 jmc 225: When
1.173 djm 226: .Cm CanonicalizeHostname
1.171 djm 227: is enabled, this option specifies the list of domain suffixes in which to
228: search for the specified destination host.
1.173 djm 229: .It Cm CanonicalizeFallbackLocal
1.174 djm 230: Specifies whether to fail with an error when hostname canonicalization fails.
1.172 jmc 231: The default,
232: .Dq no ,
233: will attempt to look up the unqualified hostname using the system resolver's
1.171 djm 234: search rules.
235: A value of
236: .Dq yes
237: will cause
238: .Xr ssh 1
239: to fail instantly if
1.173 djm 240: .Cm CanonicalizeHostname
1.171 djm 241: is enabled and the target hostname cannot be found in any of the domains
242: specified by
243: .Cm CanonicalDomains .
1.173 djm 244: .It Cm CanonicalizeHostname
1.174 djm 245: Controls whether explicit hostname canonicalization is performed.
1.172 jmc 246: The default,
247: .Dq no ,
1.171 djm 248: is not to perform any name rewriting and let the system resolver handle all
249: hostname lookups.
250: If set to
251: .Dq yes
252: then, for connections that do not use a
253: .Cm ProxyCommand ,
254: .Xr ssh 1
1.173 djm 255: will attempt to canonicalize the hostname specified on the command line
1.171 djm 256: using the
257: .Cm CanonicalDomains
258: suffixes and
1.173 djm 259: .Cm CanonicalizePermittedCNAMEs
1.171 djm 260: rules.
261: If
1.173 djm 262: .Cm CanonicalizeHostname
1.171 djm 263: is set to
264: .Dq always ,
1.174 djm 265: then canonicalization is applied to proxied connections too.
1.173 djm 266: .It Cm CanonicalizeMaxDots
1.172 jmc 267: Specifies the maximum number of dot characters in a hostname before
1.174 djm 268: canonicalization is disabled.
1.172 jmc 269: The default,
270: .Dq 1 ,
271: allows a single dot (i.e. hostname.subdomain).
1.173 djm 272: .It Cm CanonicalizePermittedCNAMEs
1.172 jmc 273: Specifies rules to determine whether CNAMEs should be followed when
1.173 djm 274: canonicalizing hostnames.
1.171 djm 275: The rules consist of one or more arguments of
1.172 jmc 276: .Ar source_domain_list : Ns Ar target_domain_list ,
1.171 djm 277: where
278: .Ar source_domain_list
1.174 djm 279: is a pattern-list of domains that may follow CNAMEs in canonicalization,
1.171 djm 280: and
281: .Ar target_domain_list
1.172 jmc 282: is a pattern-list of domains that they may resolve to.
1.171 djm 283: .Pp
284: For example,
285: .Dq *.a.example.com:*.b.example.com,*.c.example.com
286: will allow hostnames matching
287: .Dq *.a.example.com
1.173 djm 288: to be canonicalized to names in the
1.171 djm 289: .Dq *.b.example.com
290: or
291: .Dq *.c.example.com
292: domains.
1.1 stevesk 293: .It Cm ChallengeResponseAuthentication
1.82 jmc 294: Specifies whether to use challenge-response authentication.
1.1 stevesk 295: The argument to this keyword must be
296: .Dq yes
297: or
298: .Dq no .
299: The default is
300: .Dq yes .
301: .It Cm CheckHostIP
302: If this flag is set to
303: .Dq yes ,
1.84 jmc 304: .Xr ssh 1
305: will additionally check the host IP address in the
1.1 stevesk 306: .Pa known_hosts
307: file.
308: This allows ssh to detect if a host key changed due to DNS spoofing.
1.107 grunk 309: If the option is set to
1.1 stevesk 310: .Dq no ,
311: the check will not be executed.
312: The default is
313: .Dq yes .
314: .It Cm Cipher
315: Specifies the cipher to use for encrypting the session
316: in protocol version 1.
317: Currently,
318: .Dq blowfish ,
319: .Dq 3des ,
320: and
321: .Dq des
322: are supported.
323: .Ar des
324: is only supported in the
1.84 jmc 325: .Xr ssh 1
1.1 stevesk 326: client for interoperability with legacy protocol 1 implementations
327: that do not support the
328: .Ar 3des
1.7 jmc 329: cipher.
330: Its use is strongly discouraged due to cryptographic weaknesses.
1.1 stevesk 331: The default is
332: .Dq 3des .
333: .It Cm Ciphers
334: Specifies the ciphers allowed for protocol version 2
335: in order of preference.
336: Multiple ciphers must be comma-separated.
1.180 ! djm 337: The supported ciphers are:
! 338: .Pp
1.35 dtucker 339: .Dq 3des-cbc ,
340: .Dq aes128-cbc ,
341: .Dq aes192-cbc ,
342: .Dq aes256-cbc ,
343: .Dq aes128-ctr ,
344: .Dq aes192-ctr ,
345: .Dq aes256-ctr ,
1.161 markus 346: .Dq aes128-gcm@openssh.com ,
347: .Dq aes256-gcm@openssh.com ,
1.54 djm 348: .Dq arcfour128 ,
349: .Dq arcfour256 ,
1.35 dtucker 350: .Dq arcfour ,
351: .Dq blowfish-cbc ,
1.180 ! djm 352: .Dq cast128-cbc ,
1.35 dtucker 353: and
1.180 ! djm 354: .Dq chacha20-poly1305@openssh.com .
! 355: .Pp
1.84 jmc 356: The default is:
1.180 ! djm 357: .Pp
1.84 jmc 358: .Bd -literal -offset 3n
1.116 naddy 359: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,
1.161 markus 360: aes128-gcm@openssh.com,aes256-gcm@openssh.com,
1.180 ! djm 361: chacha20-poly1305@openssh.com,
1.116 naddy 362: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,
363: aes256-cbc,arcfour
1.1 stevesk 364: .Ed
1.180 ! djm 365: .Pp
! 366: The list of available ciphers may also be obtained using the
! 367: .Fl Q
! 368: option of
! 369: .Xr ssh 1 .
1.1 stevesk 370: .It Cm ClearAllForwardings
1.84 jmc 371: Specifies that all local, remote, and dynamic port forwardings
1.1 stevesk 372: specified in the configuration files or on the command line be
1.7 jmc 373: cleared.
374: This option is primarily useful when used from the
1.84 jmc 375: .Xr ssh 1
1.1 stevesk 376: command line to clear port forwardings set in
377: configuration files, and is automatically set by
378: .Xr scp 1
379: and
380: .Xr sftp 1 .
381: The argument must be
382: .Dq yes
383: or
384: .Dq no .
385: The default is
386: .Dq no .
387: .It Cm Compression
388: Specifies whether to use compression.
389: The argument must be
390: .Dq yes
391: or
392: .Dq no .
393: The default is
394: .Dq no .
395: .It Cm CompressionLevel
396: Specifies the compression level to use if compression is enabled.
397: The argument must be an integer from 1 (fast) to 9 (slow, best).
398: The default level is 6, which is good for most applications.
399: The meaning of the values is the same as in
400: .Xr gzip 1 .
401: Note that this option applies to protocol version 1 only.
402: .It Cm ConnectionAttempts
403: Specifies the number of tries (one per second) to make before exiting.
404: The argument must be an integer.
405: This may be useful in scripts if the connection sometimes fails.
406: The default is 1.
1.9 djm 407: .It Cm ConnectTimeout
1.84 jmc 408: Specifies the timeout (in seconds) used when connecting to the
409: SSH server, instead of using the default system TCP timeout.
1.11 jmc 410: This value is used only when the target is down or really unreachable,
411: not when it refuses the connection.
1.36 djm 412: .It Cm ControlMaster
413: Enables the sharing of multiple sessions over a single network connection.
414: When set to
1.84 jmc 415: .Dq yes ,
416: .Xr ssh 1
1.36 djm 417: will listen for connections on a control socket specified using the
418: .Cm ControlPath
419: argument.
420: Additional sessions can connect to this socket using the same
421: .Cm ControlPath
422: with
423: .Cm ControlMaster
424: set to
425: .Dq no
1.38 jmc 426: (the default).
1.64 jmc 427: These sessions will try to reuse the master instance's network connection
1.63 djm 428: rather than initiating new ones, but will fall back to connecting normally
429: if the control socket does not exist, or is not listening.
430: .Pp
1.37 djm 431: Setting this to
432: .Dq ask
1.84 jmc 433: will cause ssh
1.37 djm 434: to listen for control connections, but require confirmation using the
435: .Ev SSH_ASKPASS
436: program before they are accepted (see
437: .Xr ssh-add 1
1.38 jmc 438: for details).
1.51 jakob 439: If the
440: .Cm ControlPath
1.84 jmc 441: cannot be opened,
442: ssh will continue without connecting to a master instance.
1.58 djm 443: .Pp
444: X11 and
1.59 jmc 445: .Xr ssh-agent 1
1.58 djm 446: forwarding is supported over these multiplexed connections, however the
1.70 stevesk 447: display and agent forwarded will be the one belonging to the master
1.59 jmc 448: connection i.e. it is not possible to forward multiple displays or agents.
1.56 djm 449: .Pp
450: Two additional options allow for opportunistic multiplexing: try to use a
451: master connection but fall back to creating a new one if one does not already
452: exist.
453: These options are:
454: .Dq auto
455: and
456: .Dq autoask .
457: The latter requires confirmation like the
458: .Dq ask
459: option.
1.36 djm 460: .It Cm ControlPath
1.55 djm 461: Specify the path to the control socket used for connection sharing as described
462: in the
1.36 djm 463: .Cm ControlMaster
1.57 djm 464: section above or the string
465: .Dq none
466: to disable connection sharing.
1.55 djm 467: In the path,
1.147 djm 468: .Ql %L
469: will be substituted by the first component of the local host name,
1.77 djm 470: .Ql %l
1.147 djm 471: will be substituted by the local host name (including any domain name),
1.55 djm 472: .Ql %h
473: will be substituted by the target host name,
1.150 jmc 474: .Ql %n
475: will be substituted by the original target host name
476: specified on the command line,
1.55 djm 477: .Ql %p
1.175 djm 478: the destination port,
1.55 djm 479: .Ql %r
1.147 djm 480: by the remote login username, and
481: .Ql %u
482: by the username of the user running
483: .Xr ssh 1 .
1.56 djm 484: It is recommended that any
485: .Cm ControlPath
486: used for opportunistic connection sharing include
1.78 jmc 487: at least %h, %p, and %r.
1.56 djm 488: This ensures that shared connections are uniquely identified.
1.137 djm 489: .It Cm ControlPersist
490: When used in conjunction with
491: .Cm ControlMaster ,
492: specifies that the master connection should remain open
493: in the background (waiting for future client connections)
494: after the initial client connection has been closed.
495: If set to
496: .Dq no ,
497: then the master connection will not be placed into the background,
498: and will close as soon as the initial client connection is closed.
499: If set to
500: .Dq yes ,
501: then the master connection will remain in the background indefinitely
502: (until killed or closed via a mechanism such as the
503: .Xr ssh 1
504: .Dq Fl O No exit
505: option).
506: If set to a time in seconds, or a time in any of the formats documented in
507: .Xr sshd_config 5 ,
508: then the backgrounded master connection will automatically terminate
509: after it has remained idle (with no client connections) for the
510: specified time.
1.38 jmc 511: .It Cm DynamicForward
1.74 jmc 512: Specifies that a TCP port on the local machine be forwarded
1.38 jmc 513: over the secure channel, and the application
514: protocol is then used to determine where to connect to from the
515: remote machine.
1.62 djm 516: .Pp
517: The argument must be
518: .Sm off
519: .Oo Ar bind_address : Oc Ar port .
520: .Sm on
1.138 djm 521: IPv6 addresses can be specified by enclosing addresses in square brackets.
1.62 djm 522: By default, the local port is bound in accordance with the
523: .Cm GatewayPorts
524: setting.
525: However, an explicit
526: .Ar bind_address
527: may be used to bind the connection to a specific address.
528: The
529: .Ar bind_address
530: of
531: .Dq localhost
532: indicates that the listening port be bound for local use only, while an
533: empty address or
534: .Sq *
535: indicates that the port should be available from all interfaces.
536: .Pp
1.38 jmc 537: Currently the SOCKS4 and SOCKS5 protocols are supported, and
1.84 jmc 538: .Xr ssh 1
1.38 jmc 539: will act as a SOCKS server.
540: Multiple forwardings may be specified, and
541: additional forwardings can be given on the command line.
542: Only the superuser can forward privileged ports.
1.14 markus 543: .It Cm EnableSSHKeysign
544: Setting this option to
545: .Dq yes
546: in the global client configuration file
547: .Pa /etc/ssh/ssh_config
548: enables the use of the helper program
549: .Xr ssh-keysign 8
550: during
551: .Cm HostbasedAuthentication .
552: The argument must be
553: .Dq yes
554: or
555: .Dq no .
556: The default is
557: .Dq no .
1.23 jmc 558: This option should be placed in the non-hostspecific section.
1.14 markus 559: See
560: .Xr ssh-keysign 8
561: for more information.
1.1 stevesk 562: .It Cm EscapeChar
563: Sets the escape character (default:
564: .Ql ~ ) .
565: The escape character can also
566: be set on the command line.
567: The argument should be a single character,
568: .Ql ^
569: followed by a letter, or
570: .Dq none
571: to disable the escape
572: character entirely (making the connection transparent for binary
573: data).
1.96 markus 574: .It Cm ExitOnForwardFailure
575: Specifies whether
576: .Xr ssh 1
577: should terminate the connection if it cannot set up all requested
1.102 stevesk 578: dynamic, tunnel, local, and remote port forwardings.
1.96 markus 579: The argument must be
580: .Dq yes
581: or
582: .Dq no .
583: The default is
584: .Dq no .
1.1 stevesk 585: .It Cm ForwardAgent
586: Specifies whether the connection to the authentication agent (if any)
587: will be forwarded to the remote machine.
588: The argument must be
589: .Dq yes
590: or
591: .Dq no .
592: The default is
593: .Dq no .
1.3 stevesk 594: .Pp
1.7 jmc 595: Agent forwarding should be enabled with caution.
596: Users with the ability to bypass file permissions on the remote host
597: (for the agent's Unix-domain socket)
598: can access the local agent through the forwarded connection.
599: An attacker cannot obtain key material from the agent,
1.3 stevesk 600: however they can perform operations on the keys that enable them to
601: authenticate using the identities loaded into the agent.
1.1 stevesk 602: .It Cm ForwardX11
603: Specifies whether X11 connections will be automatically redirected
604: over the secure channel and
605: .Ev DISPLAY
606: set.
607: The argument must be
608: .Dq yes
609: or
610: .Dq no .
611: The default is
612: .Dq no .
1.3 stevesk 613: .Pp
1.7 jmc 614: X11 forwarding should be enabled with caution.
615: Users with the ability to bypass file permissions on the remote host
1.22 markus 616: (for the user's X11 authorization database)
1.7 jmc 617: can access the local X11 display through the forwarded connection.
1.22 markus 618: An attacker may then be able to perform activities such as keystroke monitoring
619: if the
620: .Cm ForwardX11Trusted
621: option is also enabled.
1.134 djm 622: .It Cm ForwardX11Timeout
1.135 jmc 623: Specify a timeout for untrusted X11 forwarding
624: using the format described in the
1.166 jmc 625: TIME FORMATS section of
1.134 djm 626: .Xr sshd_config 5 .
627: X11 connections received by
628: .Xr ssh 1
629: after this time will be refused.
630: The default is to disable untrusted X11 forwarding after twenty minutes has
631: elapsed.
1.22 markus 632: .It Cm ForwardX11Trusted
1.34 jmc 633: If this option is set to
1.84 jmc 634: .Dq yes ,
635: remote X11 clients will have full access to the original X11 display.
1.42 djm 636: .Pp
1.22 markus 637: If this option is set to
1.84 jmc 638: .Dq no ,
639: remote X11 clients will be considered untrusted and prevented
1.22 markus 640: from stealing or tampering with data belonging to trusted X11
641: clients.
1.42 djm 642: Furthermore, the
643: .Xr xauth 1
644: token used for the session will be set to expire after 20 minutes.
645: Remote clients will be refused access after this time.
1.22 markus 646: .Pp
647: The default is
648: .Dq no .
649: .Pp
650: See the X11 SECURITY extension specification for full details on
651: the restrictions imposed on untrusted clients.
1.1 stevesk 652: .It Cm GatewayPorts
653: Specifies whether remote hosts are allowed to connect to local
654: forwarded ports.
655: By default,
1.84 jmc 656: .Xr ssh 1
1.7 jmc 657: binds local port forwardings to the loopback address.
658: This prevents other remote hosts from connecting to forwarded ports.
1.1 stevesk 659: .Cm GatewayPorts
1.84 jmc 660: can be used to specify that ssh
1.1 stevesk 661: should bind local port forwardings to the wildcard address,
662: thus allowing remote hosts to connect to forwarded ports.
663: The argument must be
664: .Dq yes
665: or
666: .Dq no .
667: The default is
668: .Dq no .
669: .It Cm GlobalKnownHostsFile
1.151 djm 670: Specifies one or more files to use for the global
671: host key database, separated by whitespace.
672: The default is
673: .Pa /etc/ssh/ssh_known_hosts ,
674: .Pa /etc/ssh/ssh_known_hosts2 .
1.18 markus 675: .It Cm GSSAPIAuthentication
1.27 markus 676: Specifies whether user authentication based on GSSAPI is allowed.
1.20 jmc 677: The default is
1.21 markus 678: .Dq no .
1.18 markus 679: Note that this option applies to protocol version 2 only.
680: .It Cm GSSAPIDelegateCredentials
681: Forward (delegate) credentials to the server.
682: The default is
683: .Dq no .
684: Note that this option applies to protocol version 2 only.
1.44 djm 685: .It Cm HashKnownHosts
686: Indicates that
1.84 jmc 687: .Xr ssh 1
1.44 djm 688: should hash host names and addresses when they are added to
1.50 djm 689: .Pa ~/.ssh/known_hosts .
1.44 djm 690: These hashed names may be used normally by
1.84 jmc 691: .Xr ssh 1
1.44 djm 692: and
1.84 jmc 693: .Xr sshd 8 ,
1.44 djm 694: but they do not reveal identifying information should the file's contents
695: be disclosed.
696: The default is
697: .Dq no .
1.97 jmc 698: Note that existing names and addresses in known hosts files
699: will not be converted automatically,
700: but may be manually hashed using
1.45 djm 701: .Xr ssh-keygen 1 .
1.1 stevesk 702: .It Cm HostbasedAuthentication
703: Specifies whether to try rhosts based authentication with public key
704: authentication.
705: The argument must be
706: .Dq yes
707: or
708: .Dq no .
709: The default is
710: .Dq no .
711: This option applies to protocol version 2 only and
712: is similar to
713: .Cm RhostsRSAAuthentication .
714: .It Cm HostKeyAlgorithms
715: Specifies the protocol version 2 host key algorithms
716: that the client wants to use in order of preference.
717: The default for this option is:
1.139 djm 718: .Bd -literal -offset 3n
719: ecdsa-sha2-nistp256-cert-v01@openssh.com,
720: ecdsa-sha2-nistp384-cert-v01@openssh.com,
721: ecdsa-sha2-nistp521-cert-v01@openssh.com,
722: ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,
723: ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,
724: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
725: ssh-rsa,ssh-dss
726: .Ed
1.145 djm 727: .Pp
728: If hostkeys are known for the destination host then this default is modified
729: to prefer their algorithms.
1.1 stevesk 730: .It Cm HostKeyAlias
731: Specifies an alias that should be used instead of the
732: real host name when looking up or saving the host key
733: in the host key database files.
1.84 jmc 734: This option is useful for tunneling SSH connections
1.1 stevesk 735: or for multiple servers running on a single host.
736: .It Cm HostName
737: Specifies the real host name to log into.
738: This can be used to specify nicknames or abbreviations for hosts.
1.136 djm 739: If the hostname contains the character sequence
740: .Ql %h ,
1.150 jmc 741: then this will be replaced with the host name specified on the command line
1.136 djm 742: (this is useful for manipulating unqualified names).
1.84 jmc 743: The default is the name given on the command line.
1.1 stevesk 744: Numeric IP addresses are also permitted (both on the command line and in
745: .Cm HostName
746: specifications).
1.29 markus 747: .It Cm IdentitiesOnly
748: Specifies that
1.84 jmc 749: .Xr ssh 1
1.29 markus 750: should only use the authentication identity files configured in the
1.31 jmc 751: .Nm
1.29 markus 752: files,
1.84 jmc 753: even if
754: .Xr ssh-agent 1
1.159 djm 755: or a
756: .Cm PKCS11Provider
1.29 markus 757: offers more identities.
758: The argument to this keyword must be
759: .Dq yes
760: or
761: .Dq no .
1.84 jmc 762: This option is intended for situations where ssh-agent
1.29 markus 763: offers many different identities.
764: The default is
765: .Dq no .
1.67 jmc 766: .It Cm IdentityFile
1.155 dtucker 767: Specifies a file from which the user's DSA, ECDSA or RSA authentication
1.139 djm 768: identity is read.
1.67 jmc 769: The default is
770: .Pa ~/.ssh/identity
771: for protocol version 1, and
1.139 djm 772: .Pa ~/.ssh/id_dsa ,
773: .Pa ~/.ssh/id_ecdsa
774: and
1.67 jmc 775: .Pa ~/.ssh/id_rsa
776: for protocol version 2.
777: Additionally, any identities represented by the authentication agent
1.165 djm 778: will be used for authentication unless
779: .Cm IdentitiesOnly
780: is set.
1.129 djm 781: .Xr ssh 1
782: will try to load certificate information from the filename obtained by
783: appending
784: .Pa -cert.pub
785: to the path of a specified
786: .Cm IdentityFile .
1.90 djm 787: .Pp
1.67 jmc 788: The file name may use the tilde
1.91 jmc 789: syntax to refer to a user's home directory or one of the following
1.90 djm 790: escape characters:
791: .Ql %d
792: (local user's home directory),
793: .Ql %u
794: (local user name),
795: .Ql %l
796: (local host name),
797: .Ql %h
798: (remote host name) or
1.92 djm 799: .Ql %r
1.90 djm 800: (remote user name).
801: .Pp
1.67 jmc 802: It is possible to have
803: multiple identity files specified in configuration files; all these
804: identities will be tried in sequence.
1.152 djm 805: Multiple
806: .Cm IdentityFile
807: directives will add to the list of identities tried (this behaviour
808: differs from that of other configuration directives).
1.165 djm 809: .Pp
810: .Cm IdentityFile
811: may be used in conjunction with
812: .Cm IdentitiesOnly
813: to select which identities in an agent are offered during authentication.
1.164 jmc 814: .It Cm IgnoreUnknown
815: Specifies a pattern-list of unknown options to be ignored if they are
816: encountered in configuration parsing.
817: This may be used to suppress errors if
818: .Nm
819: contains options that are unrecognised by
820: .Xr ssh 1 .
821: It is recommended that
822: .Cm IgnoreUnknown
823: be listed early in the configuration file as it will not be applied
824: to unknown options that appear before it.
1.143 djm 825: .It Cm IPQoS
826: Specifies the IPv4 type-of-service or DSCP class for connections.
827: Accepted values are
828: .Dq af11 ,
829: .Dq af12 ,
830: .Dq af13 ,
1.154 djm 831: .Dq af21 ,
1.143 djm 832: .Dq af22 ,
833: .Dq af23 ,
834: .Dq af31 ,
835: .Dq af32 ,
836: .Dq af33 ,
837: .Dq af41 ,
838: .Dq af42 ,
839: .Dq af43 ,
840: .Dq cs0 ,
841: .Dq cs1 ,
842: .Dq cs2 ,
843: .Dq cs3 ,
844: .Dq cs4 ,
845: .Dq cs5 ,
846: .Dq cs6 ,
847: .Dq cs7 ,
848: .Dq ef ,
849: .Dq lowdelay ,
850: .Dq throughput ,
851: .Dq reliability ,
852: or a numeric value.
1.146 djm 853: This option may take one or two arguments, separated by whitespace.
1.143 djm 854: If one argument is specified, it is used as the packet class unconditionally.
855: If two values are specified, the first is automatically selected for
856: interactive sessions and the second for non-interactive sessions.
857: The default is
858: .Dq lowdelay
859: for interactive sessions and
860: .Dq throughput
861: for non-interactive sessions.
1.103 djm 862: .It Cm KbdInteractiveAuthentication
863: Specifies whether to use keyboard-interactive authentication.
864: The argument to this keyword must be
865: .Dq yes
866: or
867: .Dq no .
868: The default is
869: .Dq yes .
1.39 djm 870: .It Cm KbdInteractiveDevices
871: Specifies the list of methods to use in keyboard-interactive authentication.
872: Multiple method names must be comma-separated.
873: The default is to use the server specified list.
1.85 jmc 874: The methods available vary depending on what the server supports.
875: For an OpenSSH server,
876: it may be zero or more of:
877: .Dq bsdauth ,
878: .Dq pam ,
879: and
880: .Dq skey .
1.140 djm 881: .It Cm KexAlgorithms
882: Specifies the available KEX (Key Exchange) algorithms.
883: Multiple algorithms must be comma-separated.
1.141 jmc 884: The default is:
885: .Bd -literal -offset indent
1.179 markus 886: curve25519-sha256@libssh.org,
1.141 jmc 887: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
888: diffie-hellman-group-exchange-sha256,
889: diffie-hellman-group-exchange-sha1,
890: diffie-hellman-group14-sha1,
891: diffie-hellman-group1-sha1
892: .Ed
1.65 reyk 893: .It Cm LocalCommand
894: Specifies a command to execute on the local machine after successfully
895: connecting to the server.
896: The command string extends to the end of the line, and is executed with
1.105 jmc 897: the user's shell.
1.109 dtucker 898: The following escape character substitutions will be performed:
899: .Ql %d
900: (local user's home directory),
901: .Ql %h
902: (remote host name),
903: .Ql %l
904: (local host name),
905: .Ql %n
906: (host name as provided on the command line),
907: .Ql %p
908: (remote port),
909: .Ql %r
910: (remote user name) or
911: .Ql %u
912: (local user name).
1.123 djm 913: .Pp
914: The command is run synchronously and does not have access to the
915: session of the
916: .Xr ssh 1
917: that spawned it.
918: It should not be used for interactive commands.
919: .Pp
1.65 reyk 920: This directive is ignored unless
921: .Cm PermitLocalCommand
922: has been enabled.
1.1 stevesk 923: .It Cm LocalForward
1.74 jmc 924: Specifies that a TCP port on the local machine be forwarded over
1.1 stevesk 925: the secure channel to the specified host and port from the remote machine.
1.49 jmc 926: The first argument must be
1.43 djm 927: .Sm off
1.49 jmc 928: .Oo Ar bind_address : Oc Ar port
1.43 djm 929: .Sm on
1.49 jmc 930: and the second argument must be
931: .Ar host : Ns Ar hostport .
1.138 djm 932: IPv6 addresses can be specified by enclosing addresses in square brackets.
1.46 jmc 933: Multiple forwardings may be specified, and additional forwardings can be
1.43 djm 934: given on the command line.
1.1 stevesk 935: Only the superuser can forward privileged ports.
1.43 djm 936: By default, the local port is bound in accordance with the
937: .Cm GatewayPorts
938: setting.
939: However, an explicit
940: .Ar bind_address
941: may be used to bind the connection to a specific address.
942: The
943: .Ar bind_address
944: of
945: .Dq localhost
1.46 jmc 946: indicates that the listening port be bound for local use only, while an
947: empty address or
948: .Sq *
1.43 djm 949: indicates that the port should be available from all interfaces.
1.1 stevesk 950: .It Cm LogLevel
951: Gives the verbosity level that is used when logging messages from
1.84 jmc 952: .Xr ssh 1 .
1.1 stevesk 953: The possible values are:
1.84 jmc 954: QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
1.7 jmc 955: The default is INFO.
956: DEBUG and DEBUG1 are equivalent.
957: DEBUG2 and DEBUG3 each specify higher levels of verbose output.
1.1 stevesk 958: .It Cm MACs
959: Specifies the MAC (message authentication code) algorithms
960: in order of preference.
961: The MAC algorithm is used in protocol version 2
962: for data integrity protection.
963: Multiple algorithms must be comma-separated.
1.160 markus 964: The algorithms that contain
965: .Dq -etm
966: calculate the MAC after encryption (encrypt-then-mac).
967: These are considered safer and their use recommended.
1.84 jmc 968: The default is:
1.101 jmc 969: .Bd -literal -offset indent
1.160 markus 970: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,
971: umac-64-etm@openssh.com,umac-128-etm@openssh.com,
972: hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
973: hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,
974: hmac-md5-96-etm@openssh.com,
1.158 markus 975: hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,
1.157 naddy 976: hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,
977: hmac-sha1-96,hmac-md5-96
1.101 jmc 978: .Ed
1.1 stevesk 979: .It Cm NoHostAuthenticationForLocalhost
980: This option can be used if the home directory is shared across machines.
981: In this case localhost will refer to a different machine on each of
982: the machines and the user will get many warnings about changed host keys.
983: However, this option disables host authentication for localhost.
984: The argument to this keyword must be
985: .Dq yes
986: or
987: .Dq no .
988: The default is to check the host key for localhost.
989: .It Cm NumberOfPasswordPrompts
990: Specifies the number of password prompts before giving up.
991: The argument to this keyword must be an integer.
1.84 jmc 992: The default is 3.
1.1 stevesk 993: .It Cm PasswordAuthentication
994: Specifies whether to use password authentication.
995: The argument to this keyword must be
996: .Dq yes
997: or
998: .Dq no .
999: The default is
1000: .Dq yes .
1.65 reyk 1001: .It Cm PermitLocalCommand
1002: Allow local command execution via the
1003: .Ic LocalCommand
1004: option or using the
1.66 jmc 1005: .Ic !\& Ns Ar command
1.65 reyk 1006: escape sequence in
1007: .Xr ssh 1 .
1008: The argument must be
1009: .Dq yes
1010: or
1011: .Dq no .
1012: The default is
1013: .Dq no .
1.127 markus 1014: .It Cm PKCS11Provider
1015: Specifies which PKCS#11 provider to use.
1.144 jmc 1016: The argument to this keyword is the PKCS#11 shared library
1.127 markus 1017: .Xr ssh 1
1.128 markus 1018: should use to communicate with a PKCS#11 token providing the user's
1.127 markus 1019: private RSA key.
1.67 jmc 1020: .It Cm Port
1021: Specifies the port number to connect on the remote host.
1.84 jmc 1022: The default is 22.
1.1 stevesk 1023: .It Cm PreferredAuthentications
1024: Specifies the order in which the client should try protocol 2
1.11 jmc 1025: authentication methods.
1.48 jmc 1026: This allows a client to prefer one method (e.g.\&
1.1 stevesk 1027: .Cm keyboard-interactive )
1.48 jmc 1028: over another method (e.g.\&
1.131 jmc 1029: .Cm password ) .
1030: The default is:
1031: .Bd -literal -offset indent
1032: gssapi-with-mic,hostbased,publickey,
1033: keyboard-interactive,password
1034: .Ed
1.1 stevesk 1035: .It Cm Protocol
1036: Specifies the protocol versions
1.84 jmc 1037: .Xr ssh 1
1.1 stevesk 1038: should support in order of preference.
1039: The possible values are
1.84 jmc 1040: .Sq 1
1.1 stevesk 1041: and
1.84 jmc 1042: .Sq 2 .
1.1 stevesk 1043: Multiple versions must be comma-separated.
1.120 markus 1044: When this option is set to
1.121 jmc 1045: .Dq 2,1
1.120 markus 1046: .Nm ssh
1047: will try version 2 and fall back to version 1
1048: if version 2 is not available.
1.1 stevesk 1049: The default is
1.121 jmc 1050: .Sq 2 .
1.1 stevesk 1051: .It Cm ProxyCommand
1052: Specifies the command to use to connect to the server.
1053: The command
1054: string extends to the end of the line, and is executed with
1.105 jmc 1055: the user's shell.
1.133 jmc 1056: In the command string, any occurrence of
1.1 stevesk 1057: .Ql %h
1058: will be substituted by the host name to
1.132 djm 1059: connect,
1.1 stevesk 1060: .Ql %p
1.133 jmc 1061: by the port, and
1062: .Ql %r
1.132 djm 1063: by the remote user name.
1.1 stevesk 1064: The command can be basically anything,
1065: and should read from its standard input and write to its standard output.
1066: It should eventually connect an
1067: .Xr sshd 8
1068: server running on some machine, or execute
1069: .Ic sshd -i
1070: somewhere.
1071: Host key management will be done using the
1072: HostName of the host being connected (defaulting to the name typed by
1073: the user).
1.7 jmc 1074: Setting the command to
1075: .Dq none
1.6 markus 1076: disables this option entirely.
1.1 stevesk 1077: Note that
1078: .Cm CheckHostIP
1079: is not available for connects with a proxy command.
1.52 djm 1080: .Pp
1081: This directive is useful in conjunction with
1082: .Xr nc 1
1083: and its proxy support.
1.53 jmc 1084: For example, the following directive would connect via an HTTP proxy at
1.52 djm 1085: 192.0.2.0:
1086: .Bd -literal -offset 3n
1087: ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p
1088: .Ed
1.167 djm 1089: .It Cm ProxyUseFdpass
1.168 jmc 1090: Specifies that
1.167 djm 1091: .Cm ProxyCommand
1092: will pass a connected file descriptor back to
1.168 jmc 1093: .Xr ssh 1
1.167 djm 1094: instead of continuing to execute and pass data.
1095: The default is
1096: .Dq no .
1.1 stevesk 1097: .It Cm PubkeyAuthentication
1098: Specifies whether to try public key authentication.
1099: The argument to this keyword must be
1100: .Dq yes
1101: or
1102: .Dq no .
1103: The default is
1104: .Dq yes .
1105: This option applies to protocol version 2 only.
1.75 dtucker 1106: .It Cm RekeyLimit
1107: Specifies the maximum amount of data that may be transmitted before the
1.162 dtucker 1108: session key is renegotiated, optionally followed a maximum amount of
1109: time that may pass before the session key is renegotiated.
1110: The first argument is specified in bytes and may have a suffix of
1.76 jmc 1111: .Sq K ,
1112: .Sq M ,
1.75 dtucker 1113: or
1.76 jmc 1114: .Sq G
1.75 dtucker 1115: to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1116: The default is between
1.84 jmc 1117: .Sq 1G
1.75 dtucker 1118: and
1.84 jmc 1119: .Sq 4G ,
1.75 dtucker 1120: depending on the cipher.
1.162 dtucker 1121: The optional second value is specified in seconds and may use any of the
1122: units documented in the
1.166 jmc 1123: TIME FORMATS section of
1.162 dtucker 1124: .Xr sshd_config 5 .
1125: The default value for
1126: .Cm RekeyLimit
1127: is
1128: .Dq default none ,
1129: which means that rekeying is performed after the cipher's default amount
1130: of data has been sent or received and no time based rekeying is done.
1.76 jmc 1131: This option applies to protocol version 2 only.
1.1 stevesk 1132: .It Cm RemoteForward
1.74 jmc 1133: Specifies that a TCP port on the remote machine be forwarded over
1.1 stevesk 1134: the secure channel to the specified host and port from the local machine.
1.49 jmc 1135: The first argument must be
1.43 djm 1136: .Sm off
1.49 jmc 1137: .Oo Ar bind_address : Oc Ar port
1.43 djm 1138: .Sm on
1.49 jmc 1139: and the second argument must be
1140: .Ar host : Ns Ar hostport .
1.138 djm 1141: IPv6 addresses can be specified by enclosing addresses in square brackets.
1.1 stevesk 1142: Multiple forwardings may be specified, and additional
1143: forwardings can be given on the command line.
1.113 stevesk 1144: Privileged ports can be forwarded only when
1145: logging in as root on the remote machine.
1.118 jmc 1146: .Pp
1.117 djm 1147: If the
1148: .Ar port
1149: argument is
1150: .Ql 0 ,
1151: the listen port will be dynamically allocated on the server and reported
1152: to the client at run time.
1.43 djm 1153: .Pp
1154: If the
1155: .Ar bind_address
1156: is not specified, the default is to only bind to loopback addresses.
1157: If the
1158: .Ar bind_address
1159: is
1160: .Ql *
1161: or an empty string, then the forwarding is requested to listen on all
1162: interfaces.
1163: Specifying a remote
1164: .Ar bind_address
1.46 jmc 1165: will only succeed if the server's
1166: .Cm GatewayPorts
1.43 djm 1167: option is enabled (see
1.46 jmc 1168: .Xr sshd_config 5 ) .
1.149 djm 1169: .It Cm RequestTTY
1170: Specifies whether to request a pseudo-tty for the session.
1171: The argument may be one of:
1172: .Dq no
1173: (never request a TTY),
1174: .Dq yes
1175: (always request a TTY when standard input is a TTY),
1176: .Dq force
1177: (always request a TTY) or
1178: .Dq auto
1179: (request a TTY when opening a login session).
1180: This option mirrors the
1181: .Fl t
1182: and
1183: .Fl T
1184: flags for
1185: .Xr ssh 1 .
1.1 stevesk 1186: .It Cm RhostsRSAAuthentication
1187: Specifies whether to try rhosts based authentication with RSA host
1188: authentication.
1189: The argument must be
1190: .Dq yes
1191: or
1192: .Dq no .
1193: The default is
1194: .Dq no .
1195: This option applies to protocol version 1 only and requires
1.84 jmc 1196: .Xr ssh 1
1.1 stevesk 1197: to be setuid root.
1198: .It Cm RSAAuthentication
1199: Specifies whether to try RSA authentication.
1200: The argument to this keyword must be
1201: .Dq yes
1202: or
1203: .Dq no .
1204: RSA authentication will only be
1205: attempted if the identity file exists, or an authentication agent is
1206: running.
1207: The default is
1208: .Dq yes .
1209: Note that this option applies to protocol version 1 only.
1.32 djm 1210: .It Cm SendEnv
1211: Specifies what variables from the local
1212: .Xr environ 7
1213: should be sent to the server.
1.84 jmc 1214: Note that environment passing is only supported for protocol 2.
1215: The server must also support it, and the server must be configured to
1.33 djm 1216: accept these environment variables.
1.32 djm 1217: Refer to
1218: .Cm AcceptEnv
1219: in
1220: .Xr sshd_config 5
1221: for how to configure the server.
1.80 jmc 1222: Variables are specified by name, which may contain wildcard characters.
1.33 djm 1223: Multiple environment variables may be separated by whitespace or spread
1.32 djm 1224: across multiple
1225: .Cm SendEnv
1226: directives.
1227: The default is not to send any environment variables.
1.81 jmc 1228: .Pp
1229: See
1230: .Sx PATTERNS
1231: for more information on patterns.
1.28 markus 1232: .It Cm ServerAliveCountMax
1.73 jmc 1233: Sets the number of server alive messages (see below) which may be
1.28 markus 1234: sent without
1.84 jmc 1235: .Xr ssh 1
1.28 markus 1236: receiving any messages back from the server.
1237: If this threshold is reached while server alive messages are being sent,
1.84 jmc 1238: ssh will disconnect from the server, terminating the session.
1.28 markus 1239: It is important to note that the use of server alive messages is very
1240: different from
1241: .Cm TCPKeepAlive
1242: (below).
1243: The server alive messages are sent through the encrypted channel
1244: and therefore will not be spoofable.
1245: The TCP keepalive option enabled by
1246: .Cm TCPKeepAlive
1247: is spoofable.
1248: The server alive mechanism is valuable when the client or
1249: server depend on knowing when a connection has become inactive.
1250: .Pp
1251: The default value is 3.
1252: If, for example,
1253: .Cm ServerAliveInterval
1.84 jmc 1254: (see below) is set to 15 and
1.28 markus 1255: .Cm ServerAliveCountMax
1.84 jmc 1256: is left at the default, if the server becomes unresponsive,
1257: ssh will disconnect after approximately 45 seconds.
1.89 markus 1258: This option applies to protocol version 2 only.
1.67 jmc 1259: .It Cm ServerAliveInterval
1260: Sets a timeout interval in seconds after which if no data has been received
1261: from the server,
1.84 jmc 1262: .Xr ssh 1
1.67 jmc 1263: will send a message through the encrypted
1264: channel to request a response from the server.
1265: The default
1266: is 0, indicating that these messages will not be sent to the server.
1267: This option applies to protocol version 2 only.
1.1 stevesk 1268: .It Cm StrictHostKeyChecking
1269: If this flag is set to
1270: .Dq yes ,
1.84 jmc 1271: .Xr ssh 1
1.1 stevesk 1272: will never automatically add host keys to the
1.50 djm 1273: .Pa ~/.ssh/known_hosts
1.1 stevesk 1274: file, and refuses to connect to hosts whose host key has changed.
1275: This provides maximum protection against trojan horse attacks,
1.84 jmc 1276: though it can be annoying when the
1.1 stevesk 1277: .Pa /etc/ssh/ssh_known_hosts
1.84 jmc 1278: file is poorly maintained or when connections to new hosts are
1.1 stevesk 1279: frequently made.
1280: This option forces the user to manually
1281: add all new hosts.
1282: If this flag is set to
1283: .Dq no ,
1.84 jmc 1284: ssh will automatically add new host keys to the
1.1 stevesk 1285: user known hosts files.
1286: If this flag is set to
1287: .Dq ask ,
1288: new host keys
1289: will be added to the user known host files only after the user
1290: has confirmed that is what they really want to do, and
1.84 jmc 1291: ssh will refuse to connect to hosts whose host key has changed.
1.1 stevesk 1292: The host keys of
1293: known hosts will be verified automatically in all cases.
1294: The argument must be
1295: .Dq yes ,
1.84 jmc 1296: .Dq no ,
1.1 stevesk 1297: or
1298: .Dq ask .
1299: The default is
1300: .Dq ask .
1.26 markus 1301: .It Cm TCPKeepAlive
1302: Specifies whether the system should send TCP keepalive messages to the
1303: other side.
1304: If they are sent, death of the connection or crash of one
1305: of the machines will be properly noticed.
1306: However, this means that
1307: connections will die if the route is down temporarily, and some people
1308: find it annoying.
1309: .Pp
1310: The default is
1311: .Dq yes
1312: (to send TCP keepalive messages), and the client will notice
1313: if the network goes down or the remote host dies.
1314: This is important in scripts, and many users want it too.
1315: .Pp
1316: To disable TCP keepalive messages, the value should be set to
1317: .Dq no .
1.65 reyk 1318: .It Cm Tunnel
1.95 stevesk 1319: Request
1.65 reyk 1320: .Xr tun 4
1.69 jmc 1321: device forwarding between the client and the server.
1.65 reyk 1322: The argument must be
1.68 reyk 1323: .Dq yes ,
1.95 stevesk 1324: .Dq point-to-point
1325: (layer 3),
1326: .Dq ethernet
1327: (layer 2),
1.65 reyk 1328: or
1329: .Dq no .
1.95 stevesk 1330: Specifying
1331: .Dq yes
1332: requests the default tunnel mode, which is
1333: .Dq point-to-point .
1.65 reyk 1334: The default is
1335: .Dq no .
1336: .It Cm TunnelDevice
1.95 stevesk 1337: Specifies the
1.65 reyk 1338: .Xr tun 4
1.95 stevesk 1339: devices to open on the client
1340: .Pq Ar local_tun
1341: and the server
1342: .Pq Ar remote_tun .
1343: .Pp
1344: The argument must be
1345: .Sm off
1346: .Ar local_tun Op : Ar remote_tun .
1347: .Sm on
1348: The devices may be specified by numerical ID or the keyword
1349: .Dq any ,
1350: which uses the next available tunnel device.
1351: If
1352: .Ar remote_tun
1353: is not specified, it defaults to
1354: .Dq any .
1355: The default is
1356: .Dq any:any .
1.72 jmc 1357: .It Cm UsePrivilegedPort
1358: Specifies whether to use a privileged port for outgoing connections.
1359: The argument must be
1360: .Dq yes
1361: or
1362: .Dq no .
1363: The default is
1364: .Dq no .
1365: If set to
1.84 jmc 1366: .Dq yes ,
1367: .Xr ssh 1
1.72 jmc 1368: must be setuid root.
1369: Note that this option must be set to
1370: .Dq yes
1371: for
1372: .Cm RhostsRSAAuthentication
1373: with older servers.
1.1 stevesk 1374: .It Cm User
1375: Specifies the user to log in as.
1376: This can be useful when a different user name is used on different machines.
1377: This saves the trouble of
1378: having to remember to give the user name on the command line.
1379: .It Cm UserKnownHostsFile
1.151 djm 1380: Specifies one or more files to use for the user
1381: host key database, separated by whitespace.
1382: The default is
1383: .Pa ~/.ssh/known_hosts ,
1384: .Pa ~/.ssh/known_hosts2 .
1.8 jakob 1385: .It Cm VerifyHostKeyDNS
1386: Specifies whether to verify the remote key using DNS and SSHFP resource
1387: records.
1.24 jakob 1388: If this option is set to
1389: .Dq yes ,
1.25 jmc 1390: the client will implicitly trust keys that match a secure fingerprint
1.24 jakob 1391: from DNS.
1392: Insecure fingerprints will be handled as if this option was set to
1393: .Dq ask .
1394: If this option is set to
1395: .Dq ask ,
1396: information on fingerprint match will be displayed, but the user will still
1397: need to confirm new host keys according to the
1398: .Cm StrictHostKeyChecking
1399: option.
1400: The argument must be
1401: .Dq yes ,
1.84 jmc 1402: .Dq no ,
1.25 jmc 1403: or
1404: .Dq ask .
1.8 jakob 1405: The default is
1406: .Dq no .
1.12 jakob 1407: Note that this option applies to protocol version 2 only.
1.84 jmc 1408: .Pp
1.166 jmc 1409: See also VERIFYING HOST KEYS in
1.84 jmc 1410: .Xr ssh 1 .
1.111 grunk 1411: .It Cm VisualHostKey
1412: If this flag is set to
1413: .Dq yes ,
1414: an ASCII art representation of the remote host key fingerprint is
1.114 stevesk 1415: printed in addition to the hex fingerprint string at login and
1416: for unknown host keys.
1.111 grunk 1417: If this flag is set to
1418: .Dq no ,
1.114 stevesk 1419: no fingerprint strings are printed at login and
1420: only the hex fingerprint string will be printed for unknown host keys.
1.111 grunk 1421: The default is
1422: .Dq no .
1.1 stevesk 1423: .It Cm XAuthLocation
1.5 stevesk 1424: Specifies the full pathname of the
1.1 stevesk 1425: .Xr xauth 1
1426: program.
1427: The default is
1428: .Pa /usr/X11R6/bin/xauth .
1429: .El
1.86 jmc 1430: .Sh PATTERNS
1431: A
1432: .Em pattern
1433: consists of zero or more non-whitespace characters,
1434: .Sq *
1435: (a wildcard that matches zero or more characters),
1436: or
1437: .Sq ?\&
1438: (a wildcard that matches exactly one character).
1439: For example, to specify a set of declarations for any host in the
1440: .Dq .co.uk
1441: set of domains,
1442: the following pattern could be used:
1443: .Pp
1444: .Dl Host *.co.uk
1445: .Pp
1446: The following pattern
1447: would match any host in the 192.168.0.[0-9] network range:
1448: .Pp
1449: .Dl Host 192.168.0.?
1450: .Pp
1451: A
1452: .Em pattern-list
1453: is a comma-separated list of patterns.
1454: Patterns within pattern-lists may be negated
1455: by preceding them with an exclamation mark
1456: .Pq Sq !\& .
1457: For example,
1.174 djm 1458: to allow a key to be used from anywhere within an organization
1.86 jmc 1459: except from the
1460: .Dq dialup
1461: pool,
1462: the following entry (in authorized_keys) could be used:
1463: .Pp
1464: .Dl from=\&"!*.dialup.example.com,*.example.com\&"
1.1 stevesk 1465: .Sh FILES
1466: .Bl -tag -width Ds
1.50 djm 1467: .It Pa ~/.ssh/config
1.1 stevesk 1468: This is the per-user configuration file.
1469: The format of this file is described above.
1.84 jmc 1470: This file is used by the SSH client.
1.30 djm 1471: Because of the potential for abuse, this file must have strict permissions:
1472: read/write for the user, and not accessible by others.
1.1 stevesk 1473: .It Pa /etc/ssh/ssh_config
1474: Systemwide configuration file.
1475: This file provides defaults for those
1476: values that are not specified in the user's configuration file, and
1477: for those users who do not have a configuration file.
1478: This file must be world-readable.
1479: .El
1.13 jmc 1480: .Sh SEE ALSO
1481: .Xr ssh 1
1.1 stevesk 1482: .Sh AUTHORS
1483: OpenSSH is a derivative of the original and free
1484: ssh 1.2.12 release by Tatu Ylonen.
1485: Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1486: Theo de Raadt and Dug Song
1487: removed many bugs, re-added newer features and
1488: created OpenSSH.
1489: Markus Friedl contributed the support for SSH
1490: protocol versions 1.5 and 2.0.