]> andersk Git - gssapi-openssh.git/blame - openssh/ssh_config.5
merged OPENSSH_5_2P1_GSSAPI_20090831 to GPT-branch
[gssapi-openssh.git] / openssh / ssh_config.5
CommitLineData
ff2d7a98 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.\"
16eb0a3b 37.\" $OpenBSD: ssh_config.5,v 1.119 2009/02/22 23:50:57 djm Exp $
38.Dd $Mdocdate: February 22 2009 $
ff2d7a98 39.Dt SSH_CONFIG 5
40.Os
41.Sh NAME
42.Nm ssh_config
43.Nd OpenSSH SSH client configuration files
44.Sh SYNOPSIS
2278ffa1 45.Nm ~/.ssh/config
46.Nm /etc/ssh/ssh_config
ff2d7a98 47.Sh DESCRIPTION
2e437378 48.Xr ssh 1
ff2d7a98 49obtains configuration data from the following sources in
50the following order:
2e437378 51.Pp
e54b3d7c 52.Bl -enum -offset indent -compact
53.It
54command-line options
55.It
ff2d7a98 56user's configuration file
34fee935 57.Pq Pa ~/.ssh/config
e54b3d7c 58.It
59GSSAPI configuration file
60.Pq Pa $HOME/.ssh/config.gssapi
61.It
62Kerberos configuration file
63.Pq Pa $HOME/.ssh/config.krb
64.It
e54b3d7c 65system-wide configuration file
66.Pq Pa /etc/ssh/ssh_config
ff2d7a98 67.El
68.Pp
69For each parameter, the first obtained value
70will be used.
34fee935 71The configuration files contain sections separated by
ff2d7a98 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.
ff2d7a98 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 ,
2e437378 94.Nm scp ,
ff2d7a98 95and
96.Nm sftp
97.Fl o
98option.
2e437378 99Arguments may optionally be enclosed in double quotes
100.Pq \&"
101in order to represent arguments containing spaces.
ff2d7a98 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.
16eb0a3b 112If more than one pattern is provided, they should be separated by whitespace.
ff2d7a98 113A single
2e437378 114.Ql *
ff2d7a98 115as a pattern can be used to provide global
116defaults for all hosts.
117The host is the
118.Ar hostname
2e437378 119argument given on the command line (i.e. the name is not converted to
ff2d7a98 120a canonicalized host name before matching).
2e437378 121.Pp
122See
123.Sx PATTERNS
124for more information on patterns.
70791e56 125.It Cm AddressFamily
126Specifies which address family to use when connecting.
127Valid arguments are
128.Dq any ,
129.Dq inet
2e437378 130(use IPv4 only), or
70791e56 131.Dq inet6
34fee935 132(use IPv6 only).
ff2d7a98 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
34fee935 146Use the specified address on the local machine as the source address of
147the connection.
148Only useful on systems with more than one address.
ff2d7a98 149Note that this option does not work if
150.Cm UsePrivilegedPort
151is set to
152.Dq yes .
153.It Cm ChallengeResponseAuthentication
2e437378 154Specifies whether to use challenge-response authentication.
ff2d7a98 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 ,
2e437378 164.Xr ssh 1
165will additionally check the host IP address in the
ff2d7a98 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
2e437378 185.Xr ssh 1
ff2d7a98 186client for interoperability with legacy protocol 1 implementations
187that do not support the
188.Ar 3des
1c14df9e 189cipher.
190Its use is strongly discouraged due to cryptographic weaknesses.
ff2d7a98 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.
1b56ff3d 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 ,
34fee935 205.Dq arcfour128 ,
206.Dq arcfour256 ,
1b56ff3d 207.Dq arcfour ,
208.Dq blowfish-cbc ,
209and
210.Dq cast128-cbc .
2e437378 211The default is:
212.Bd -literal -offset 3n
16eb0a3b 213aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,
214aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,
215aes256-cbc,arcfour
ff2d7a98 216.Ed
217.It Cm ClearAllForwardings
2e437378 218Specifies that all local, remote, and dynamic port forwardings
ff2d7a98 219specified in the configuration files or on the command line be
1c14df9e 220cleared.
221This option is primarily useful when used from the
2e437378 222.Xr ssh 1
ff2d7a98 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.
70791e56 254.It Cm ConnectTimeout
2e437378 255Specifies the timeout (in seconds) used when connecting to the
256SSH server, instead of using the default system TCP timeout.
70791e56 257This value is used only when the target is down or really unreachable,
258not when it refuses the connection.
1b56ff3d 259.It Cm ControlMaster
260Enables the sharing of multiple sessions over a single network connection.
261When set to
2e437378 262.Dq yes ,
263.Xr ssh 1
1b56ff3d 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).
e00da40d 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
1b56ff3d 278Setting this to
279.Dq ask
2e437378 280will cause ssh
1b56ff3d 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).
34fee935 286If the
287.Cm ControlPath
2e437378 288cannot be opened,
289ssh will continue without connecting to a master instance.
34fee935 290.Pp
291X11 and
292.Xr ssh-agent 1
293forwarding is supported over these multiplexed connections, however the
e00da40d 294display and agent forwarded will be the one belonging to the master
34fee935 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.
1b56ff3d 307.It Cm ControlPath
34fee935 308Specify the path to the control socket used for connection sharing as described
309in the
1b56ff3d 310.Cm ControlMaster
34fee935 311section above or the string
312.Dq none
313to disable connection sharing.
314In the path,
2e437378 315.Ql %l
316will be substituted by the local host name,
34fee935 317.Ql %h
318will be substituted by the target host name,
319.Ql %p
2e437378 320the port, and
34fee935 321.Ql %r
322by the remote login username.
323It is recommended that any
324.Cm ControlPath
325used for opportunistic connection sharing include
2e437378 326at least %h, %p, and %r.
34fee935 327This ensures that shared connections are uniquely identified.
ff2d7a98 328.It Cm DynamicForward
e00da40d 329Specifies that a TCP port on the local machine be forwarded
ff2d7a98 330over the secure channel, and the application
331protocol is then used to determine where to connect to from the
1c14df9e 332remote machine.
e00da40d 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
70791e56 356Currently the SOCKS4 and SOCKS5 protocols are supported, and
2e437378 357.Xr ssh 1
70791e56 358will act as a SOCKS server.
ff2d7a98 359Multiple forwardings may be specified, and
1c14df9e 360additional forwardings can be given on the command line.
361Only the superuser can forward privileged ports.
70791e56 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 .
416fd2a8 377This option should be placed in the non-hostspecific section.
70791e56 378See
379.Xr ssh-keysign 8
380for more information.
ff2d7a98 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).
2e437378 393.It Cm ExitOnForwardFailure
394Specifies whether
395.Xr ssh 1
396should terminate the connection if it cannot set up all requested
25d429a2 397dynamic, tunnel, local, and remote port forwardings.
2e437378 398The argument must be
399.Dq yes
400or
401.Dq no .
402The default is
403.Dq no .
ff2d7a98 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 .
e54b3d7c 413.Pp
1c14df9e 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,
e54b3d7c 419however they can perform operations on the keys that enable them to
420authenticate using the identities loaded into the agent.
ff2d7a98 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 .
e54b3d7c 432.Pp
1c14df9e 433X11 forwarding should be enabled with caution.
434Users with the ability to bypass file permissions on the remote host
416fd2a8 435(for the user's X11 authorization database)
1c14df9e 436can access the local X11 display through the forwarded connection.
416fd2a8 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
1b56ff3d 442If this option is set to
2e437378 443.Dq yes ,
444remote X11 clients will have full access to the original X11 display.
34fee935 445.Pp
416fd2a8 446If this option is set to
2e437378 447.Dq no ,
448remote X11 clients will be considered untrusted and prevented
416fd2a8 449from stealing or tampering with data belonging to trusted X11
450clients.
34fee935 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.
416fd2a8 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.
ff2d7a98 461.It Cm GatewayPorts
462Specifies whether remote hosts are allowed to connect to local
463forwarded ports.
464By default,
2e437378 465.Xr ssh 1
1c14df9e 466binds local port forwardings to the loopback address.
467This prevents other remote hosts from connecting to forwarded ports.
ff2d7a98 468.Cm GatewayPorts
2e437378 469can be used to specify that ssh
ff2d7a98 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 .
70791e56 482.It Cm GSSAPIAuthentication
416fd2a8 483Specifies whether user authentication based on GSSAPI is allowed.
2e437378 484The default is
ff2d7a98 485.Dq yes .
70791e56 486Note that this option applies to protocol version 2 only.
487.It Cm GSSAPIKeyExchange
98f19977 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 .
70791e56 492Note that this option applies to protocol version 2 only.
46201ce0 493.It Cm GSSAPIClientIdentity
494If set, specifies the GSSAPI client identity that ssh should use when
495connecting to the server. The default is unset, which means that the default
496identity will be used.
70791e56 497.It Cm GSSAPIDelegateCredentials
498Forward (delegate) credentials to the server.
ff2d7a98 499The default is
500.Dq yes .
46201ce0 501Note that this option applies to protocol version 2 connections using GSSAPI.
502.It Cm GSSAPIRenewalForcesRekey
503If set to
504.Dq yes
505then renewal of the client's GSSAPI credentials will force the rekeying of the
506ssh connection. With a compatible server, this can delegate the renewed
507credentials to a session on the server.
508The default is
509.Dq yes .
34fee935 510.It Cm GSSAPITrustDns
511Set to
46201ce0 512.Dq yes to indicate that the DNS is trusted to securely canonicalize
34fee935 513the name of the host being connected to. If
46201ce0 514.Dq no, the hostname entered on the
34fee935 515command line will be passed untouched to the GSSAPI library.
516The default is
517.Dq yes .
2e437378 518This option only applies to protocol version 2 connections using GSSAPI.
34fee935 519.It Cm HashKnownHosts
520Indicates that
2e437378 521.Xr ssh 1
34fee935 522should hash host names and addresses when they are added to
523.Pa ~/.ssh/known_hosts .
524These hashed names may be used normally by
2e437378 525.Xr ssh 1
34fee935 526and
2e437378 527.Xr sshd 8 ,
34fee935 528but they do not reveal identifying information should the file's contents
529be disclosed.
530The default is
531.Dq no .
2e437378 532Note that existing names and addresses in known hosts files
533will not be converted automatically,
534but may be manually hashed using
34fee935 535.Xr ssh-keygen 1 .
ff2d7a98 536.It Cm HostbasedAuthentication
537Specifies whether to try rhosts based authentication with public key
538authentication.
539The argument must be
540.Dq yes
541or
542.Dq no .
543The default is
544.Dq no .
545This option applies to protocol version 2 only and
546is similar to
547.Cm RhostsRSAAuthentication .
548.It Cm HostKeyAlgorithms
549Specifies the protocol version 2 host key algorithms
550that the client wants to use in order of preference.
551The default for this option is:
552.Dq ssh-rsa,ssh-dss .
553.It Cm HostKeyAlias
554Specifies an alias that should be used instead of the
555real host name when looking up or saving the host key
556in the host key database files.
2e437378 557This option is useful for tunneling SSH connections
ff2d7a98 558or for multiple servers running on a single host.
559.It Cm HostName
560Specifies the real host name to log into.
561This can be used to specify nicknames or abbreviations for hosts.
2e437378 562The default is the name given on the command line.
ff2d7a98 563Numeric IP addresses are also permitted (both on the command line and in
564.Cm HostName
565specifications).
2a304a95 566.It Cm IdentitiesOnly
567Specifies that
2e437378 568.Xr ssh 1
2a304a95 569should only use the authentication identity files configured in the
1b56ff3d 570.Nm
2a304a95 571files,
2e437378 572even if
573.Xr ssh-agent 1
2a304a95 574offers more identities.
575The argument to this keyword must be
576.Dq yes
577or
578.Dq no .
2e437378 579This option is intended for situations where ssh-agent
2a304a95 580offers many different identities.
581The default is
582.Dq no .
e00da40d 583.It Cm IdentityFile
584Specifies a file from which the user's RSA or DSA authentication identity
585is read.
586The default is
587.Pa ~/.ssh/identity
588for protocol version 1, and
589.Pa ~/.ssh/id_rsa
590and
591.Pa ~/.ssh/id_dsa
592for protocol version 2.
593Additionally, any identities represented by the authentication agent
594will be used for authentication.
2e437378 595.Pp
e00da40d 596The file name may use the tilde
2e437378 597syntax to refer to a user's home directory or one of the following
598escape characters:
599.Ql %d
600(local user's home directory),
601.Ql %u
602(local user name),
603.Ql %l
604(local host name),
605.Ql %h
606(remote host name) or
607.Ql %r
608(remote user name).
609.Pp
e00da40d 610It is possible to have
611multiple identity files specified in configuration files; all these
612identities will be tried in sequence.
bd5d5d2a 613.It Cm KbdInteractiveAuthentication
614Specifies whether to use keyboard-interactive authentication.
615The argument to this keyword must be
616.Dq yes
617or
618.Dq no .
619The default is
620.Dq yes .
34fee935 621.It Cm KbdInteractiveDevices
622Specifies the list of methods to use in keyboard-interactive authentication.
623Multiple method names must be comma-separated.
624The default is to use the server specified list.
2e437378 625The methods available vary depending on what the server supports.
626For an OpenSSH server,
627it may be zero or more of:
628.Dq bsdauth ,
629.Dq pam ,
630and
631.Dq skey .
e00da40d 632.It Cm LocalCommand
633Specifies a command to execute on the local machine after successfully
634connecting to the server.
635The command string extends to the end of the line, and is executed with
bd5d5d2a 636the user's shell.
6f25cbdd 637The following escape character substitutions will be performed:
638.Ql %d
639(local user's home directory),
640.Ql %h
641(remote host name),
642.Ql %l
643(local host name),
644.Ql %n
645(host name as provided on the command line),
646.Ql %p
647(remote port),
648.Ql %r
649(remote user name) or
650.Ql %u
651(local user name).
e00da40d 652This directive is ignored unless
653.Cm PermitLocalCommand
654has been enabled.
ff2d7a98 655.It Cm LocalForward
e00da40d 656Specifies that a TCP port on the local machine be forwarded over
ff2d7a98 657the secure channel to the specified host and port from the remote machine.
34fee935 658The first argument must be
659.Sm off
660.Oo Ar bind_address : Oc Ar port
661.Sm on
662and the second argument must be
663.Ar host : Ns Ar hostport .
664IPv6 addresses can be specified by enclosing addresses in square brackets or
665by using an alternative syntax:
666.Oo Ar bind_address Ns / Oc Ns Ar port
667and
668.Ar host Ns / Ns Ar hostport .
669Multiple forwardings may be specified, and additional forwardings can be
670given on the command line.
ff2d7a98 671Only the superuser can forward privileged ports.
34fee935 672By default, the local port is bound in accordance with the
673.Cm GatewayPorts
674setting.
675However, an explicit
676.Ar bind_address
677may be used to bind the connection to a specific address.
678The
679.Ar bind_address
680of
681.Dq localhost
682indicates that the listening port be bound for local use only, while an
683empty address or
684.Sq *
685indicates that the port should be available from all interfaces.
ff2d7a98 686.It Cm LogLevel
687Gives the verbosity level that is used when logging messages from
2e437378 688.Xr ssh 1 .
ff2d7a98 689The possible values are:
2e437378 690QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
1c14df9e 691The default is INFO.
692DEBUG and DEBUG1 are equivalent.
693DEBUG2 and DEBUG3 each specify higher levels of verbose output.
ff2d7a98 694.It Cm MACs
695Specifies the MAC (message authentication code) algorithms
696in order of preference.
697The MAC algorithm is used in protocol version 2
698for data integrity protection.
699Multiple algorithms must be comma-separated.
2e437378 700The default is:
25d429a2 701.Bd -literal -offset indent
702hmac-md5,hmac-sha1,umac-64@openssh.com,
703hmac-ripemd160,hmac-sha1-96,hmac-md5-96
704.Ed
ff2d7a98 705.It Cm NoHostAuthenticationForLocalhost
706This option can be used if the home directory is shared across machines.
707In this case localhost will refer to a different machine on each of
708the machines and the user will get many warnings about changed host keys.
709However, this option disables host authentication for localhost.
710The argument to this keyword must be
711.Dq yes
712or
713.Dq no .
714The default is to check the host key for localhost.
715.It Cm NumberOfPasswordPrompts
716Specifies the number of password prompts before giving up.
717The argument to this keyword must be an integer.
2e437378 718The default is 3.
ff2d7a98 719.It Cm PasswordAuthentication
720Specifies whether to use password authentication.
721The argument to this keyword must be
722.Dq yes
723or
724.Dq no .
725The default is
726.Dq yes .
e00da40d 727.It Cm PermitLocalCommand
728Allow local command execution via the
729.Ic LocalCommand
730option or using the
731.Ic !\& Ns Ar command
732escape sequence in
733.Xr ssh 1 .
734The argument must be
735.Dq yes
736or
737.Dq no .
738The default is
739.Dq no .
ff2d7a98 740.It Cm Port
741Specifies the port number to connect on the remote host.
2e437378 742The default is 22.
ff2d7a98 743.It Cm PreferredAuthentications
744Specifies the order in which the client should try protocol 2
70791e56 745authentication methods.
34fee935 746This allows a client to prefer one method (e.g.\&
ff2d7a98 747.Cm keyboard-interactive )
34fee935 748over another method (e.g.\&
ff2d7a98 749.Cm password )
750The default for this option is:
2e437378 751.Do gssapi-keyex ,
752external-keyx,
753gssapi-with-mic,
754hostbased,
755publickey,
756keyboard-interactive,
757password
758.Dc .
ff2d7a98 759.It Cm Protocol
760Specifies the protocol versions
2e437378 761.Xr ssh 1
ff2d7a98 762should support in order of preference.
763The possible values are
2e437378 764.Sq 1
ff2d7a98 765and
2e437378 766.Sq 2 .
ff2d7a98 767Multiple versions must be comma-separated.
768The default is
769.Dq 2,1 .
2e437378 770This means that ssh
ff2d7a98 771tries version 2 and falls back to version 1
772if version 2 is not available.
773.It Cm ProxyCommand
774Specifies the command to use to connect to the server.
775The command
776string extends to the end of the line, and is executed with
bd5d5d2a 777the user's shell.
ff2d7a98 778In the command string,
779.Ql %h
780will be substituted by the host name to
781connect and
782.Ql %p
783by the port.
784The command can be basically anything,
785and should read from its standard input and write to its standard output.
786It should eventually connect an
787.Xr sshd 8
788server running on some machine, or execute
789.Ic sshd -i
790somewhere.
791Host key management will be done using the
792HostName of the host being connected (defaulting to the name typed by
793the user).
1c14df9e 794Setting the command to
795.Dq none
796disables this option entirely.
ff2d7a98 797Note that
798.Cm CheckHostIP
799is not available for connects with a proxy command.
800.Pp
34fee935 801This directive is useful in conjunction with
802.Xr nc 1
803and its proxy support.
804For example, the following directive would connect via an HTTP proxy at
805192.0.2.0:
806.Bd -literal -offset 3n
807ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p
808.Ed
ff2d7a98 809.It Cm PubkeyAuthentication
810Specifies whether to try public key authentication.
811The argument to this keyword must be
812.Dq yes
813or
814.Dq no .
815The default is
816.Dq yes .
817This option applies to protocol version 2 only.
e00da40d 818.It Cm RekeyLimit
819Specifies the maximum amount of data that may be transmitted before the
820session key is renegotiated.
821The argument is the number of bytes, with an optional suffix of
822.Sq K ,
823.Sq M ,
824or
825.Sq G
826to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
827The default is between
2e437378 828.Sq 1G
e00da40d 829and
2e437378 830.Sq 4G ,
e00da40d 831depending on the cipher.
832This option applies to protocol version 2 only.
ff2d7a98 833.It Cm RemoteForward
e00da40d 834Specifies that a TCP port on the remote machine be forwarded over
ff2d7a98 835the secure channel to the specified host and port from the local machine.
34fee935 836The first argument must be
837.Sm off
838.Oo Ar bind_address : Oc Ar port
839.Sm on
840and the second argument must be
841.Ar host : Ns Ar hostport .
842IPv6 addresses can be specified by enclosing addresses in square brackets
843or by using an alternative syntax:
844.Oo Ar bind_address Ns / Oc Ns Ar port
845and
846.Ar host Ns / Ns Ar hostport .
ff2d7a98 847Multiple forwardings may be specified, and additional
848forwardings can be given on the command line.
16eb0a3b 849Privileged ports can be forwarded only when
850logging in as root on the remote machine.
851.Pp
852If the
853.Ar port
854argument is
855.Ql 0 ,
856the listen port will be dynamically allocated on the server and reported
857to the client at run time.
34fee935 858.Pp
859If the
860.Ar bind_address
861is not specified, the default is to only bind to loopback addresses.
862If the
863.Ar bind_address
864is
865.Ql *
866or an empty string, then the forwarding is requested to listen on all
867interfaces.
868Specifying a remote
869.Ar bind_address
870will only succeed if the server's
871.Cm GatewayPorts
872option is enabled (see
873.Xr sshd_config 5 ) .
ff2d7a98 874.It Cm RhostsRSAAuthentication
875Specifies whether to try rhosts based authentication with RSA host
876authentication.
877The argument must be
878.Dq yes
879or
880.Dq no .
881The default is
882.Dq no .
883This option applies to protocol version 1 only and requires
2e437378 884.Xr ssh 1
ff2d7a98 885to be setuid root.
886.It Cm RSAAuthentication
887Specifies whether to try RSA authentication.
888The argument to this keyword must be
889.Dq yes
890or
891.Dq no .
892RSA authentication will only be
893attempted if the identity file exists, or an authentication agent is
894running.
895The default is
896.Dq yes .
897Note that this option applies to protocol version 1 only.
1b56ff3d 898.It Cm SendEnv
899Specifies what variables from the local
900.Xr environ 7
901should be sent to the server.
2e437378 902Note that environment passing is only supported for protocol 2.
903The server must also support it, and the server must be configured to
1b56ff3d 904accept these environment variables.
905Refer to
906.Cm AcceptEnv
907in
908.Xr sshd_config 5
909for how to configure the server.
2e437378 910Variables are specified by name, which may contain wildcard characters.
1b56ff3d 911Multiple environment variables may be separated by whitespace or spread
912across multiple
913.Cm SendEnv
914directives.
915The default is not to send any environment variables.
2e437378 916.Pp
917See
918.Sx PATTERNS
919for more information on patterns.
416fd2a8 920.It Cm ServerAliveCountMax
e00da40d 921Sets the number of server alive messages (see below) which may be
416fd2a8 922sent without
2e437378 923.Xr ssh 1
416fd2a8 924receiving any messages back from the server.
925If this threshold is reached while server alive messages are being sent,
2e437378 926ssh will disconnect from the server, terminating the session.
416fd2a8 927It is important to note that the use of server alive messages is very
928different from
929.Cm TCPKeepAlive
930(below).
931The server alive messages are sent through the encrypted channel
932and therefore will not be spoofable.
933The TCP keepalive option enabled by
934.Cm TCPKeepAlive
935is spoofable.
936The server alive mechanism is valuable when the client or
937server depend on knowing when a connection has become inactive.
938.Pp
939The default value is 3.
940If, for example,
941.Cm ServerAliveInterval
2e437378 942(see below) is set to 15 and
416fd2a8 943.Cm ServerAliveCountMax
2e437378 944is left at the default, if the server becomes unresponsive,
945ssh will disconnect after approximately 45 seconds.
946This option applies to protocol version 2 only.
e00da40d 947.It Cm ServerAliveInterval
948Sets a timeout interval in seconds after which if no data has been received
949from the server,
2e437378 950.Xr ssh 1
e00da40d 951will send a message through the encrypted
952channel to request a response from the server.
953The default
954is 0, indicating that these messages will not be sent to the server.
955This option applies to protocol version 2 only.
ff2d7a98 956.It Cm SmartcardDevice
70791e56 957Specifies which smartcard device to use.
958The argument to this keyword is the device
2e437378 959.Xr ssh 1
ff2d7a98 960should use to communicate with a smartcard used for storing the user's
70791e56 961private RSA key.
962By default, no device is specified and smartcard support is not activated.
ff2d7a98 963.It Cm StrictHostKeyChecking
964If this flag is set to
965.Dq yes ,
2e437378 966.Xr ssh 1
ff2d7a98 967will never automatically add host keys to the
34fee935 968.Pa ~/.ssh/known_hosts
ff2d7a98 969file, and refuses to connect to hosts whose host key has changed.
970This provides maximum protection against trojan horse attacks,
2e437378 971though it can be annoying when the
ff2d7a98 972.Pa /etc/ssh/ssh_known_hosts
2e437378 973file is poorly maintained or when connections to new hosts are
ff2d7a98 974frequently made.
975This option forces the user to manually
976add all new hosts.
977If this flag is set to
978.Dq no ,
2e437378 979ssh will automatically add new host keys to the
ff2d7a98 980user known hosts files.
981If this flag is set to
982.Dq ask ,
983new host keys
984will be added to the user known host files only after the user
985has confirmed that is what they really want to do, and
2e437378 986ssh will refuse to connect to hosts whose host key has changed.
ff2d7a98 987The host keys of
988known hosts will be verified automatically in all cases.
989The argument must be
990.Dq yes ,
2e437378 991.Dq no ,
ff2d7a98 992or
993.Dq ask .
994The default is
995.Dq ask .
416fd2a8 996.It Cm TCPKeepAlive
997Specifies whether the system should send TCP keepalive messages to the
998other side.
999If they are sent, death of the connection or crash of one
1000of the machines will be properly noticed.
1001However, this means that
1002connections will die if the route is down temporarily, and some people
1003find it annoying.
1004.Pp
1005The default is
1006.Dq yes
1007(to send TCP keepalive messages), and the client will notice
1008if the network goes down or the remote host dies.
1009This is important in scripts, and many users want it too.
1010.Pp
1011To disable TCP keepalive messages, the value should be set to
1012.Dq no .
e00da40d 1013.It Cm Tunnel
2e437378 1014Request
e00da40d 1015.Xr tun 4
1016device forwarding between the client and the server.
e00da40d 1017The argument must be
1018.Dq yes ,
2e437378 1019.Dq point-to-point
1020(layer 3),
e00da40d 1021.Dq ethernet
2e437378 1022(layer 2),
e00da40d 1023or
1024.Dq no .
2e437378 1025Specifying
1026.Dq yes
1027requests the default tunnel mode, which is
1028.Dq point-to-point .
e00da40d 1029The default is
1030.Dq no .
1031.It Cm TunnelDevice
2e437378 1032Specifies the
e00da40d 1033.Xr tun 4
2e437378 1034devices to open on the client
1035.Pq Ar local_tun
1036and the server
1037.Pq Ar remote_tun .
1038.Pp
1039The argument must be
1040.Sm off
1041.Ar local_tun Op : Ar remote_tun .
1042.Sm on
1043The devices may be specified by numerical ID or the keyword
1044.Dq any ,
1045which uses the next available tunnel device.
1046If
1047.Ar remote_tun
1048is not specified, it defaults to
1049.Dq any .
1050The default is
1051.Dq any:any .
ff2d7a98 1052.It Cm UsePrivilegedPort
1053Specifies whether to use a privileged port for outgoing connections.
1054The argument must be
1055.Dq yes
1056or
1057.Dq no .
1058The default is
1059.Dq no .
e54b3d7c 1060If set to
2e437378 1061.Dq yes ,
1062.Xr ssh 1
e54b3d7c 1063must be setuid root.
ff2d7a98 1064Note that this option must be set to
1065.Dq yes
70791e56 1066for
ff2d7a98 1067.Cm RhostsRSAAuthentication
70791e56 1068with older servers.
ff2d7a98 1069.It Cm User
1070Specifies the user to log in as.
1071This can be useful when a different user name is used on different machines.
1072This saves the trouble of
1073having to remember to give the user name on the command line.
1074.It Cm UserKnownHostsFile
1075Specifies a file to use for the user
1076host key database instead of
34fee935 1077.Pa ~/.ssh/known_hosts .
70791e56 1078.It Cm VerifyHostKeyDNS
1079Specifies whether to verify the remote key using DNS and SSHFP resource
1080records.
416fd2a8 1081If this option is set to
1082.Dq yes ,
1083the client will implicitly trust keys that match a secure fingerprint
1084from DNS.
1085Insecure fingerprints will be handled as if this option was set to
1086.Dq ask .
1087If this option is set to
1088.Dq ask ,
1089information on fingerprint match will be displayed, but the user will still
1090need to confirm new host keys according to the
1091.Cm StrictHostKeyChecking
1092option.
1093The argument must be
1094.Dq yes ,
2e437378 1095.Dq no ,
416fd2a8 1096or
1097.Dq ask .
70791e56 1098The default is
1099.Dq no .
1100Note that this option applies to protocol version 2 only.
2e437378 1101.Pp
1102See also
1103.Sx VERIFYING HOST KEYS
1104in
1105.Xr ssh 1 .
6f25cbdd 1106.It Cm VisualHostKey
1107If this flag is set to
1108.Dq yes ,
1109an ASCII art representation of the remote host key fingerprint is
16eb0a3b 1110printed in addition to the hex fingerprint string at login and
1111for unknown host keys.
6f25cbdd 1112If this flag is set to
1113.Dq no ,
16eb0a3b 1114no fingerprint strings are printed at login and
1115only the hex fingerprint string will be printed for unknown host keys.
6f25cbdd 1116The default is
1117.Dq no .
ff2d7a98 1118.It Cm XAuthLocation
e54b3d7c 1119Specifies the full pathname of the
ff2d7a98 1120.Xr xauth 1
1121program.
1122The default is
1123.Pa /usr/X11R6/bin/xauth .
1124.El
2e437378 1125.Sh PATTERNS
1126A
1127.Em pattern
1128consists of zero or more non-whitespace characters,
1129.Sq *
1130(a wildcard that matches zero or more characters),
1131or
1132.Sq ?\&
1133(a wildcard that matches exactly one character).
1134For example, to specify a set of declarations for any host in the
1135.Dq .co.uk
1136set of domains,
1137the following pattern could be used:
1138.Pp
1139.Dl Host *.co.uk
1140.Pp
1141The following pattern
1142would match any host in the 192.168.0.[0-9] network range:
1143.Pp
1144.Dl Host 192.168.0.?
1145.Pp
1146A
1147.Em pattern-list
1148is a comma-separated list of patterns.
1149Patterns within pattern-lists may be negated
1150by preceding them with an exclamation mark
1151.Pq Sq !\& .
1152For example,
1153to allow a key to be used from anywhere within an organisation
1154except from the
1155.Dq dialup
1156pool,
1157the following entry (in authorized_keys) could be used:
1158.Pp
1159.Dl from=\&"!*.dialup.example.com,*.example.com\&"
ff2d7a98 1160.Sh FILES
1161.Bl -tag -width Ds
34fee935 1162.It Pa ~/.ssh/config
ff2d7a98 1163This is the per-user configuration file.
1164The format of this file is described above.
2e437378 1165This file is used by the SSH client.
1b56ff3d 1166Because of the potential for abuse, this file must have strict permissions:
1167read/write for the user, and not accessible by others.
ff2d7a98 1168.It Pa /etc/ssh/ssh_config
1169Systemwide configuration file.
1170This file provides defaults for those
1171values that are not specified in the user's configuration file, and
1172for those users who do not have a configuration file.
1173This file must be world-readable.
1174.El
70791e56 1175.Sh SEE ALSO
1176.Xr ssh 1
ff2d7a98 1177.Sh AUTHORS
1178OpenSSH is a derivative of the original and free
1179ssh 1.2.12 release by Tatu Ylonen.
1180Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1181Theo de Raadt and Dug Song
1182removed many bugs, re-added newer features and
1183created OpenSSH.
1184Markus Friedl contributed the support for SSH
1185protocol versions 1.5 and 2.0.
This page took 0.244328 seconds and 5 git commands to generate.