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