]> andersk Git - gssapi-openssh.git/blame - openssh/ssh_config.5
add gsisftp symlinks on make install
[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.\"
7cac2b65 37.\" $OpenBSD: ssh_config.5,v 1.20 2003/09/02 18:50:06 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
46.It Pa $HOME/.ssh/config
47.It Pa /etc/ssh/ssh_config
48.El
49.Sh DESCRIPTION
50.Nm ssh
51obtains configuration data from the following sources in
52the following order:
d03f4262 53.Bl -enum -offset indent -compact
54.It
55command-line options
56.It
44a053a3 57user's configuration file
d03f4262 58.Pq Pa $HOME/.ssh/config
59.It
d6862c36 60GSSAPI configuration file
d03f4262 61.Pq Pa $HOME/.ssh/config.gssapi
62.It
d6862c36 63Kerberos configuration file
d03f4262 64.Pq Pa $HOME/.ssh/config.krb
65.It
d03f4262 66system-wide configuration file
67.Pq Pa /etc/ssh/ssh_config
44a053a3 68.El
884dc78b 69.Pp
70For each parameter, the first obtained value
71will be used.
72The configuration files contain sections bracketed by
73.Dq Host
74specifications, and that section is only applied for hosts that
75match one of the patterns given in the specification.
76The matched host name is the one given on the command line.
77.Pp
78Since the first obtained value for each parameter is used, more
79host-specific declarations should be given near the beginning of the
80file, and general defaults at the end.
81.Pp
82The configuration file has the following format:
83.Pp
84Empty lines and lines starting with
85.Ql #
86are comments.
87.Pp
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 ,
96.Nm scp
97and
98.Nm sftp
99.Fl o
100option.
101.Pp
102The possible
103keywords and their meanings are as follows (note that
104keywords are case-insensitive and arguments are case-sensitive):
105.Bl -tag -width Ds
106.It Cm Host
107Restricts the following declarations (up to the next
108.Cm Host
109keyword) to be only for those hosts that match one of the patterns
110given after the keyword.
111.Ql \&*
112and
7cac2b65 113.Ql \&?
884dc78b 114can be used as wildcards in the
115patterns.
116A single
117.Ql \&*
118as a pattern can be used to provide global
119defaults for all hosts.
120The host is the
121.Ar hostname
122argument given on the command line (i.e., the name is not converted to
123a canonicalized host name before matching).
7cac2b65 124.It Cm AddressFamily
125Specifies which address family to use when connecting.
126Valid arguments are
127.Dq any ,
128.Dq inet
129(Use IPv4 only) or
130.Dq inet6
131(Use IPv6 only.)
884dc78b 132.It Cm BatchMode
133If set to
134.Dq yes ,
135passphrase/password querying will be disabled.
136This option is useful in scripts and other batch jobs where no user
137is present to supply the password.
138The argument must be
139.Dq yes
140or
141.Dq no .
142The default is
143.Dq no .
144.It Cm BindAddress
145Specify the interface to transmit from on machines with multiple
146interfaces or aliased addresses.
147Note that this option does not work if
148.Cm UsePrivilegedPort
149is set to
150.Dq yes .
151.It Cm ChallengeResponseAuthentication
152Specifies whether to use challenge response authentication.
153The argument to this keyword must be
154.Dq yes
155or
156.Dq no .
157The default is
158.Dq yes .
159.It Cm CheckHostIP
160If this flag is set to
161.Dq yes ,
162ssh will additionally check the host IP address in the
163.Pa known_hosts
164file.
165This allows ssh to detect if a host key changed due to DNS spoofing.
166If the option is set to
167.Dq no ,
168the check will not be executed.
169The default is
170.Dq yes .
171.It Cm Cipher
172Specifies the cipher to use for encrypting the session
173in protocol version 1.
174Currently,
175.Dq blowfish ,
176.Dq 3des ,
177and
178.Dq des
179are supported.
180.Ar des
181is only supported in the
182.Nm ssh
183client for interoperability with legacy protocol 1 implementations
184that do not support the
185.Ar 3des
bfe49944 186cipher.
187Its use is strongly discouraged due to cryptographic weaknesses.
884dc78b 188The default is
189.Dq 3des .
190.It Cm Ciphers
191Specifies the ciphers allowed for protocol version 2
192in order of preference.
193Multiple ciphers must be comma-separated.
194The default is
195.Pp
196.Bd -literal
197 ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,
198 aes192-cbc,aes256-cbc''
199.Ed
200.It Cm ClearAllForwardings
201Specifies that all local, remote and dynamic port forwardings
202specified in the configuration files or on the command line be
bfe49944 203cleared.
204This option is primarily useful when used from the
884dc78b 205.Nm ssh
206command line to clear port forwardings set in
207configuration files, and is automatically set by
208.Xr scp 1
209and
210.Xr sftp 1 .
211The argument must be
212.Dq yes
213or
214.Dq no .
215The default is
216.Dq no .
217.It Cm Compression
218Specifies whether to use compression.
219The argument must be
220.Dq yes
221or
222.Dq no .
223The default is
224.Dq no .
225.It Cm CompressionLevel
226Specifies the compression level to use if compression is enabled.
227The argument must be an integer from 1 (fast) to 9 (slow, best).
228The default level is 6, which is good for most applications.
229The meaning of the values is the same as in
230.Xr gzip 1 .
231Note that this option applies to protocol version 1 only.
232.It Cm ConnectionAttempts
233Specifies the number of tries (one per second) to make before exiting.
234The argument must be an integer.
235This may be useful in scripts if the connection sometimes fails.
236The default is 1.
7cac2b65 237.It Cm ConnectTimeout
238Specifies the timeout (in seconds) used when connecting to the ssh
239server, instead of using the default system TCP timeout.
240This value is used only when the target is down or really unreachable,
241not when it refuses the connection.
884dc78b 242.It Cm DynamicForward
243Specifies that a TCP/IP port on the local machine be forwarded
244over the secure channel, and the application
245protocol is then used to determine where to connect to from the
bfe49944 246remote machine.
247The argument must be a port number.
7cac2b65 248Currently the SOCKS4 and SOCKS5 protocols are supported, and
884dc78b 249.Nm ssh
7cac2b65 250will act as a SOCKS server.
884dc78b 251Multiple forwardings may be specified, and
bfe49944 252additional forwardings can be given on the command line.
253Only the superuser can forward privileged ports.
7cac2b65 254.It Cm EnableSSHKeysign
255Setting this option to
256.Dq yes
257in the global client configuration file
258.Pa /etc/ssh/ssh_config
259enables the use of the helper program
260.Xr ssh-keysign 8
261during
262.Cm HostbasedAuthentication .
263The argument must be
264.Dq yes
265or
266.Dq no .
267The default is
268.Dq no .
269See
270.Xr ssh-keysign 8
271for more information.
884dc78b 272.It Cm EscapeChar
273Sets the escape character (default:
274.Ql ~ ) .
275The escape character can also
276be set on the command line.
277The argument should be a single character,
278.Ql ^
279followed by a letter, or
280.Dq none
281to disable the escape
282character entirely (making the connection transparent for binary
283data).
284.It Cm ForwardAgent
285Specifies whether the connection to the authentication agent (if any)
286will be forwarded to the remote machine.
287The argument must be
288.Dq yes
289or
290.Dq no .
291The default is
292.Dq no .
d03f4262 293.Pp
bfe49944 294Agent forwarding should be enabled with caution.
295Users with the ability to bypass file permissions on the remote host
296(for the agent's Unix-domain socket)
297can access the local agent through the forwarded connection.
298An attacker cannot obtain key material from the agent,
d03f4262 299however they can perform operations on the keys that enable them to
300authenticate using the identities loaded into the agent.
884dc78b 301.It Cm ForwardX11
302Specifies whether X11 connections will be automatically redirected
303over the secure channel and
304.Ev DISPLAY
305set.
306The argument must be
307.Dq yes
308or
309.Dq no .
310The default is
311.Dq no .
d03f4262 312.Pp
bfe49944 313X11 forwarding should be enabled with caution.
314Users with the ability to bypass file permissions on the remote host
315(for the user's X authorization database)
316can access the local X11 display through the forwarded connection.
317An attacker may then be able to perform activities such as keystroke monitoring.
884dc78b 318.It Cm GatewayPorts
319Specifies whether remote hosts are allowed to connect to local
320forwarded ports.
321By default,
322.Nm ssh
bfe49944 323binds local port forwardings to the loopback address.
324This prevents other remote hosts from connecting to forwarded ports.
884dc78b 325.Cm GatewayPorts
326can be used to specify that
327.Nm ssh
328should bind local port forwardings to the wildcard address,
329thus allowing remote hosts to connect to forwarded ports.
330The argument must be
331.Dq yes
332or
333.Dq no .
334The default is
335.Dq no .
336.It Cm GlobalKnownHostsFile
337Specifies a file to use for the global
338host key database instead of
339.Pa /etc/ssh/ssh_known_hosts .
7cac2b65 340.It Cm GSSAPIAuthentication
44a053a3 341Specifies whether authentication based on GSSAPI may be used, either using
342the result of a successful key exchange, or using GSSAPI user
343authentication.
344The default is
345.Dq yes .
7cac2b65 346.It Cm GSSAPIKeyExchange
7a056ed1 347Specifies whether key exchange based on GSSAPI may be used. When using
348GSSAPI key exchange the server need not have a host key.
349The default is
350.Dq yes .
7cac2b65 351.It Cm GSSAPIDelegateCredentials
44a053a3 352Specifies whether GSSAPI credentials will be delegated (forwarded) to
353the server.
354The default is
355.Dq yes .
884dc78b 356.It Cm HostbasedAuthentication
357Specifies whether to try rhosts based authentication with public key
358authentication.
359The argument must be
360.Dq yes
361or
362.Dq no .
363The default is
364.Dq no .
365This option applies to protocol version 2 only and
366is similar to
367.Cm RhostsRSAAuthentication .
368.It Cm HostKeyAlgorithms
369Specifies the protocol version 2 host key algorithms
370that the client wants to use in order of preference.
371The default for this option is:
372.Dq ssh-rsa,ssh-dss .
373.It Cm HostKeyAlias
374Specifies an alias that should be used instead of the
375real host name when looking up or saving the host key
376in the host key database files.
377This option is useful for tunneling ssh connections
378or for multiple servers running on a single host.
379.It Cm HostName
380Specifies the real host name to log into.
381This can be used to specify nicknames or abbreviations for hosts.
382Default is the name given on the command line.
383Numeric IP addresses are also permitted (both on the command line and in
384.Cm HostName
385specifications).
386.It Cm IdentityFile
387Specifies a file from which the user's RSA or DSA authentication identity
7cac2b65 388is read.
389The default is
884dc78b 390.Pa $HOME/.ssh/identity
391for protocol version 1, and
392.Pa $HOME/.ssh/id_rsa
393and
394.Pa $HOME/.ssh/id_dsa
395for protocol version 2.
396Additionally, any identities represented by the authentication agent
397will be used for authentication.
398The file name may use the tilde
399syntax to refer to a user's home directory.
400It is possible to have
401multiple identity files specified in configuration files; all these
402identities will be tried in sequence.
403.It Cm KeepAlive
404Specifies whether the system should send TCP keepalive messages to the
405other side.
406If they are sent, death of the connection or crash of one
407of the machines will be properly noticed.
408However, this means that
409connections will die if the route is down temporarily, and some people
410find it annoying.
411.Pp
412The default is
413.Dq yes
414(to send keepalives), and the client will notice
415if the network goes down or the remote host dies.
416This is important in scripts, and many users want it too.
417.Pp
418To disable keepalives, the value should be set to
419.Dq no .
884dc78b 420.It Cm LocalForward
421Specifies that a TCP/IP port on the local machine be forwarded over
422the secure channel to the specified host and port from the remote machine.
423The first argument must be a port number, and the second must be
424.Ar host:port .
425IPv6 addresses can be specified with an alternative syntax:
426.Ar host/port .
427Multiple forwardings may be specified, and additional
428forwardings can be given on the command line.
429Only the superuser can forward privileged ports.
430.It Cm LogLevel
431Gives the verbosity level that is used when logging messages from
432.Nm ssh .
433The possible values are:
434QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2 and DEBUG3.
bfe49944 435The default is INFO.
436DEBUG and DEBUG1 are equivalent.
437DEBUG2 and DEBUG3 each specify higher levels of verbose output.
884dc78b 438.It Cm MACs
439Specifies the MAC (message authentication code) algorithms
440in order of preference.
441The MAC algorithm is used in protocol version 2
442for data integrity protection.
443Multiple algorithms must be comma-separated.
444The default is
445.Dq hmac-md5,hmac-sha1,hmac-ripemd160,hmac-sha1-96,hmac-md5-96 .
446.It Cm NoHostAuthenticationForLocalhost
447This option can be used if the home directory is shared across machines.
448In this case localhost will refer to a different machine on each of
449the machines and the user will get many warnings about changed host keys.
450However, this option disables host authentication for localhost.
451The argument to this keyword must be
452.Dq yes
453or
454.Dq no .
455The default is to check the host key for localhost.
456.It Cm NumberOfPasswordPrompts
457Specifies the number of password prompts before giving up.
458The argument to this keyword must be an integer.
459Default is 3.
460.It Cm PasswordAuthentication
461Specifies whether to use password authentication.
462The argument to this keyword must be
463.Dq yes
464or
465.Dq no .
466The default is
467.Dq yes .
468.It Cm Port
469Specifies the port number to connect on the remote host.
470Default is 22.
471.It Cm PreferredAuthentications
472Specifies the order in which the client should try protocol 2
7cac2b65 473authentication methods.
474This allows a client to prefer one method (e.g.
884dc78b 475.Cm keyboard-interactive )
476over another method (e.g.
477.Cm password )
478The default for this option is:
44a053a3 479.Dq hostbased,external-keyx,gssapi,publickey,keyboard-interactive,password .
884dc78b 480.It Cm Protocol
481Specifies the protocol versions
482.Nm ssh
483should support in order of preference.
484The possible values are
485.Dq 1
486and
487.Dq 2 .
488Multiple versions must be comma-separated.
489The default is
490.Dq 2,1 .
491This means that
492.Nm ssh
493tries version 2 and falls back to version 1
494if version 2 is not available.
495.It Cm ProxyCommand
496Specifies the command to use to connect to the server.
497The command
498string extends to the end of the line, and is executed with
499.Pa /bin/sh .
500In the command string,
501.Ql %h
502will be substituted by the host name to
503connect and
504.Ql %p
505by the port.
506The command can be basically anything,
507and should read from its standard input and write to its standard output.
508It should eventually connect an
509.Xr sshd 8
510server running on some machine, or execute
511.Ic sshd -i
512somewhere.
513Host key management will be done using the
514HostName of the host being connected (defaulting to the name typed by
515the user).
bfe49944 516Setting the command to
517.Dq none
518disables this option entirely.
884dc78b 519Note that
520.Cm CheckHostIP
521is not available for connects with a proxy command.
522.Pp
523.It Cm PubkeyAuthentication
524Specifies whether to try public key authentication.
525The argument to this keyword must be
526.Dq yes
527or
528.Dq no .
529The default is
530.Dq yes .
531This option applies to protocol version 2 only.
532.It Cm RemoteForward
533Specifies that a TCP/IP port on the remote machine be forwarded over
534the secure channel to the specified host and port from the local machine.
535The first argument must be a port number, and the second must be
536.Ar host:port .
537IPv6 addresses can be specified with an alternative syntax:
538.Ar host/port .
539Multiple forwardings may be specified, and additional
540forwardings can be given on the command line.
541Only the superuser can forward privileged ports.
884dc78b 542.It Cm RhostsRSAAuthentication
543Specifies whether to try rhosts based authentication with RSA host
544authentication.
545The argument must be
546.Dq yes
547or
548.Dq no .
549The default is
550.Dq no .
551This option applies to protocol version 1 only and requires
552.Nm ssh
553to be setuid root.
554.It Cm RSAAuthentication
555Specifies whether to try RSA authentication.
556The argument to this keyword must be
557.Dq yes
558or
559.Dq no .
560RSA authentication will only be
561attempted if the identity file exists, or an authentication agent is
562running.
563The default is
564.Dq yes .
565Note that this option applies to protocol version 1 only.
566.It Cm SmartcardDevice
7cac2b65 567Specifies which smartcard device to use.
568The argument to this keyword is the device
884dc78b 569.Nm ssh
570should use to communicate with a smartcard used for storing the user's
7cac2b65 571private RSA key.
572By default, no device is specified and smartcard support is not activated.
884dc78b 573.It Cm StrictHostKeyChecking
574If this flag is set to
575.Dq yes ,
576.Nm ssh
577will never automatically add host keys to the
578.Pa $HOME/.ssh/known_hosts
579file, and refuses to connect to hosts whose host key has changed.
580This provides maximum protection against trojan horse attacks,
581however, can be annoying when the
582.Pa /etc/ssh/ssh_known_hosts
583file is poorly maintained, or connections to new hosts are
584frequently made.
585This option forces the user to manually
586add all new hosts.
587If this flag is set to
588.Dq no ,
589.Nm ssh
590will automatically add new host keys to the
591user known hosts files.
592If this flag is set to
593.Dq ask ,
594new host keys
595will be added to the user known host files only after the user
596has confirmed that is what they really want to do, and
597.Nm ssh
598will refuse to connect to hosts whose host key has changed.
599The host keys of
600known hosts will be verified automatically in all cases.
601The argument must be
602.Dq yes ,
603.Dq no
604or
605.Dq ask .
606The default is
607.Dq ask .
608.It Cm UsePrivilegedPort
609Specifies whether to use a privileged port for outgoing connections.
610The argument must be
611.Dq yes
612or
613.Dq no .
614The default is
615.Dq no .
d03f4262 616If set to
617.Dq yes
618.Nm ssh
619must be setuid root.
884dc78b 620Note that this option must be set to
621.Dq yes
7cac2b65 622for
884dc78b 623.Cm RhostsRSAAuthentication
7cac2b65 624with older servers.
884dc78b 625.It Cm User
626Specifies the user to log in as.
627This can be useful when a different user name is used on different machines.
628This saves the trouble of
629having to remember to give the user name on the command line.
630.It Cm UserKnownHostsFile
631Specifies a file to use for the user
632host key database instead of
633.Pa $HOME/.ssh/known_hosts .
7cac2b65 634.It Cm VerifyHostKeyDNS
635Specifies whether to verify the remote key using DNS and SSHFP resource
636records.
637The default is
638.Dq no .
639Note that this option applies to protocol version 2 only.
884dc78b 640.It Cm XAuthLocation
d03f4262 641Specifies the full pathname of the
884dc78b 642.Xr xauth 1
643program.
644The default is
645.Pa /usr/X11R6/bin/xauth .
646.El
647.Sh FILES
648.Bl -tag -width Ds
649.It Pa $HOME/.ssh/config
650This is the per-user configuration file.
651The format of this file is described above.
652This file is used by the
653.Nm ssh
654client.
655This file does not usually contain any sensitive information,
656but the recommended permissions are read/write for the user, and not
657accessible by others.
658.It Pa /etc/ssh/ssh_config
659Systemwide configuration file.
660This file provides defaults for those
661values that are not specified in the user's configuration file, and
662for those users who do not have a configuration file.
663This file must be world-readable.
664.El
7cac2b65 665.Sh SEE ALSO
666.Xr ssh 1
884dc78b 667.Sh AUTHORS
668OpenSSH is a derivative of the original and free
669ssh 1.2.12 release by Tatu Ylonen.
670Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
671Theo de Raadt and Dug Song
672removed many bugs, re-added newer features and
673created OpenSSH.
674Markus Friedl contributed the support for SSH
675protocol versions 1.5 and 2.0.
This page took 0.224289 seconds and 5 git commands to generate.