]> andersk Git - gssapi-openssh.git/blame - openssh/ssh_config.5
hpn12v14 updates
[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.\"
30460aeb 37.\" $OpenBSD: ssh_config.5,v 1.97 2006/07/27 08:00:50 jmc Exp $
884dc78b 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
2ce0bfe4 46.It Pa ~/.ssh/config
884dc78b 47.It Pa /etc/ssh/ssh_config
48.El
49.Sh DESCRIPTION
30460aeb 50.Xr ssh 1
884dc78b 51obtains configuration data from the following sources in
52the following order:
30460aeb 53.Pp
d03f4262 54.Bl -enum -offset indent -compact
55.It
56command-line options
57.It
44a053a3 58user's configuration file
2ce0bfe4 59.Pq Pa ~/.ssh/config
d03f4262 60.It
d6862c36 61GSSAPI configuration file
d03f4262 62.Pq Pa $HOME/.ssh/config.gssapi
63.It
d6862c36 64Kerberos configuration file
d03f4262 65.Pq Pa $HOME/.ssh/config.krb
66.It
d03f4262 67system-wide configuration file
68.Pq Pa /etc/ssh/ssh_config
44a053a3 69.El
884dc78b 70.Pp
71For each parameter, the first obtained value
72will be used.
dfddba3d 73The configuration files contain sections separated by
884dc78b 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.
884dc78b 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 ,
30460aeb 96.Nm scp ,
884dc78b 97and
98.Nm sftp
99.Fl o
100option.
30460aeb 101Arguments may optionally be enclosed in double quotes
102.Pq \&"
103in order to represent arguments containing spaces.
884dc78b 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.
884dc78b 114A single
30460aeb 115.Ql *
884dc78b 116as a pattern can be used to provide global
117defaults for all hosts.
118The host is the
119.Ar hostname
30460aeb 120argument given on the command line (i.e. the name is not converted to
884dc78b 121a canonicalized host name before matching).
30460aeb 122.Pp
123See
124.Sx PATTERNS
125for more information on patterns.
7cac2b65 126.It Cm AddressFamily
127Specifies which address family to use when connecting.
128Valid arguments are
129.Dq any ,
130.Dq inet
30460aeb 131(use IPv4 only), or
7cac2b65 132.Dq inet6
dfddba3d 133(use IPv6 only).
884dc78b 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
2ce0bfe4 147Use the specified address on the local machine as the source address of
148the connection.
149Only useful on systems with more than one address.
884dc78b 150Note that this option does not work if
151.Cm UsePrivilegedPort
152is set to
153.Dq yes .
154.It Cm ChallengeResponseAuthentication
30460aeb 155Specifies whether to use challenge-response authentication.
884dc78b 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 ,
30460aeb 165.Xr ssh 1
166will additionally check the host IP address in the
884dc78b 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
30460aeb 186.Xr ssh 1
884dc78b 187client for interoperability with legacy protocol 1 implementations
188that do not support the
189.Ar 3des
bfe49944 190cipher.
191Its use is strongly discouraged due to cryptographic weaknesses.
884dc78b 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.
7e82606e 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 ,
2ce0bfe4 206.Dq arcfour128 ,
207.Dq arcfour256 ,
7e82606e 208.Dq arcfour ,
209.Dq blowfish-cbc ,
210and
211.Dq cast128-cbc .
30460aeb 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
884dc78b 217.Ed
218.It Cm ClearAllForwardings
30460aeb 219Specifies that all local, remote, and dynamic port forwardings
884dc78b 220specified in the configuration files or on the command line be
bfe49944 221cleared.
222This option is primarily useful when used from the
30460aeb 223.Xr ssh 1
884dc78b 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.
7cac2b65 255.It Cm ConnectTimeout
30460aeb 256Specifies the timeout (in seconds) used when connecting to the
257SSH server, instead of using the default system TCP timeout.
7cac2b65 258This value is used only when the target is down or really unreachable,
259not when it refuses the connection.
7e82606e 260.It Cm ControlMaster
261Enables the sharing of multiple sessions over a single network connection.
262When set to
30460aeb 263.Dq yes ,
264.Xr ssh 1
7e82606e 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).
08822d99 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
7e82606e 279Setting this to
280.Dq ask
30460aeb 281will cause ssh
7e82606e 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).
2ce0bfe4 287If the
288.Cm ControlPath
30460aeb 289cannot be opened,
290ssh will continue without connecting to a master instance.
2ce0bfe4 291.Pp
292X11 and
293.Xr ssh-agent 1
294forwarding is supported over these multiplexed connections, however the
08822d99 295display and agent forwarded will be the one belonging to the master
2ce0bfe4 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.
7e82606e 308.It Cm ControlPath
2ce0bfe4 309Specify the path to the control socket used for connection sharing as described
310in the
7e82606e 311.Cm ControlMaster
2ce0bfe4 312section above or the string
313.Dq none
314to disable connection sharing.
315In the path,
30460aeb 316.Ql %l
317will be substituted by the local host name,
2ce0bfe4 318.Ql %h
319will be substituted by the target host name,
320.Ql %p
30460aeb 321the port, and
2ce0bfe4 322.Ql %r
323by the remote login username.
324It is recommended that any
325.Cm ControlPath
326used for opportunistic connection sharing include
30460aeb 327at least %h, %p, and %r.
2ce0bfe4 328This ensures that shared connections are uniquely identified.
884dc78b 329.It Cm DynamicForward
08822d99 330Specifies that a TCP port on the local machine be forwarded
884dc78b 331over the secure channel, and the application
332protocol is then used to determine where to connect to from the
bfe49944 333remote machine.
08822d99 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
7cac2b65 357Currently the SOCKS4 and SOCKS5 protocols are supported, and
30460aeb 358.Xr ssh 1
7cac2b65 359will act as a SOCKS server.
884dc78b 360Multiple forwardings may be specified, and
bfe49944 361additional forwardings can be given on the command line.
362Only the superuser can forward privileged ports.
7cac2b65 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 .
540d72c3 378This option should be placed in the non-hostspecific section.
7cac2b65 379See
380.Xr ssh-keysign 8
381for more information.
884dc78b 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).
30460aeb 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 .
884dc78b 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 .
d03f4262 414.Pp
bfe49944 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,
d03f4262 420however they can perform operations on the keys that enable them to
421authenticate using the identities loaded into the agent.
884dc78b 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 .
d03f4262 433.Pp
bfe49944 434X11 forwarding should be enabled with caution.
435Users with the ability to bypass file permissions on the remote host
540d72c3 436(for the user's X11 authorization database)
bfe49944 437can access the local X11 display through the forwarded connection.
540d72c3 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
7e82606e 443If this option is set to
30460aeb 444.Dq yes ,
445remote X11 clients will have full access to the original X11 display.
dfddba3d 446.Pp
540d72c3 447If this option is set to
30460aeb 448.Dq no ,
449remote X11 clients will be considered untrusted and prevented
540d72c3 450from stealing or tampering with data belonging to trusted X11
451clients.
dfddba3d 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.
540d72c3 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.
884dc78b 462.It Cm GatewayPorts
463Specifies whether remote hosts are allowed to connect to local
464forwarded ports.
465By default,
30460aeb 466.Xr ssh 1
bfe49944 467binds local port forwardings to the loopback address.
468This prevents other remote hosts from connecting to forwarded ports.
884dc78b 469.Cm GatewayPorts
30460aeb 470can be used to specify that ssh
884dc78b 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 .
7cac2b65 483.It Cm GSSAPIAuthentication
540d72c3 484Specifies whether user authentication based on GSSAPI is allowed.
f713db99 485The default is
44a053a3 486.Dq yes .
85740ad2 487Note that this option applies to protocol version 2 only.
7cac2b65 488.It Cm GSSAPIKeyExchange
7a056ed1 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 .
85740ad2 493Note that this option applies to protocol version 2 only.
7cac2b65 494.It Cm GSSAPIDelegateCredentials
85740ad2 495Forward (delegate) credentials to the server.
44a053a3 496The default is
497.Dq yes .
85740ad2 498Note that this option applies to protocol version 2 only.
fe4ad273 499.It Cm GSSAPITrustDns
500Set to
f713db99 501.Dq yes
502to indicate that the DNS is trusted to securely canonicalize
fe4ad273 503the name of the host being connected to. If
9c0efabd 504.Dq no ,
f713db99 505the hostname entered on the
fe4ad273 506command line will be passed untouched to the GSSAPI library.
507The default is
508.Dq yes .
f713db99 509This option only applies to protocol version 2 connections using GSSAPI.
dfddba3d 510.It Cm HashKnownHosts
511Indicates that
30460aeb 512.Xr ssh 1
dfddba3d 513should hash host names and addresses when they are added to
2ce0bfe4 514.Pa ~/.ssh/known_hosts .
dfddba3d 515These hashed names may be used normally by
30460aeb 516.Xr ssh 1
dfddba3d 517and
30460aeb 518.Xr sshd 8 ,
dfddba3d 519but they do not reveal identifying information should the file's contents
520be disclosed.
521The default is
522.Dq no .
30460aeb 523Note that existing names and addresses in known hosts files
524will not be converted automatically,
525but may be manually hashed using
dfddba3d 526.Xr ssh-keygen 1 .
884dc78b 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.
30460aeb 548This option is useful for tunneling SSH connections
884dc78b 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.
30460aeb 553The default is the name given on the command line.
884dc78b 554Numeric IP addresses are also permitted (both on the command line and in
555.Cm HostName
556specifications).
12a403af 557.It Cm IdentitiesOnly
558Specifies that
30460aeb 559.Xr ssh 1
12a403af 560should only use the authentication identity files configured in the
7e82606e 561.Nm
12a403af 562files,
30460aeb 563even if
564.Xr ssh-agent 1
12a403af 565offers more identities.
566The argument to this keyword must be
567.Dq yes
568or
569.Dq no .
30460aeb 570This option is intended for situations where ssh-agent
12a403af 571offers many different identities.
572The default is
573.Dq no .
08822d99 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.
30460aeb 586.Pp
08822d99 587The file name may use the tilde
30460aeb 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
08822d99 601It is possible to have
602multiple identity files specified in configuration files; all these
603identities will be tried in sequence.
dfddba3d 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.
30460aeb 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 .
08822d99 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.
884dc78b 623.It Cm LocalForward
08822d99 624Specifies that a TCP port on the local machine be forwarded over
884dc78b 625the secure channel to the specified host and port from the remote machine.
8b32eddc 626The first argument must be
dfddba3d 627.Sm off
8b32eddc 628.Oo Ar bind_address : Oc Ar port
dfddba3d 629.Sm on
8b32eddc 630and the second argument must be
631.Ar host : Ns Ar hostport .
dfddba3d 632IPv6 addresses can be specified by enclosing addresses in square brackets or
633by using an alternative syntax:
8b32eddc 634.Oo Ar bind_address Ns / Oc Ns Ar port
635and
636.Ar host Ns / Ns Ar hostport .
dfddba3d 637Multiple forwardings may be specified, and additional forwardings can be
638given on the command line.
884dc78b 639Only the superuser can forward privileged ports.
dfddba3d 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.
884dc78b 654.It Cm LogLevel
655Gives the verbosity level that is used when logging messages from
30460aeb 656.Xr ssh 1 .
884dc78b 657The possible values are:
30460aeb 658QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
bfe49944 659The default is INFO.
660DEBUG and DEBUG1 are equivalent.
661DEBUG2 and DEBUG3 each specify higher levels of verbose output.
884dc78b 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.
30460aeb 668The default is:
884dc78b 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.
30460aeb 683The default is 3.
884dc78b 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 .
08822d99 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 .
884dc78b 705.It Cm Port
706Specifies the port number to connect on the remote host.
30460aeb 707The default is 22.
884dc78b 708.It Cm PreferredAuthentications
709Specifies the order in which the client should try protocol 2
7cac2b65 710authentication methods.
8b32eddc 711This allows a client to prefer one method (e.g.\&
884dc78b 712.Cm keyboard-interactive )
8b32eddc 713over another method (e.g.\&
884dc78b 714.Cm password )
715The default for this option is:
30460aeb 716.Do gssapi-keyex ,
717external-keyx,
718gssapi-with-mic,
719hostbased,
720publickey,
721keyboard-interactive,
722password
723.Dc .
884dc78b 724.It Cm Protocol
725Specifies the protocol versions
30460aeb 726.Xr ssh 1
884dc78b 727should support in order of preference.
728The possible values are
30460aeb 729.Sq 1
884dc78b 730and
30460aeb 731.Sq 2 .
884dc78b 732Multiple versions must be comma-separated.
733The default is
734.Dq 2,1 .
30460aeb 735This means that ssh
884dc78b 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).
bfe49944 759Setting the command to
760.Dq none
761disables this option entirely.
884dc78b 762Note that
763.Cm CheckHostIP
764is not available for connects with a proxy command.
765.Pp
2ce0bfe4 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
884dc78b 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.
08822d99 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
30460aeb 793.Sq 1G
08822d99 794and
30460aeb 795.Sq 4G ,
08822d99 796depending on the cipher.
797This option applies to protocol version 2 only.
884dc78b 798.It Cm RemoteForward
08822d99 799Specifies that a TCP port on the remote machine be forwarded over
884dc78b 800the secure channel to the specified host and port from the local machine.
8b32eddc 801The first argument must be
dfddba3d 802.Sm off
8b32eddc 803.Oo Ar bind_address : Oc Ar port
dfddba3d 804.Sm on
8b32eddc 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 .
884dc78b 812Multiple forwardings may be specified, and additional
813forwardings can be given on the command line.
814Only the superuser can forward privileged ports.
dfddba3d 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 ) .
884dc78b 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
30460aeb 841.Xr ssh 1
884dc78b 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.
7e82606e 855.It Cm SendEnv
856Specifies what variables from the local
857.Xr environ 7
858should be sent to the server.
30460aeb 859Note that environment passing is only supported for protocol 2.
860The server must also support it, and the server must be configured to
7e82606e 861accept these environment variables.
862Refer to
863.Cm AcceptEnv
864in
865.Xr sshd_config 5
866for how to configure the server.
30460aeb 867Variables are specified by name, which may contain wildcard characters.
7e82606e 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.
30460aeb 873.Pp
874See
875.Sx PATTERNS
876for more information on patterns.
540d72c3 877.It Cm ServerAliveCountMax
08822d99 878Sets the number of server alive messages (see below) which may be
540d72c3 879sent without
30460aeb 880.Xr ssh 1
540d72c3 881receiving any messages back from the server.
882If this threshold is reached while server alive messages are being sent,
30460aeb 883ssh will disconnect from the server, terminating the session.
540d72c3 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
30460aeb 899(see below) is set to 15 and
540d72c3 900.Cm ServerAliveCountMax
30460aeb 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.
08822d99 904.It Cm ServerAliveInterval
905Sets a timeout interval in seconds after which if no data has been received
906from the server,
30460aeb 907.Xr ssh 1
08822d99 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.
884dc78b 913.It Cm SmartcardDevice
7cac2b65 914Specifies which smartcard device to use.
915The argument to this keyword is the device
30460aeb 916.Xr ssh 1
884dc78b 917should use to communicate with a smartcard used for storing the user's
7cac2b65 918private RSA key.
919By default, no device is specified and smartcard support is not activated.
884dc78b 920.It Cm StrictHostKeyChecking
921If this flag is set to
922.Dq yes ,
30460aeb 923.Xr ssh 1
884dc78b 924will never automatically add host keys to the
2ce0bfe4 925.Pa ~/.ssh/known_hosts
884dc78b 926file, and refuses to connect to hosts whose host key has changed.
927This provides maximum protection against trojan horse attacks,
30460aeb 928though it can be annoying when the
884dc78b 929.Pa /etc/ssh/ssh_known_hosts
30460aeb 930file is poorly maintained or when connections to new hosts are
884dc78b 931frequently made.
932This option forces the user to manually
933add all new hosts.
934If this flag is set to
935.Dq no ,
30460aeb 936ssh will automatically add new host keys to the
884dc78b 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
30460aeb 943ssh will refuse to connect to hosts whose host key has changed.
884dc78b 944The host keys of
945known hosts will be verified automatically in all cases.
946The argument must be
947.Dq yes ,
30460aeb 948.Dq no ,
884dc78b 949or
950.Dq ask .
951The default is
952.Dq ask .
540d72c3 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 .
08822d99 970.It Cm Tunnel
30460aeb 971Request
08822d99 972.Xr tun 4
973device forwarding between the client and the server.
08822d99 974The argument must be
975.Dq yes ,
30460aeb 976.Dq point-to-point
977(layer 3),
08822d99 978.Dq ethernet
30460aeb 979(layer 2),
08822d99 980or
981.Dq no .
30460aeb 982Specifying
983.Dq yes
984requests the default tunnel mode, which is
985.Dq point-to-point .
08822d99 986The default is
987.Dq no .
988.It Cm TunnelDevice
30460aeb 989Specifies the
08822d99 990.Xr tun 4
30460aeb 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 .
884dc78b 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 .
d03f4262 1017If set to
30460aeb 1018.Dq yes ,
1019.Xr ssh 1
d03f4262 1020must be setuid root.
884dc78b 1021Note that this option must be set to
1022.Dq yes
7cac2b65 1023for
884dc78b 1024.Cm RhostsRSAAuthentication
7cac2b65 1025with older servers.
884dc78b 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
2ce0bfe4 1034.Pa ~/.ssh/known_hosts .
7cac2b65 1035.It Cm VerifyHostKeyDNS
1036Specifies whether to verify the remote key using DNS and SSHFP resource
1037records.
540d72c3 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 ,
30460aeb 1052.Dq no ,
540d72c3 1053or
1054.Dq ask .
7cac2b65 1055The default is
1056.Dq no .
1057Note that this option applies to protocol version 2 only.
30460aeb 1058.Pp
1059See also
1060.Sx VERIFYING HOST KEYS
1061in
1062.Xr ssh 1 .
884dc78b 1063.It Cm XAuthLocation
d03f4262 1064Specifies the full pathname of the
884dc78b 1065.Xr xauth 1
1066program.
1067The default is
1068.Pa /usr/X11R6/bin/xauth .
1069.El
30460aeb 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\&"
884dc78b 1105.Sh FILES
1106.Bl -tag -width Ds
2ce0bfe4 1107.It Pa ~/.ssh/config
884dc78b 1108This is the per-user configuration file.
1109The format of this file is described above.
30460aeb 1110This file is used by the SSH client.
7e82606e 1111Because of the potential for abuse, this file must have strict permissions:
1112read/write for the user, and not accessible by others.
884dc78b 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
7cac2b65 1120.Sh SEE ALSO
1121.Xr ssh 1
884dc78b 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 5.566373 seconds and 5 git commands to generate.