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