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