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