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