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