]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - crypto/openssh/ssh_config.5
This commit was generated by cvs2svn to compensate for changes in r159985,
[FreeBSD/FreeBSD.git] / crypto / openssh / ssh_config.5
1 .\"  -*- nroff -*-
2 .\"
3 .\" Author: Tatu Ylonen <ylo@cs.hut.fi>
4 .\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
5 .\"                    All rights reserved
6 .\"
7 .\" As far as I am concerned, the code I have written for this software
8 .\" can be used freely for any purpose.  Any derived versions of this
9 .\" software must be clearly marked as such, and if the derived work is
10 .\" incompatible with the protocol description in the RFC file, it must be
11 .\" called by a name other than "ssh" or "Secure Shell".
12 .\"
13 .\" Copyright (c) 1999,2000 Markus Friedl.  All rights reserved.
14 .\" Copyright (c) 1999 Aaron Campbell.  All rights reserved.
15 .\" Copyright (c) 1999 Theo de Raadt.  All rights reserved.
16 .\"
17 .\" Redistribution and use in source and binary forms, with or without
18 .\" modification, are permitted provided that the following conditions
19 .\" are met:
20 .\" 1. Redistributions of source code must retain the above copyright
21 .\"    notice, this list of conditions and the following disclaimer.
22 .\" 2. Redistributions in binary form must reproduce the above copyright
23 .\"    notice, this list of conditions and the following disclaimer in the
24 .\"    documentation and/or other materials provided with the distribution.
25 .\"
26 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
27 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
28 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
29 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
30 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
31 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 .\"
37 .\" $OpenBSD: ssh_config.5,v 1.76 2006/01/20 11:21:45 jmc Exp $
38 .\" $FreeBSD$
39 .Dd September 25, 1999
40 .Dt SSH_CONFIG 5
41 .Os
42 .Sh NAME
43 .Nm ssh_config
44 .Nd OpenSSH SSH client configuration files
45 .Sh SYNOPSIS
46 .Bl -tag -width Ds -compact
47 .It Pa ~/.ssh/config
48 .It Pa /etc/ssh/ssh_config
49 .El
50 .Sh DESCRIPTION
51 .Nm ssh
52 obtains configuration data from the following sources in
53 the following order:
54 .Bl -enum -offset indent -compact
55 .It
56 command-line options
57 .It
58 user's configuration file
59 .Pq Pa ~/.ssh/config
60 .It
61 system-wide configuration file
62 .Pq Pa /etc/ssh/ssh_config
63 .El
64 .Pp
65 For each parameter, the first obtained value
66 will be used.
67 The configuration files contain sections separated by
68 .Dq Host
69 specifications, and that section is only applied for hosts that
70 match one of the patterns given in the specification.
71 The matched host name is the one given on the command line.
72 .Pp
73 Since the first obtained value for each parameter is used, more
74 host-specific declarations should be given near the beginning of the
75 file, and general defaults at the end.
76 .Pp
77 The configuration file has the following format:
78 .Pp
79 Empty lines and lines starting with
80 .Ql #
81 are comments.
82 .Pp
83 Otherwise a line is of the format
84 .Dq keyword arguments .
85 Configuration options may be separated by whitespace or
86 optional whitespace and exactly one
87 .Ql = ;
88 the latter format is useful to avoid the need to quote whitespace
89 when specifying configuration options using the
90 .Nm ssh ,
91 .Nm scp
92 and
93 .Nm sftp
94 .Fl o
95 option.
96 .Pp
97 The possible
98 keywords and their meanings are as follows (note that
99 keywords are case-insensitive and arguments are case-sensitive):
100 .Bl -tag -width Ds
101 .It Cm Host
102 Restricts the following declarations (up to the next
103 .Cm Host
104 keyword) to be only for those hosts that match one of the patterns
105 given after the keyword.
106 .Ql \&*
107 and
108 .Ql \&?
109 can be used as wildcards in the
110 patterns.
111 A single
112 .Ql \&*
113 as a pattern can be used to provide global
114 defaults for all hosts.
115 The host is the
116 .Ar hostname
117 argument given on the command line (i.e., the name is not converted to
118 a canonicalized host name before matching).
119 .It Cm AddressFamily
120 Specifies which address family to use when connecting.
121 Valid arguments are
122 .Dq any ,
123 .Dq inet
124 (use IPv4 only) or
125 .Dq inet6
126 (use IPv6 only).
127 .It Cm BatchMode
128 If set to
129 .Dq yes ,
130 passphrase/password querying will be disabled.
131 This option is useful in scripts and other batch jobs where no user
132 is present to supply the password.
133 The argument must be
134 .Dq yes
135 or
136 .Dq no .
137 The default is
138 .Dq no .
139 .It Cm BindAddress
140 Use the specified address on the local machine as the source address of
141 the connection.
142 Only useful on systems with more than one address.
143 Note that this option does not work if
144 .Cm UsePrivilegedPort
145 is set to
146 .Dq yes .
147 .It Cm ChallengeResponseAuthentication
148 Specifies whether to use challenge response authentication.
149 The argument to this keyword must be
150 .Dq yes
151 or
152 .Dq no .
153 The default is
154 .Dq yes .
155 .It Cm CheckHostIP
156 If this flag is set to
157 .Dq yes ,
158 ssh 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 no .
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 .Nm ssh
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
206   ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,
207     arcfour256,arcfour,aes192-cbc,aes256-cbc,aes128-ctr,
208     aes192-ctr,aes256-ctr''
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 .Nm ssh
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 ssh
249 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 .Nm ssh
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
274 .Nm ssh
275 to listen for control connections, but require confirmation using the
276 .Ev SSH_ASKPASS
277 program before they are accepted (see
278 .Xr ssh-add 1
279 for details).
280 If the
281 .Cm ControlPath
282 can not be opened,
283 .Nm ssh
284 will continue without connecting to a master instance.
285 .Pp
286 X11 and
287 .Xr ssh-agent 1
288 forwarding is supported over these multiplexed connections, however the
289 display and agent forwarded will be the one belonging to the master
290 connection i.e. it is not possible to forward multiple displays or agents.
291 .Pp
292 Two additional options allow for opportunistic multiplexing: try to use a
293 master connection but fall back to creating a new one if one does not already
294 exist.
295 These options are:
296 .Dq auto
297 and
298 .Dq autoask .
299 The latter requires confirmation like the
300 .Dq ask
301 option.
302 .It Cm ControlPath
303 Specify the path to the control socket used for connection sharing as described
304 in the
305 .Cm ControlMaster
306 section above or the string
307 .Dq none
308 to disable connection sharing.
309 In the path,
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 all three of these escape sequences.
320 This ensures that shared connections are uniquely identified.
321 .It Cm DynamicForward
322 Specifies that a TCP port on the local machine be forwarded
323 over the secure channel, and the application
324 protocol is then used to determine where to connect to from the
325 remote machine.
326 .Pp
327 The argument must be
328 .Sm off
329 .Oo Ar bind_address : Oc Ar port .
330 .Sm on
331 IPv6 addresses can be specified by enclosing addresses in square brackets or
332 by using an alternative syntax:
333 .Oo Ar bind_address Ns / Oc Ns Ar port .
334 By default, the local port is bound in accordance with the
335 .Cm GatewayPorts
336 setting.
337 However, an explicit
338 .Ar bind_address
339 may be used to bind the connection to a specific address.
340 The
341 .Ar bind_address
342 of
343 .Dq localhost
344 indicates that the listening port be bound for local use only, while an
345 empty address or
346 .Sq *
347 indicates that the port should be available from all interfaces.
348 .Pp
349 Currently the SOCKS4 and SOCKS5 protocols are supported, and
350 .Nm ssh
351 will act as a SOCKS server.
352 Multiple forwardings may be specified, and
353 additional forwardings can be given on the command line.
354 Only the superuser can forward privileged ports.
355 .It Cm EnableSSHKeysign
356 Setting this option to
357 .Dq yes
358 in the global client configuration file
359 .Pa /etc/ssh/ssh_config
360 enables the use of the helper program
361 .Xr ssh-keysign 8
362 during
363 .Cm HostbasedAuthentication .
364 The argument must be
365 .Dq yes
366 or
367 .Dq no .
368 The default is
369 .Dq no .
370 This option should be placed in the non-hostspecific section.
371 See
372 .Xr ssh-keysign 8
373 for more information.
374 .It Cm EscapeChar
375 Sets the escape character (default:
376 .Ql ~ ) .
377 The escape character can also
378 be set on the command line.
379 The argument should be a single character,
380 .Ql ^
381 followed by a letter, or
382 .Dq none
383 to disable the escape
384 character entirely (making the connection transparent for binary
385 data).
386 .It Cm ForwardAgent
387 Specifies whether the connection to the authentication agent (if any)
388 will be forwarded to the remote machine.
389 The argument must be
390 .Dq yes
391 or
392 .Dq no .
393 The default is
394 .Dq no .
395 .Pp
396 Agent forwarding should be enabled with caution.
397 Users with the ability to bypass file permissions on the remote host
398 (for the agent's Unix-domain socket)
399 can access the local agent through the forwarded connection.
400 An attacker cannot obtain key material from the agent,
401 however they can perform operations on the keys that enable them to
402 authenticate using the identities loaded into the agent.
403 .It Cm ForwardX11
404 Specifies whether X11 connections will be automatically redirected
405 over the secure channel and
406 .Ev DISPLAY
407 set.
408 The argument must be
409 .Dq yes
410 or
411 .Dq no .
412 The default is
413 .Dq no .
414 .Pp
415 X11 forwarding should be enabled with caution.
416 Users with the ability to bypass file permissions on the remote host
417 (for the user's X11 authorization database)
418 can access the local X11 display through the forwarded connection.
419 An attacker may then be able to perform activities such as keystroke monitoring
420 if the
421 .Cm ForwardX11Trusted
422 option is also enabled.
423 .It Cm ForwardX11Trusted
424 If this option is set to
425 .Dq yes
426 then remote X11 clients will have full access to the original X11 display.
427 .Pp
428 If this option is set to
429 .Dq no
430 then remote X11 clients will be considered untrusted and prevented
431 from stealing or tampering with data belonging to trusted X11
432 clients.
433 Furthermore, the
434 .Xr xauth 1
435 token used for the session will be set to expire after 20 minutes.
436 Remote clients will be refused access after this time.
437 .Pp
438 The default is
439 .Dq no .
440 .Pp
441 See the X11 SECURITY extension specification for full details on
442 the restrictions imposed on untrusted clients.
443 .It Cm GatewayPorts
444 Specifies whether remote hosts are allowed to connect to local
445 forwarded ports.
446 By default,
447 .Nm ssh
448 binds local port forwardings to the loopback address.
449 This prevents other remote hosts from connecting to forwarded ports.
450 .Cm GatewayPorts
451 can be used to specify that
452 .Nm ssh
453 should bind local port forwardings to the wildcard address,
454 thus allowing remote hosts to connect to forwarded ports.
455 The argument must be
456 .Dq yes
457 or
458 .Dq no .
459 The default is
460 .Dq no .
461 .It Cm GlobalKnownHostsFile
462 Specifies a file to use for the global
463 host key database instead of
464 .Pa /etc/ssh/ssh_known_hosts .
465 .It Cm GSSAPIAuthentication
466 Specifies whether user authentication based on GSSAPI is allowed.
467 The default is
468 .Dq no .
469 Note that this option applies to protocol version 2 only.
470 .It Cm GSSAPIDelegateCredentials
471 Forward (delegate) credentials to the server.
472 The default is
473 .Dq no .
474 Note that this option applies to protocol version 2 only.
475 .It Cm HashKnownHosts
476 Indicates that
477 .Nm ssh
478 should hash host names and addresses when they are added to
479 .Pa ~/.ssh/known_hosts .
480 These hashed names may be used normally by
481 .Nm ssh
482 and
483 .Nm sshd ,
484 but they do not reveal identifying information should the file's contents
485 be disclosed.
486 The default is
487 .Dq no .
488 Note that hashing of names and addresses will not be retrospectively applied
489 to existing known hosts files, but these may be manually hashed using
490 .Xr ssh-keygen 1 .
491 .It Cm HostbasedAuthentication
492 Specifies whether to try rhosts based authentication with public key
493 authentication.
494 The argument must be
495 .Dq yes
496 or
497 .Dq no .
498 The default is
499 .Dq no .
500 This option applies to protocol version 2 only and
501 is similar to
502 .Cm RhostsRSAAuthentication .
503 .It Cm HostKeyAlgorithms
504 Specifies the protocol version 2 host key algorithms
505 that the client wants to use in order of preference.
506 The default for this option is:
507 .Dq ssh-rsa,ssh-dss .
508 .It Cm HostKeyAlias
509 Specifies an alias that should be used instead of the
510 real host name when looking up or saving the host key
511 in the host key database files.
512 This option is useful for tunneling ssh connections
513 or for multiple servers running on a single host.
514 .It Cm HostName
515 Specifies the real host name to log into.
516 This can be used to specify nicknames or abbreviations for hosts.
517 Default is the name given on the command line.
518 Numeric IP addresses are also permitted (both on the command line and in
519 .Cm HostName
520 specifications).
521 .It Cm IdentitiesOnly
522 Specifies that
523 .Nm ssh
524 should only use the authentication identity files configured in the
525 .Nm
526 files,
527 even if the
528 .Nm ssh-agent
529 offers more identities.
530 The argument to this keyword must be
531 .Dq yes
532 or
533 .Dq no .
534 This option is intended for situations where
535 .Nm ssh-agent
536 offers many different identities.
537 The default is
538 .Dq no .
539 .It Cm IdentityFile
540 Specifies a file from which the user's RSA or DSA authentication identity
541 is read.
542 The default is
543 .Pa ~/.ssh/identity
544 for protocol version 1, and
545 .Pa ~/.ssh/id_rsa
546 and
547 .Pa ~/.ssh/id_dsa
548 for protocol version 2.
549 Additionally, any identities represented by the authentication agent
550 will be used for authentication.
551 The file name may use the tilde
552 syntax to refer to a user's home directory.
553 It is possible to have
554 multiple identity files specified in configuration files; all these
555 identities will be tried in sequence.
556 .It Cm KbdInteractiveDevices
557 Specifies the list of methods to use in keyboard-interactive authentication.
558 Multiple method names must be comma-separated.
559 The default is to use the server specified list.
560 .It Cm LocalCommand
561 Specifies a command to execute on the local machine after successfully
562 connecting to the server.
563 The command string extends to the end of the line, and is executed with
564 .Pa /bin/sh .
565 This directive is ignored unless
566 .Cm PermitLocalCommand
567 has been enabled.
568 .It Cm LocalForward
569 Specifies that a TCP port on the local machine be forwarded over
570 the secure channel to the specified host and port from the remote machine.
571 The first argument must be
572 .Sm off
573 .Oo Ar bind_address : Oc Ar port
574 .Sm on
575 and the second argument must be
576 .Ar host : Ns Ar hostport .
577 IPv6 addresses can be specified by enclosing addresses in square brackets or
578 by using an alternative syntax:
579 .Oo Ar bind_address Ns / Oc Ns Ar port
580 and
581 .Ar host Ns / Ns Ar hostport .
582 Multiple forwardings may be specified, and additional forwardings can be
583 given on the command line.
584 Only the superuser can forward privileged ports.
585 By default, the local port is bound in accordance with the
586 .Cm GatewayPorts
587 setting.
588 However, an explicit
589 .Ar bind_address
590 may be used to bind the connection to a specific address.
591 The
592 .Ar bind_address
593 of
594 .Dq localhost
595 indicates that the listening port be bound for local use only, while an
596 empty address or
597 .Sq *
598 indicates that the port should be available from all interfaces.
599 .It Cm LogLevel
600 Gives the verbosity level that is used when logging messages from
601 .Nm ssh .
602 The possible values are:
603 QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2 and DEBUG3.
604 The default is INFO.
605 DEBUG and DEBUG1 are equivalent.
606 DEBUG2 and DEBUG3 each specify higher levels of verbose output.
607 .It Cm MACs
608 Specifies the MAC (message authentication code) algorithms
609 in order of preference.
610 The MAC algorithm is used in protocol version 2
611 for data integrity protection.
612 Multiple algorithms must be comma-separated.
613 The default is
614 .Dq hmac-md5,hmac-sha1,hmac-ripemd160,hmac-sha1-96,hmac-md5-96 .
615 .It Cm NoHostAuthenticationForLocalhost
616 This option can be used if the home directory is shared across machines.
617 In this case localhost will refer to a different machine on each of
618 the machines and the user will get many warnings about changed host keys.
619 However, this option disables host authentication for localhost.
620 The argument to this keyword must be
621 .Dq yes
622 or
623 .Dq no .
624 The default is to check the host key for localhost.
625 .It Cm NumberOfPasswordPrompts
626 Specifies the number of password prompts before giving up.
627 The argument to this keyword must be an integer.
628 Default is 3.
629 .It Cm PasswordAuthentication
630 Specifies whether to use password authentication.
631 The argument to this keyword must be
632 .Dq yes
633 or
634 .Dq no .
635 The default is
636 .Dq yes .
637 .It Cm PermitLocalCommand
638 Allow local command execution via the
639 .Ic LocalCommand
640 option or using the
641 .Ic !\& Ns Ar command
642 escape sequence in
643 .Xr ssh 1 .
644 The argument must be
645 .Dq yes
646 or
647 .Dq no .
648 The default is
649 .Dq no .
650 .It Cm Port
651 Specifies the port number to connect on the remote host.
652 Default is 22.
653 .It Cm PreferredAuthentications
654 Specifies the order in which the client should try protocol 2
655 authentication methods.
656 This allows a client to prefer one method (e.g.\&
657 .Cm keyboard-interactive )
658 over another method (e.g.\&
659 .Cm password )
660 The default for this option is:
661 .Dq hostbased,publickey,keyboard-interactive,password .
662 .It Cm Protocol
663 Specifies the protocol versions
664 .Nm ssh
665 should support in order of preference.
666 The possible values are
667 .Dq 1
668 and
669 .Dq 2 .
670 Multiple versions must be comma-separated.
671 The default is
672 .Dq 2,1 .
673 This means that
674 .Nm ssh
675 tries version 2 and falls back to version 1
676 if version 2 is not available.
677 .It Cm ProxyCommand
678 Specifies the command to use to connect to the server.
679 The command
680 string extends to the end of the line, and is executed with
681 .Pa /bin/sh .
682 In the command string,
683 .Ql %h
684 will be substituted by the host name to
685 connect and
686 .Ql %p
687 by the port.
688 The command can be basically anything,
689 and should read from its standard input and write to its standard output.
690 It should eventually connect an
691 .Xr sshd 8
692 server running on some machine, or execute
693 .Ic sshd -i
694 somewhere.
695 Host key management will be done using the
696 HostName of the host being connected (defaulting to the name typed by
697 the user).
698 Setting the command to
699 .Dq none
700 disables this option entirely.
701 Note that
702 .Cm CheckHostIP
703 is not available for connects with a proxy command.
704 .Pp
705 This directive is useful in conjunction with
706 .Xr nc 1
707 and its proxy support.
708 For example, the following directive would connect via an HTTP proxy at
709 192.0.2.0:
710 .Bd -literal -offset 3n
711 ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p
712 .Ed
713 .It Cm PubkeyAuthentication
714 Specifies whether to try public key authentication.
715 The argument to this keyword must be
716 .Dq yes
717 or
718 .Dq no .
719 The default is
720 .Dq yes .
721 This option applies to protocol version 2 only.
722 .It Cm RekeyLimit
723 Specifies the maximum amount of data that may be transmitted before the
724 session key is renegotiated.
725 The argument is the number of bytes, with an optional suffix of
726 .Sq K ,
727 .Sq M ,
728 or
729 .Sq G
730 to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
731 The default is between
732 .Dq 1G
733 and
734 .Dq 4G ,
735 depending on the cipher.
736 This option applies to protocol version 2 only.
737 .It Cm RemoteForward
738 Specifies that a TCP port on the remote machine be forwarded over
739 the secure channel to the specified host and port from the local machine.
740 The first argument must be
741 .Sm off
742 .Oo Ar bind_address : Oc Ar port
743 .Sm on
744 and the second argument must be
745 .Ar host : Ns Ar hostport .
746 IPv6 addresses can be specified by enclosing addresses in square brackets
747 or by using an alternative syntax:
748 .Oo Ar bind_address Ns / Oc Ns Ar port
749 and
750 .Ar host Ns / Ns Ar hostport .
751 Multiple forwardings may be specified, and additional
752 forwardings can be given on the command line.
753 Only the superuser can forward privileged ports.
754 .Pp
755 If the
756 .Ar bind_address
757 is not specified, the default is to only bind to loopback addresses.
758 If the
759 .Ar bind_address
760 is
761 .Ql *
762 or an empty string, then the forwarding is requested to listen on all
763 interfaces.
764 Specifying a remote
765 .Ar bind_address
766 will only succeed if the server's
767 .Cm GatewayPorts
768 option is enabled (see
769 .Xr sshd_config 5 ) .
770 .It Cm RhostsRSAAuthentication
771 Specifies whether to try rhosts based authentication with RSA host
772 authentication.
773 The argument must be
774 .Dq yes
775 or
776 .Dq no .
777 The default is
778 .Dq no .
779 This option applies to protocol version 1 only and requires
780 .Nm ssh
781 to be setuid root.
782 .It Cm RSAAuthentication
783 Specifies whether to try RSA authentication.
784 The argument to this keyword must be
785 .Dq yes
786 or
787 .Dq no .
788 RSA authentication will only be
789 attempted if the identity file exists, or an authentication agent is
790 running.
791 The default is
792 .Dq yes .
793 Note that this option applies to protocol version 1 only.
794 .It Cm SendEnv
795 Specifies what variables from the local
796 .Xr environ 7
797 should be sent to the server.
798 Note that environment passing is only supported for protocol 2, the
799 server must also support it, and the server must be configured to
800 accept these environment variables.
801 Refer to
802 .Cm AcceptEnv
803 in
804 .Xr sshd_config 5
805 for how to configure the server.
806 Variables are specified by name, which may contain the wildcard characters
807 .Ql \&*
808 and
809 .Ql \&? .
810 Multiple environment variables may be separated by whitespace or spread
811 across multiple
812 .Cm SendEnv
813 directives.
814 The default is not to send any environment variables.
815 .It Cm ServerAliveCountMax
816 Sets the number of server alive messages (see below) which may be
817 sent without
818 .Nm ssh
819 receiving any messages back from the server.
820 If this threshold is reached while server alive messages are being sent,
821 .Nm ssh
822 will disconnect from the server, terminating the session.
823 It is important to note that the use of server alive messages is very
824 different from
825 .Cm TCPKeepAlive
826 (below).
827 The server alive messages are sent through the encrypted channel
828 and therefore will not be spoofable.
829 The TCP keepalive option enabled by
830 .Cm TCPKeepAlive
831 is spoofable.
832 The server alive mechanism is valuable when the client or
833 server depend on knowing when a connection has become inactive.
834 .Pp
835 The default value is 3.
836 If, for example,
837 .Cm ServerAliveInterval
838 (see below) is set to 15, and
839 .Cm ServerAliveCountMax
840 is left at the default, if the server becomes unresponsive ssh
841 will disconnect after approximately 45 seconds.
842 .It Cm ServerAliveInterval
843 Sets a timeout interval in seconds after which if no data has been received
844 from the server,
845 .Nm ssh
846 will send a message through the encrypted
847 channel to request a response from the server.
848 The default
849 is 0, indicating that these messages will not be sent to the server.
850 This option applies to protocol version 2 only.
851 .It Cm SmartcardDevice
852 Specifies which smartcard device to use.
853 The argument to this keyword is the device
854 .Nm ssh
855 should use to communicate with a smartcard used for storing the user's
856 private RSA key.
857 By default, no device is specified and smartcard support is not activated.
858 .It Cm StrictHostKeyChecking
859 If this flag is set to
860 .Dq yes ,
861 .Nm ssh
862 will never automatically add host keys to the
863 .Pa ~/.ssh/known_hosts
864 file, and refuses to connect to hosts whose host key has changed.
865 This provides maximum protection against trojan horse attacks,
866 however, can be annoying when the
867 .Pa /etc/ssh/ssh_known_hosts
868 file is poorly maintained, or connections to new hosts are
869 frequently made.
870 This option forces the user to manually
871 add all new hosts.
872 If this flag is set to
873 .Dq no ,
874 .Nm ssh
875 will automatically add new host keys to the
876 user known hosts files.
877 If this flag is set to
878 .Dq ask ,
879 new host keys
880 will be added to the user known host files only after the user
881 has confirmed that is what they really want to do, and
882 .Nm ssh
883 will refuse to connect to hosts whose host key has changed.
884 The host keys of
885 known hosts will be verified automatically in all cases.
886 The argument must be
887 .Dq yes ,
888 .Dq no
889 or
890 .Dq ask .
891 The default is
892 .Dq ask .
893 .It Cm TCPKeepAlive
894 Specifies whether the system should send TCP keepalive messages to the
895 other side.
896 If they are sent, death of the connection or crash of one
897 of the machines will be properly noticed.
898 However, this means that
899 connections will die if the route is down temporarily, and some people
900 find it annoying.
901 .Pp
902 The default is
903 .Dq yes
904 (to send TCP keepalive messages), and the client will notice
905 if the network goes down or the remote host dies.
906 This is important in scripts, and many users want it too.
907 .Pp
908 To disable TCP keepalive messages, the value should be set to
909 .Dq no .
910 .It Cm Tunnel
911 Request starting
912 .Xr tun 4
913 device forwarding between the client and the server.
914 This option also allows requesting layer 2 (ethernet)
915 instead of layer 3 (point-to-point) tunneling from the server.
916 The argument must be
917 .Dq yes ,
918 .Dq point-to-point ,
919 .Dq ethernet
920 or
921 .Dq no .
922 The default is
923 .Dq no .
924 .It Cm TunnelDevice
925 Force a specified
926 .Xr tun 4
927 device on the client.
928 Without this option, the next available device will be used.
929 .It Cm UsePrivilegedPort
930 Specifies whether to use a privileged port for outgoing connections.
931 The argument must be
932 .Dq yes
933 or
934 .Dq no .
935 The default is
936 .Dq no .
937 If set to
938 .Dq yes
939 .Nm ssh
940 must be setuid root.
941 Note that this option must be set to
942 .Dq yes
943 for
944 .Cm RhostsRSAAuthentication
945 with older servers.
946 .It Cm User
947 Specifies the user to log in as.
948 This can be useful when a different user name is used on different machines.
949 This saves the trouble of
950 having to remember to give the user name on the command line.
951 .It Cm UserKnownHostsFile
952 Specifies a file to use for the user
953 host key database instead of
954 .Pa ~/.ssh/known_hosts .
955 .It Cm VerifyHostKeyDNS
956 Specifies whether to verify the remote key using DNS and SSHFP resource
957 records.
958 If this option is set to
959 .Dq yes ,
960 the client will implicitly trust keys that match a secure fingerprint
961 from DNS.
962 Insecure fingerprints will be handled as if this option was set to
963 .Dq ask .
964 If this option is set to
965 .Dq ask ,
966 information on fingerprint match will be displayed, but the user will still
967 need to confirm new host keys according to the
968 .Cm StrictHostKeyChecking
969 option.
970 The argument must be
971 .Dq yes ,
972 .Dq no
973 or
974 .Dq ask .
975 The default is
976 .Dq no .
977 Note that this option applies to protocol version 2 only.
978 .It Cm VersionAddendum
979 Specifies a string to append to the regular version string to identify
980 OS- or site-specific modifications.
981 The default is
982 .Dq FreeBSD-20060322 .
983 .It Cm XAuthLocation
984 Specifies the full pathname of the
985 .Xr xauth 1
986 program.
987 The default is
988 .Pa /usr/X11R6/bin/xauth .
989 .El
990 .Sh FILES
991 .Bl -tag -width Ds
992 .It Pa ~/.ssh/config
993 This is the per-user configuration file.
994 The format of this file is described above.
995 This file is used by the
996 .Nm ssh
997 client.
998 Because of the potential for abuse, this file must have strict permissions:
999 read/write for the user, and not accessible by others.
1000 .It Pa /etc/ssh/ssh_config
1001 Systemwide configuration file.
1002 This file provides defaults for those
1003 values that are not specified in the user's configuration file, and
1004 for those users who do not have a configuration file.
1005 This file must be world-readable.
1006 .El
1007 .Sh SEE ALSO
1008 .Xr ssh 1
1009 .Sh AUTHORS
1010 OpenSSH is a derivative of the original and free
1011 ssh 1.2.12 release by Tatu Ylonen.
1012 Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1013 Theo de Raadt and Dug Song
1014 removed many bugs, re-added newer features and
1015 created OpenSSH.
1016 Markus Friedl contributed the support for SSH
1017 protocol versions 1.5 and 2.0.