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