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