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