]> andersk Git - openssh.git/blame - ssh_config.5
- djm@cvs.openbsd.org 2003/05/16 03:27:12
[openssh.git] / ssh_config.5
CommitLineData
588df31a 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.\"
f811e52a 37.\" $OpenBSD: ssh_config.5,v 1.10 2003/05/16 03:27:12 djm Exp $
588df31a 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:
4dcbbeea 53.Bl -enum -offset indent -compact
54.It
55command-line options
56.It
57user's configuration file
58.Pq Pa $HOME/.ssh/config
59.It
60system-wide configuration file
61.Pq Pa /etc/ssh/ssh_config
62.El
588df31a 63.Pp
64For each parameter, the first obtained value
65will be used.
66The configuration files contain sections bracketed by
67.Dq Host
68specifications, and that section is only applied for hosts that
69match one of the patterns given in the specification.
70The matched host name is the one given on the command line.
71.Pp
72Since the first obtained value for each parameter is used, more
73host-specific declarations should be given near the beginning of the
74file, and general defaults at the end.
75.Pp
76The configuration file has the following format:
77.Pp
78Empty lines and lines starting with
79.Ql #
80are comments.
81.Pp
82Otherwise a line is of the format
83.Dq keyword arguments .
84Configuration options may be separated by whitespace or
85optional whitespace and exactly one
86.Ql = ;
87the latter format is useful to avoid the need to quote whitespace
88when specifying configuration options using the
89.Nm ssh ,
90.Nm scp
91and
92.Nm sftp
93.Fl o
94option.
95.Pp
96The possible
97keywords and their meanings are as follows (note that
98keywords are case-insensitive and arguments are case-sensitive):
99.Bl -tag -width Ds
100.It Cm Host
101Restricts the following declarations (up to the next
102.Cm Host
103keyword) to be only for those hosts that match one of the patterns
104given after the keyword.
105.Ql \&*
106and
107.Ql ?
108can be used as wildcards in the
109patterns.
110A single
111.Ql \&*
112as a pattern can be used to provide global
113defaults for all hosts.
114The host is the
115.Ar hostname
116argument given on the command line (i.e., the name is not converted to
117a canonicalized host name before matching).
f811e52a 118.It Cm AddressFamily
119Specifies which address family to use when connecting. Valid arguments are
120.Dq any ,
121.Dq inet
122(Use IPv4 only) or
123.Dq inet6
124(Use IPv6 only.)
588df31a 125.It Cm AFSTokenPassing
126Specifies whether to pass AFS tokens to remote host.
127The argument to this keyword must be
128.Dq yes
129or
130.Dq no .
131This option applies to protocol version 1 only.
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
a4e5acef 186cipher.
187Its use is strongly discouraged due to cryptographic weaknesses.
588df31a 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
a4e5acef 203cleared.
204This option is primarily useful when used from the
588df31a 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.
09ab3296 237.It Cm ConnectTimeout
238Specifies the timeout (in seconds) used when connecting to the ssh
239server, instead of using the default system TCP timeout. This value is
240used only when the target is down or really unreachable, not when it
241refuses the connection.
588df31a 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
a4e5acef 246remote machine.
247The argument must be a port number.
588df31a 248Currently the SOCKS4 protocol is supported, and
249.Nm ssh
250will act as a SOCKS4 server.
251Multiple forwardings may be specified, and
a4e5acef 252additional forwardings can be given on the command line.
253Only the superuser can forward privileged ports.
588df31a 254.It Cm EscapeChar
255Sets the escape character (default:
256.Ql ~ ) .
257The escape character can also
258be set on the command line.
259The argument should be a single character,
260.Ql ^
261followed by a letter, or
262.Dq none
263to disable the escape
264character entirely (making the connection transparent for binary
265data).
266.It Cm ForwardAgent
267Specifies whether the connection to the authentication agent (if any)
268will be forwarded to the remote machine.
269The argument must be
270.Dq yes
271or
272.Dq no .
273The default is
274.Dq no .
dbcdea68 275.Pp
a4e5acef 276Agent forwarding should be enabled with caution.
277Users with the ability to bypass file permissions on the remote host
278(for the agent's Unix-domain socket)
279can access the local agent through the forwarded connection.
280An attacker cannot obtain key material from the agent,
dbcdea68 281however they can perform operations on the keys that enable them to
282authenticate using the identities loaded into the agent.
588df31a 283.It Cm ForwardX11
284Specifies whether X11 connections will be automatically redirected
285over the secure channel and
286.Ev DISPLAY
287set.
288The argument must be
289.Dq yes
290or
291.Dq no .
292The default is
293.Dq no .
dbcdea68 294.Pp
a4e5acef 295X11 forwarding should be enabled with caution.
296Users with the ability to bypass file permissions on the remote host
297(for the user's X authorization database)
298can access the local X11 display through the forwarded connection.
299An attacker may then be able to perform activities such as keystroke monitoring.
588df31a 300.It Cm GatewayPorts
301Specifies whether remote hosts are allowed to connect to local
302forwarded ports.
303By default,
304.Nm ssh
a4e5acef 305binds local port forwardings to the loopback address.
306This prevents other remote hosts from connecting to forwarded ports.
588df31a 307.Cm GatewayPorts
308can be used to specify that
309.Nm ssh
310should bind local port forwardings to the wildcard address,
311thus allowing remote hosts to connect to forwarded ports.
312The argument must be
313.Dq yes
314or
315.Dq no .
316The default is
317.Dq no .
318.It Cm GlobalKnownHostsFile
319Specifies a file to use for the global
320host key database instead of
321.Pa /etc/ssh/ssh_known_hosts .
322.It Cm HostbasedAuthentication
323Specifies whether to try rhosts based authentication with public key
324authentication.
325The argument must be
326.Dq yes
327or
328.Dq no .
329The default is
330.Dq no .
331This option applies to protocol version 2 only and
332is similar to
333.Cm RhostsRSAAuthentication .
334.It Cm HostKeyAlgorithms
335Specifies the protocol version 2 host key algorithms
336that the client wants to use in order of preference.
337The default for this option is:
338.Dq ssh-rsa,ssh-dss .
339.It Cm HostKeyAlias
340Specifies an alias that should be used instead of the
341real host name when looking up or saving the host key
342in the host key database files.
343This option is useful for tunneling ssh connections
344or for multiple servers running on a single host.
345.It Cm HostName
346Specifies the real host name to log into.
347This can be used to specify nicknames or abbreviations for hosts.
348Default is the name given on the command line.
349Numeric IP addresses are also permitted (both on the command line and in
350.Cm HostName
351specifications).
352.It Cm IdentityFile
353Specifies a file from which the user's RSA or DSA authentication identity
354is read. The default is
355.Pa $HOME/.ssh/identity
356for protocol version 1, and
357.Pa $HOME/.ssh/id_rsa
358and
359.Pa $HOME/.ssh/id_dsa
360for protocol version 2.
361Additionally, any identities represented by the authentication agent
362will be used for authentication.
363The file name may use the tilde
364syntax to refer to a user's home directory.
365It is possible to have
366multiple identity files specified in configuration files; all these
367identities will be tried in sequence.
368.It Cm KeepAlive
369Specifies whether the system should send TCP keepalive messages to the
370other side.
371If they are sent, death of the connection or crash of one
372of the machines will be properly noticed.
373However, this means that
374connections will die if the route is down temporarily, and some people
375find it annoying.
376.Pp
377The default is
378.Dq yes
379(to send keepalives), and the client will notice
380if the network goes down or the remote host dies.
381This is important in scripts, and many users want it too.
382.Pp
383To disable keepalives, the value should be set to
384.Dq no .
385.It Cm KerberosAuthentication
386Specifies whether Kerberos authentication will be used.
387The argument to this keyword must be
388.Dq yes
389or
390.Dq no .
391.It Cm KerberosTgtPassing
392Specifies whether a Kerberos TGT will be forwarded to the server.
393This will only work if the Kerberos server is actually an AFS kaserver.
394The argument to this keyword must be
395.Dq yes
396or
397.Dq no .
398.It Cm LocalForward
399Specifies that a TCP/IP port on the local machine be forwarded over
400the secure channel to the specified host and port from the remote machine.
401The first argument must be a port number, and the second must be
402.Ar host:port .
403IPv6 addresses can be specified with an alternative syntax:
404.Ar host/port .
405Multiple forwardings may be specified, and additional
406forwardings can be given on the command line.
407Only the superuser can forward privileged ports.
408.It Cm LogLevel
409Gives the verbosity level that is used when logging messages from
410.Nm ssh .
411The possible values are:
412QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2 and DEBUG3.
a4e5acef 413The default is INFO.
414DEBUG and DEBUG1 are equivalent.
415DEBUG2 and DEBUG3 each specify higher levels of verbose output.
588df31a 416.It Cm MACs
417Specifies the MAC (message authentication code) algorithms
418in order of preference.
419The MAC algorithm is used in protocol version 2
420for data integrity protection.
421Multiple algorithms must be comma-separated.
422The default is
423.Dq hmac-md5,hmac-sha1,hmac-ripemd160,hmac-sha1-96,hmac-md5-96 .
424.It Cm NoHostAuthenticationForLocalhost
425This option can be used if the home directory is shared across machines.
426In this case localhost will refer to a different machine on each of
427the machines and the user will get many warnings about changed host keys.
428However, this option disables host authentication for localhost.
429The argument to this keyword must be
430.Dq yes
431or
432.Dq no .
433The default is to check the host key for localhost.
434.It Cm NumberOfPasswordPrompts
435Specifies the number of password prompts before giving up.
436The argument to this keyword must be an integer.
437Default is 3.
438.It Cm PasswordAuthentication
439Specifies whether to use password authentication.
440The argument to this keyword must be
441.Dq yes
442or
443.Dq no .
444The default is
445.Dq yes .
446.It Cm Port
447Specifies the port number to connect on the remote host.
448Default is 22.
449.It Cm PreferredAuthentications
450Specifies the order in which the client should try protocol 2
451authentication methods. This allows a client to prefer one method (e.g.
452.Cm keyboard-interactive )
453over another method (e.g.
454.Cm password )
455The default for this option is:
456.Dq hostbased,publickey,keyboard-interactive,password .
457.It Cm Protocol
458Specifies the protocol versions
459.Nm ssh
460should support in order of preference.
461The possible values are
462.Dq 1
463and
464.Dq 2 .
465Multiple versions must be comma-separated.
466The default is
467.Dq 2,1 .
468This means that
469.Nm ssh
470tries version 2 and falls back to version 1
471if version 2 is not available.
472.It Cm ProxyCommand
473Specifies the command to use to connect to the server.
474The command
475string extends to the end of the line, and is executed with
476.Pa /bin/sh .
477In the command string,
478.Ql %h
479will be substituted by the host name to
480connect and
481.Ql %p
482by the port.
483The command can be basically anything,
484and should read from its standard input and write to its standard output.
485It should eventually connect an
486.Xr sshd 8
487server running on some machine, or execute
488.Ic sshd -i
489somewhere.
490Host key management will be done using the
491HostName of the host being connected (defaulting to the name typed by
492the user).
a4e5acef 493Setting the command to
494.Dq none
f78bde70 495disables this option entirely.
588df31a 496Note that
497.Cm CheckHostIP
498is not available for connects with a proxy command.
499.Pp
500.It Cm PubkeyAuthentication
501Specifies whether to try public key authentication.
502The argument to this keyword must be
503.Dq yes
504or
505.Dq no .
506The default is
507.Dq yes .
508This option applies to protocol version 2 only.
509.It Cm RemoteForward
510Specifies that a TCP/IP port on the remote machine be forwarded over
511the secure channel to the specified host and port from the local machine.
512The first argument must be a port number, and the second must be
513.Ar host:port .
514IPv6 addresses can be specified with an alternative syntax:
515.Ar host/port .
516Multiple forwardings may be specified, and additional
517forwardings can be given on the command line.
518Only the superuser can forward privileged ports.
519.It Cm RhostsAuthentication
520Specifies whether to try rhosts based authentication.
521Note that this
522declaration only affects the client side and has no effect whatsoever
523on security.
524Most servers do not permit RhostsAuthentication because it
525is not secure (see
526.Cm RhostsRSAAuthentication ) .
527The argument to this keyword must be
528.Dq yes
529or
530.Dq no .
531The default is
532.Dq no .
878b8992 533This option applies to protocol version 1 only and requires
534.Nm ssh
535to be setuid root and
536.Cm UsePrivilegedPort
537to be set to
538.Dq yes .
588df31a 539.It Cm RhostsRSAAuthentication
540Specifies whether to try rhosts based authentication with RSA host
541authentication.
542The argument must be
543.Dq yes
544or
545.Dq no .
546The default is
547.Dq no .
548This option applies to protocol version 1 only and requires
549.Nm ssh
550to be setuid root.
551.It Cm RSAAuthentication
552Specifies whether to try RSA authentication.
553The argument to this keyword must be
554.Dq yes
555or
556.Dq no .
557RSA authentication will only be
558attempted if the identity file exists, or an authentication agent is
559running.
560The default is
561.Dq yes .
562Note that this option applies to protocol version 1 only.
563.It Cm SmartcardDevice
564Specifies which smartcard device to use. The argument to this keyword is
565the device
566.Nm ssh
567should use to communicate with a smartcard used for storing the user's
568private RSA key. By default, no device is specified and smartcard support
569is not activated.
570.It Cm StrictHostKeyChecking
571If this flag is set to
572.Dq yes ,
573.Nm ssh
574will never automatically add host keys to the
575.Pa $HOME/.ssh/known_hosts
576file, and refuses to connect to hosts whose host key has changed.
577This provides maximum protection against trojan horse attacks,
578however, can be annoying when the
579.Pa /etc/ssh/ssh_known_hosts
580file is poorly maintained, or connections to new hosts are
581frequently made.
582This option forces the user to manually
583add all new hosts.
584If this flag is set to
585.Dq no ,
586.Nm ssh
587will automatically add new host keys to the
588user known hosts files.
589If this flag is set to
590.Dq ask ,
591new host keys
592will be added to the user known host files only after the user
593has confirmed that is what they really want to do, and
594.Nm ssh
595will refuse to connect to hosts whose host key has changed.
596The host keys of
597known hosts will be verified automatically in all cases.
598The argument must be
599.Dq yes ,
600.Dq no
601or
602.Dq ask .
603The default is
604.Dq ask .
605.It Cm UsePrivilegedPort
606Specifies whether to use a privileged port for outgoing connections.
607The argument must be
608.Dq yes
609or
610.Dq no .
611The default is
612.Dq no .
878b8992 613If set to
614.Dq yes
615.Nm ssh
616must be setuid root.
588df31a 617Note that this option must be set to
618.Dq yes
619if
620.Cm RhostsAuthentication
621and
622.Cm RhostsRSAAuthentication
623authentications are needed with older servers.
624.It Cm User
625Specifies the user to log in as.
626This can be useful when a different user name is used on different machines.
627This saves the trouble of
628having to remember to give the user name on the command line.
629.It Cm UserKnownHostsFile
630Specifies a file to use for the user
631host key database instead of
632.Pa $HOME/.ssh/known_hosts .
21289cd0 633.It Cm VerifyHostKeyDNS
634Specifies whether to verify the remote key using DNS and SSHFP resource
635records.
636The default is
637.Dq no .
588df31a 638.It Cm XAuthLocation
57ff5eeb 639Specifies the full pathname of the
588df31a 640.Xr xauth 1
641program.
642The default is
643.Pa /usr/X11R6/bin/xauth .
644.El
645.Sh FILES
646.Bl -tag -width Ds
647.It Pa $HOME/.ssh/config
648This is the per-user configuration file.
649The format of this file is described above.
650This file is used by the
651.Nm ssh
652client.
653This file does not usually contain any sensitive information,
654but the recommended permissions are read/write for the user, and not
655accessible by others.
656.It Pa /etc/ssh/ssh_config
657Systemwide configuration file.
658This file provides defaults for those
659values that are not specified in the user's configuration file, and
660for those users who do not have a configuration file.
661This file must be world-readable.
662.El
663.Sh AUTHORS
664OpenSSH is a derivative of the original and free
665ssh 1.2.12 release by Tatu Ylonen.
666Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
667Theo de Raadt and Dug Song
668removed many bugs, re-added newer features and
669created OpenSSH.
670Markus Friedl contributed the support for SSH
671protocol versions 1.5 and 2.0.
672.Sh SEE ALSO
673.Xr ssh 1
This page took 0.171008 seconds and 5 git commands to generate.