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