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