]> andersk Git - gssapi-openssh.git/blob - openssh/ssh_config.5
2b407817043ffe623458b62fa0ffce8bb45d5f56
[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.97 2006/07/27 08:00:50 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 ~/.ssh/config
47 .It Pa /etc/ssh/ssh_config
48 .El
49 .Sh DESCRIPTION
50 .Xr ssh 1
51 obtains configuration data from the following sources in
52 the following order:
53 .Pp
54 .Bl -enum -offset indent -compact
55 .It
56 command-line options
57 .It
58 user's configuration file
59 .Pq Pa ~/.ssh/config
60 .It
61 GSSAPI configuration file
62 .Pq Pa $HOME/.ssh/config.gssapi
63 .It
64 Kerberos configuration file
65 .Pq Pa $HOME/.ssh/config.krb
66 .It
67 system-wide configuration file
68 .Pq Pa /etc/ssh/ssh_config
69 .El
70 .Pp
71 For each parameter, the first obtained value
72 will be used.
73 The configuration files contain sections separated by
74 .Dq Host
75 specifications, and that section is only applied for hosts that
76 match one of the patterns given in the specification.
77 The matched host name is the one given on the command line.
78 .Pp
79 Since the first obtained value for each parameter is used, more
80 host-specific declarations should be given near the beginning of the
81 file, and general defaults at the end.
82 .Pp
83 The configuration file has the following format:
84 .Pp
85 Empty lines and lines starting with
86 .Ql #
87 are comments.
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 Arguments may optionally be enclosed in double quotes
102 .Pq \&"
103 in order to represent arguments containing spaces.
104 .Pp
105 The possible
106 keywords and their meanings are as follows (note that
107 keywords are case-insensitive and arguments are case-sensitive):
108 .Bl -tag -width Ds
109 .It Cm Host
110 Restricts the following declarations (up to the next
111 .Cm Host
112 keyword) to be only for those hosts that match one of the patterns
113 given after the keyword.
114 A single
115 .Ql *
116 as a pattern can be used to provide global
117 defaults for all hosts.
118 The host is the
119 .Ar hostname
120 argument given on the command line (i.e. the name is not converted to
121 a canonicalized host name before matching).
122 .Pp
123 See
124 .Sx PATTERNS
125 for more information on patterns.
126 .It Cm AddressFamily
127 Specifies which address family to use when connecting.
128 Valid arguments are
129 .Dq any ,
130 .Dq inet
131 (use IPv4 only), or
132 .Dq inet6
133 (use IPv6 only).
134 .It Cm BatchMode
135 If set to
136 .Dq yes ,
137 passphrase/password querying will be disabled.
138 This option is useful in scripts and other batch jobs where no user
139 is present to supply the password.
140 The argument must be
141 .Dq yes
142 or
143 .Dq no .
144 The default is
145 .Dq no .
146 .It Cm BindAddress
147 Use the specified address on the local machine as the source address of
148 the connection.
149 Only useful on systems with more than one address.
150 Note that this option does not work if
151 .Cm UsePrivilegedPort
152 is set to
153 .Dq yes .
154 .It Cm ChallengeResponseAuthentication
155 Specifies whether to use challenge-response authentication.
156 The argument to this keyword must be
157 .Dq yes
158 or
159 .Dq no .
160 The default is
161 .Dq yes .
162 .It Cm CheckHostIP
163 If this flag is set to
164 .Dq yes ,
165 .Xr ssh 1
166 will additionally check the host IP address in the
167 .Pa known_hosts
168 file.
169 This allows ssh to detect if a host key changed due to DNS spoofing.
170 If the option is set to
171 .Dq no ,
172 the check will not be executed.
173 The default is
174 .Dq yes .
175 .It Cm Cipher
176 Specifies the cipher to use for encrypting the session
177 in protocol version 1.
178 Currently,
179 .Dq blowfish ,
180 .Dq 3des ,
181 and
182 .Dq des
183 are supported.
184 .Ar des
185 is only supported in the
186 .Xr ssh 1
187 client for interoperability with legacy protocol 1 implementations
188 that do not support the
189 .Ar 3des
190 cipher.
191 Its use is strongly discouraged due to cryptographic weaknesses.
192 The default is
193 .Dq 3des .
194 .It Cm Ciphers
195 Specifies the ciphers allowed for protocol version 2
196 in order of preference.
197 Multiple ciphers must be comma-separated.
198 The supported ciphers are
199 .Dq 3des-cbc ,
200 .Dq aes128-cbc ,
201 .Dq aes192-cbc ,
202 .Dq aes256-cbc ,
203 .Dq aes128-ctr ,
204 .Dq aes192-ctr ,
205 .Dq aes256-ctr ,
206 .Dq arcfour128 ,
207 .Dq arcfour256 ,
208 .Dq arcfour ,
209 .Dq blowfish-cbc ,
210 and
211 .Dq cast128-cbc .
212 The default is:
213 .Bd -literal -offset 3n
214 aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,
215 arcfour256,arcfour,aes192-cbc,aes256-cbc,aes128-ctr,
216 aes192-ctr,aes256-ctr
217 .Ed
218 .It Cm ClearAllForwardings
219 Specifies that all local, remote, and dynamic port forwardings
220 specified in the configuration files or on the command line be
221 cleared.
222 This option is primarily useful when used from the
223 .Xr ssh 1
224 command line to clear port forwardings set in
225 configuration files, and is automatically set by
226 .Xr scp 1
227 and
228 .Xr sftp 1 .
229 The argument must be
230 .Dq yes
231 or
232 .Dq no .
233 The default is
234 .Dq no .
235 .It Cm Compression
236 Specifies whether to use compression.
237 The argument must be
238 .Dq yes
239 or
240 .Dq no .
241 The default is
242 .Dq no .
243 .It Cm CompressionLevel
244 Specifies the compression level to use if compression is enabled.
245 The argument must be an integer from 1 (fast) to 9 (slow, best).
246 The default level is 6, which is good for most applications.
247 The meaning of the values is the same as in
248 .Xr gzip 1 .
249 Note that this option applies to protocol version 1 only.
250 .It Cm ConnectionAttempts
251 Specifies the number of tries (one per second) to make before exiting.
252 The argument must be an integer.
253 This may be useful in scripts if the connection sometimes fails.
254 The default is 1.
255 .It Cm ConnectTimeout
256 Specifies the timeout (in seconds) used when connecting to the
257 SSH server, instead of using the default system TCP timeout.
258 This value is used only when the target is down or really unreachable,
259 not when it refuses the connection.
260 .It Cm ControlMaster
261 Enables the sharing of multiple sessions over a single network connection.
262 When set to
263 .Dq yes ,
264 .Xr ssh 1
265 will listen for connections on a control socket specified using the
266 .Cm ControlPath
267 argument.
268 Additional sessions can connect to this socket using the same
269 .Cm ControlPath
270 with
271 .Cm ControlMaster
272 set to
273 .Dq no
274 (the default).
275 These sessions will try to reuse the master instance's network connection
276 rather than initiating new ones, but will fall back to connecting normally
277 if the control socket does not exist, or is not listening.
278 .Pp
279 Setting this to
280 .Dq ask
281 will cause ssh
282 to listen for control connections, but require confirmation using the
283 .Ev SSH_ASKPASS
284 program before they are accepted (see
285 .Xr ssh-add 1
286 for details).
287 If the
288 .Cm ControlPath
289 cannot be opened,
290 ssh will continue without connecting to a master instance.
291 .Pp
292 X11 and
293 .Xr ssh-agent 1
294 forwarding is supported over these multiplexed connections, however the
295 display and agent forwarded will be the one belonging to the master
296 connection i.e. it is not possible to forward multiple displays or agents.
297 .Pp
298 Two additional options allow for opportunistic multiplexing: try to use a
299 master connection but fall back to creating a new one if one does not already
300 exist.
301 These options are:
302 .Dq auto
303 and
304 .Dq autoask .
305 The latter requires confirmation like the
306 .Dq ask
307 option.
308 .It Cm ControlPath
309 Specify the path to the control socket used for connection sharing as described
310 in the
311 .Cm ControlMaster
312 section above or the string
313 .Dq none
314 to disable connection sharing.
315 In the path,
316 .Ql %l
317 will be substituted by the local host name,
318 .Ql %h
319 will be substituted by the target host name,
320 .Ql %p
321 the port, and
322 .Ql %r
323 by the remote login username.
324 It is recommended that any
325 .Cm ControlPath
326 used for opportunistic connection sharing include
327 at least %h, %p, and %r.
328 This ensures that shared connections are uniquely identified.
329 .It Cm DynamicForward
330 Specifies that a TCP port on the local machine be forwarded
331 over the secure channel, and the application
332 protocol is then used to determine where to connect to from the
333 remote machine.
334 .Pp
335 The argument must be
336 .Sm off
337 .Oo Ar bind_address : Oc Ar port .
338 .Sm on
339 IPv6 addresses can be specified by enclosing addresses in square brackets or
340 by using an alternative syntax:
341 .Oo Ar bind_address Ns / Oc Ns Ar port .
342 By default, the local port is bound in accordance with the
343 .Cm GatewayPorts
344 setting.
345 However, an explicit
346 .Ar bind_address
347 may be used to bind the connection to a specific address.
348 The
349 .Ar bind_address
350 of
351 .Dq localhost
352 indicates that the listening port be bound for local use only, while an
353 empty address or
354 .Sq *
355 indicates that the port should be available from all interfaces.
356 .Pp
357 Currently the SOCKS4 and SOCKS5 protocols are supported, and
358 .Xr ssh 1
359 will act as a SOCKS server.
360 Multiple forwardings may be specified, and
361 additional forwardings can be given on the command line.
362 Only the superuser can forward privileged ports.
363 .It Cm EnableSSHKeysign
364 Setting this option to
365 .Dq yes
366 in the global client configuration file
367 .Pa /etc/ssh/ssh_config
368 enables the use of the helper program
369 .Xr ssh-keysign 8
370 during
371 .Cm HostbasedAuthentication .
372 The argument must be
373 .Dq yes
374 or
375 .Dq no .
376 The default is
377 .Dq no .
378 This option should be placed in the non-hostspecific section.
379 See
380 .Xr ssh-keysign 8
381 for more information.
382 .It Cm EscapeChar
383 Sets the escape character (default:
384 .Ql ~ ) .
385 The escape character can also
386 be set on the command line.
387 The argument should be a single character,
388 .Ql ^
389 followed by a letter, or
390 .Dq none
391 to disable the escape
392 character entirely (making the connection transparent for binary
393 data).
394 .It Cm ExitOnForwardFailure
395 Specifies whether
396 .Xr ssh 1
397 should terminate the connection if it cannot set up all requested
398 dynamic, local, and remote port forwardings.
399 The argument must be
400 .Dq yes
401 or
402 .Dq no .
403 The default is
404 .Dq no .
405 .It Cm ForwardAgent
406 Specifies whether the connection to the authentication agent (if any)
407 will be forwarded to the remote machine.
408 The argument must be
409 .Dq yes
410 or
411 .Dq no .
412 The default is
413 .Dq no .
414 .Pp
415 Agent forwarding should be enabled with caution.
416 Users with the ability to bypass file permissions on the remote host
417 (for the agent's Unix-domain socket)
418 can access the local agent through the forwarded connection.
419 An attacker cannot obtain key material from the agent,
420 however they can perform operations on the keys that enable them to
421 authenticate using the identities loaded into the agent.
422 .It Cm ForwardX11
423 Specifies whether X11 connections will be automatically redirected
424 over the secure channel and
425 .Ev DISPLAY
426 set.
427 The argument must be
428 .Dq yes
429 or
430 .Dq no .
431 The default is
432 .Dq no .
433 .Pp
434 X11 forwarding should be enabled with caution.
435 Users with the ability to bypass file permissions on the remote host
436 (for the user's X11 authorization database)
437 can access the local X11 display through the forwarded connection.
438 An attacker may then be able to perform activities such as keystroke monitoring
439 if the
440 .Cm ForwardX11Trusted
441 option is also enabled.
442 .It Cm ForwardX11Trusted
443 If this option is set to
444 .Dq yes ,
445 remote X11 clients will have full access to the original X11 display.
446 .Pp
447 If this option is set to
448 .Dq no ,
449 remote X11 clients will be considered untrusted and prevented
450 from stealing or tampering with data belonging to trusted X11
451 clients.
452 Furthermore, the
453 .Xr xauth 1
454 token used for the session will be set to expire after 20 minutes.
455 Remote clients will be refused access after this time.
456 .Pp
457 The default is
458 .Dq no .
459 .Pp
460 See the X11 SECURITY extension specification for full details on
461 the restrictions imposed on untrusted clients.
462 .It Cm GatewayPorts
463 Specifies whether remote hosts are allowed to connect to local
464 forwarded ports.
465 By default,
466 .Xr ssh 1
467 binds local port forwardings to the loopback address.
468 This prevents other remote hosts from connecting to forwarded ports.
469 .Cm GatewayPorts
470 can be used to specify that ssh
471 should bind local port forwardings to the wildcard address,
472 thus allowing remote hosts to connect to forwarded ports.
473 The argument must be
474 .Dq yes
475 or
476 .Dq no .
477 The default is
478 .Dq no .
479 .It Cm GlobalKnownHostsFile
480 Specifies a file to use for the global
481 host key database instead of
482 .Pa /etc/ssh/ssh_known_hosts .
483 .It Cm GSSAPIAuthentication
484 Specifies whether user authentication based on GSSAPI is allowed.
485 The default is
486 .Dq yes .
487 Note that this option applies to protocol version 2 only.
488 .It Cm GSSAPIKeyExchange
489 Specifies whether key exchange based on GSSAPI may be used. When using
490 GSSAPI key exchange the server need not have a host key.
491 The default is
492 .Dq yes .
493 Note that this option applies to protocol version 2 only.
494 .It Cm GSSAPIDelegateCredentials
495 Forward (delegate) credentials to the server.
496 The default is
497 .Dq yes .
498 Note that this option applies to protocol version 2 only.
499 .It Cm GSSAPITrustDns
500 Set to 
501 .Dq yes 
502 to indicate that the DNS is trusted to securely canonicalize
503 the name of the host being connected to. If 
504 .Dq no , 
505 the hostname entered on the
506 command line will be passed untouched to the GSSAPI library.
507 The default is
508 .Dq yes .
509 This option only applies to protocol version 2 connections using GSSAPI.
510 .It Cm HashKnownHosts
511 Indicates that
512 .Xr ssh 1
513 should hash host names and addresses when they are added to
514 .Pa ~/.ssh/known_hosts .
515 These hashed names may be used normally by
516 .Xr ssh 1
517 and
518 .Xr sshd 8 ,
519 but they do not reveal identifying information should the file's contents
520 be disclosed.
521 The default is
522 .Dq no .
523 Note that existing names and addresses in known hosts files
524 will not be converted automatically,
525 but may be manually hashed using
526 .Xr ssh-keygen 1 .
527 .It Cm HostbasedAuthentication
528 Specifies whether to try rhosts based authentication with public key
529 authentication.
530 The argument must be
531 .Dq yes
532 or
533 .Dq no .
534 The default is
535 .Dq no .
536 This option applies to protocol version 2 only and
537 is similar to
538 .Cm RhostsRSAAuthentication .
539 .It Cm HostKeyAlgorithms
540 Specifies the protocol version 2 host key algorithms
541 that the client wants to use in order of preference.
542 The default for this option is:
543 .Dq ssh-rsa,ssh-dss .
544 .It Cm HostKeyAlias
545 Specifies an alias that should be used instead of the
546 real host name when looking up or saving the host key
547 in the host key database files.
548 This option is useful for tunneling SSH connections
549 or for multiple servers running on a single host.
550 .It Cm HostName
551 Specifies the real host name to log into.
552 This can be used to specify nicknames or abbreviations for hosts.
553 The default is the name given on the command line.
554 Numeric IP addresses are also permitted (both on the command line and in
555 .Cm HostName
556 specifications).
557 .It Cm IdentitiesOnly
558 Specifies that
559 .Xr ssh 1
560 should only use the authentication identity files configured in the
561 .Nm
562 files,
563 even if
564 .Xr ssh-agent 1
565 offers more identities.
566 The argument to this keyword must be
567 .Dq yes
568 or
569 .Dq no .
570 This option is intended for situations where ssh-agent
571 offers many different identities.
572 The default is
573 .Dq no .
574 .It Cm IdentityFile
575 Specifies a file from which the user's RSA or DSA authentication identity
576 is read.
577 The default is
578 .Pa ~/.ssh/identity
579 for protocol version 1, and
580 .Pa ~/.ssh/id_rsa
581 and
582 .Pa ~/.ssh/id_dsa
583 for protocol version 2.
584 Additionally, any identities represented by the authentication agent
585 will be used for authentication.
586 .Pp
587 The file name may use the tilde
588 syntax to refer to a user's home directory or one of the following
589 escape characters:
590 .Ql %d
591 (local user's home directory),
592 .Ql %u
593 (local user name),
594 .Ql %l
595 (local host name),
596 .Ql %h
597 (remote host name) or
598 .Ql %r
599 (remote user name).
600 .Pp
601 It is possible to have
602 multiple identity files specified in configuration files; all these
603 identities will be tried in sequence.
604 .It Cm KbdInteractiveDevices
605 Specifies the list of methods to use in keyboard-interactive authentication.
606 Multiple method names must be comma-separated.
607 The default is to use the server specified list.
608 The methods available vary depending on what the server supports.
609 For an OpenSSH server,
610 it may be zero or more of:
611 .Dq bsdauth ,
612 .Dq pam ,
613 and
614 .Dq skey .
615 .It Cm LocalCommand
616 Specifies a command to execute on the local machine after successfully
617 connecting to the server.
618 The command string extends to the end of the line, and is executed with
619 .Pa /bin/sh .
620 This directive is ignored unless
621 .Cm PermitLocalCommand
622 has been enabled.
623 .It Cm LocalForward
624 Specifies that a TCP port on the local machine be forwarded over
625 the secure channel to the specified host and port from the remote machine.
626 The first argument must be
627 .Sm off
628 .Oo Ar bind_address : Oc Ar port
629 .Sm on
630 and the second argument must be
631 .Ar host : Ns Ar hostport .
632 IPv6 addresses can be specified by enclosing addresses in square brackets or
633 by using an alternative syntax:
634 .Oo Ar bind_address Ns / Oc Ns Ar port
635 and
636 .Ar host Ns / Ns Ar hostport .
637 Multiple forwardings may be specified, and additional forwardings can be
638 given on the command line.
639 Only the superuser can forward privileged ports.
640 By default, the local port is bound in accordance with the
641 .Cm GatewayPorts
642 setting.
643 However, an explicit
644 .Ar bind_address
645 may be used to bind the connection to a specific address.
646 The
647 .Ar bind_address
648 of
649 .Dq localhost
650 indicates that the listening port be bound for local use only, while an
651 empty address or
652 .Sq *
653 indicates that the port should be available from all interfaces.
654 .It Cm LogLevel
655 Gives the verbosity level that is used when logging messages from
656 .Xr ssh 1 .
657 The possible values are:
658 QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
659 The default is INFO.
660 DEBUG and DEBUG1 are equivalent.
661 DEBUG2 and DEBUG3 each specify higher levels of verbose output.
662 .It Cm MACs
663 Specifies the MAC (message authentication code) algorithms
664 in order of preference.
665 The MAC algorithm is used in protocol version 2
666 for data integrity protection.
667 Multiple algorithms must be comma-separated.
668 The default is:
669 .Dq hmac-md5,hmac-sha1,hmac-ripemd160,hmac-sha1-96,hmac-md5-96 .
670 .It Cm NoHostAuthenticationForLocalhost
671 This option can be used if the home directory is shared across machines.
672 In this case localhost will refer to a different machine on each of
673 the machines and the user will get many warnings about changed host keys.
674 However, this option disables host authentication for localhost.
675 The argument to this keyword must be
676 .Dq yes
677 or
678 .Dq no .
679 The default is to check the host key for localhost.
680 .It Cm NumberOfPasswordPrompts
681 Specifies the number of password prompts before giving up.
682 The argument to this keyword must be an integer.
683 The default is 3.
684 .It Cm PasswordAuthentication
685 Specifies whether to use password authentication.
686 The argument to this keyword must be
687 .Dq yes
688 or
689 .Dq no .
690 The default is
691 .Dq yes .
692 .It Cm PermitLocalCommand
693 Allow local command execution via the
694 .Ic LocalCommand
695 option or using the
696 .Ic !\& Ns Ar command
697 escape sequence in
698 .Xr ssh 1 .
699 The argument must be
700 .Dq yes
701 or
702 .Dq no .
703 The default is
704 .Dq no .
705 .It Cm Port
706 Specifies the port number to connect on the remote host.
707 The default is 22.
708 .It Cm PreferredAuthentications
709 Specifies the order in which the client should try protocol 2
710 authentication methods.
711 This allows a client to prefer one method (e.g.\&
712 .Cm keyboard-interactive )
713 over another method (e.g.\&
714 .Cm password )
715 The default for this option is:
716 .Do gssapi-keyex ,
717 external-keyx,
718 gssapi-with-mic,
719 hostbased,
720 publickey,
721 keyboard-interactive,
722 password
723 .Dc .
724 .It Cm Protocol
725 Specifies the protocol versions
726 .Xr ssh 1
727 should support in order of preference.
728 The possible values are
729 .Sq 1
730 and
731 .Sq 2 .
732 Multiple versions must be comma-separated.
733 The default is
734 .Dq 2,1 .
735 This means that ssh
736 tries version 2 and falls back to version 1
737 if version 2 is not available.
738 .It Cm ProxyCommand
739 Specifies the command to use to connect to the server.
740 The command
741 string extends to the end of the line, and is executed with
742 .Pa /bin/sh .
743 In the command string,
744 .Ql %h
745 will be substituted by the host name to
746 connect and
747 .Ql %p
748 by the port.
749 The command can be basically anything,
750 and should read from its standard input and write to its standard output.
751 It should eventually connect an
752 .Xr sshd 8
753 server running on some machine, or execute
754 .Ic sshd -i
755 somewhere.
756 Host key management will be done using the
757 HostName of the host being connected (defaulting to the name typed by
758 the user).
759 Setting the command to
760 .Dq none
761 disables this option entirely.
762 Note that
763 .Cm CheckHostIP
764 is not available for connects with a proxy command.
765 .Pp
766 This directive is useful in conjunction with
767 .Xr nc 1
768 and its proxy support.
769 For example, the following directive would connect via an HTTP proxy at
770 192.0.2.0:
771 .Bd -literal -offset 3n
772 ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p
773 .Ed
774 .It Cm PubkeyAuthentication
775 Specifies whether to try public key authentication.
776 The argument to this keyword must be
777 .Dq yes
778 or
779 .Dq no .
780 The default is
781 .Dq yes .
782 This option applies to protocol version 2 only.
783 .It Cm RekeyLimit
784 Specifies the maximum amount of data that may be transmitted before the
785 session key is renegotiated.
786 The argument is the number of bytes, with an optional suffix of
787 .Sq K ,
788 .Sq M ,
789 or
790 .Sq G
791 to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
792 The default is between
793 .Sq 1G
794 and
795 .Sq 4G ,
796 depending on the cipher.
797 This option applies to protocol version 2 only.
798 .It Cm RemoteForward
799 Specifies that a TCP port on the remote machine be forwarded over
800 the secure channel to the specified host and port from the local machine.
801 The first argument must be
802 .Sm off
803 .Oo Ar bind_address : Oc Ar port
804 .Sm on
805 and the second argument must be
806 .Ar host : Ns Ar hostport .
807 IPv6 addresses can be specified by enclosing addresses in square brackets
808 or by using an alternative syntax:
809 .Oo Ar bind_address Ns / Oc Ns Ar port
810 and
811 .Ar host Ns / Ns Ar hostport .
812 Multiple forwardings may be specified, and additional
813 forwardings can be given on the command line.
814 Only the superuser can forward privileged ports.
815 .Pp
816 If the
817 .Ar bind_address
818 is not specified, the default is to only bind to loopback addresses.
819 If the
820 .Ar bind_address
821 is
822 .Ql *
823 or an empty string, then the forwarding is requested to listen on all
824 interfaces.
825 Specifying a remote
826 .Ar bind_address
827 will only succeed if the server's
828 .Cm GatewayPorts
829 option is enabled (see
830 .Xr sshd_config 5 ) .
831 .It Cm RhostsRSAAuthentication
832 Specifies whether to try rhosts based authentication with RSA host
833 authentication.
834 The argument must be
835 .Dq yes
836 or
837 .Dq no .
838 The default is
839 .Dq no .
840 This option applies to protocol version 1 only and requires
841 .Xr ssh 1
842 to be setuid root.
843 .It Cm RSAAuthentication
844 Specifies whether to try RSA authentication.
845 The argument to this keyword must be
846 .Dq yes
847 or
848 .Dq no .
849 RSA authentication will only be
850 attempted if the identity file exists, or an authentication agent is
851 running.
852 The default is
853 .Dq yes .
854 Note that this option applies to protocol version 1 only.
855 .It Cm SendEnv
856 Specifies what variables from the local
857 .Xr environ 7
858 should be sent to the server.
859 Note that environment passing is only supported for protocol 2.
860 The server must also support it, and the server must be configured to
861 accept these environment variables.
862 Refer to
863 .Cm AcceptEnv
864 in
865 .Xr sshd_config 5
866 for how to configure the server.
867 Variables are specified by name, which may contain wildcard characters.
868 Multiple environment variables may be separated by whitespace or spread
869 across multiple
870 .Cm SendEnv
871 directives.
872 The default is not to send any environment variables.
873 .Pp
874 See
875 .Sx PATTERNS
876 for more information on patterns.
877 .It Cm ServerAliveCountMax
878 Sets the number of server alive messages (see below) which may be
879 sent without
880 .Xr ssh 1
881 receiving any messages back from the server.
882 If this threshold is reached while server alive messages are being sent,
883 ssh will disconnect from the server, terminating the session.
884 It is important to note that the use of server alive messages is very
885 different from
886 .Cm TCPKeepAlive
887 (below).
888 The server alive messages are sent through the encrypted channel
889 and therefore will not be spoofable.
890 The TCP keepalive option enabled by
891 .Cm TCPKeepAlive
892 is spoofable.
893 The server alive mechanism is valuable when the client or
894 server depend on knowing when a connection has become inactive.
895 .Pp
896 The default value is 3.
897 If, for example,
898 .Cm ServerAliveInterval
899 (see below) is set to 15 and
900 .Cm ServerAliveCountMax
901 is left at the default, if the server becomes unresponsive,
902 ssh will disconnect after approximately 45 seconds.
903 This option applies to protocol version 2 only.
904 .It Cm ServerAliveInterval
905 Sets a timeout interval in seconds after which if no data has been received
906 from the server,
907 .Xr ssh 1
908 will send a message through the encrypted
909 channel to request a response from the server.
910 The default
911 is 0, indicating that these messages will not be sent to the server.
912 This option applies to protocol version 2 only.
913 .It Cm SmartcardDevice
914 Specifies which smartcard device to use.
915 The argument to this keyword is the device
916 .Xr ssh 1
917 should use to communicate with a smartcard used for storing the user's
918 private RSA key.
919 By default, no device is specified and smartcard support is not activated.
920 .It Cm StrictHostKeyChecking
921 If this flag is set to
922 .Dq yes ,
923 .Xr ssh 1
924 will never automatically add host keys to the
925 .Pa ~/.ssh/known_hosts
926 file, and refuses to connect to hosts whose host key has changed.
927 This provides maximum protection against trojan horse attacks,
928 though it can be annoying when the
929 .Pa /etc/ssh/ssh_known_hosts
930 file is poorly maintained or when connections to new hosts are
931 frequently made.
932 This option forces the user to manually
933 add all new hosts.
934 If this flag is set to
935 .Dq no ,
936 ssh will automatically add new host keys to the
937 user known hosts files.
938 If this flag is set to
939 .Dq ask ,
940 new host keys
941 will be added to the user known host files only after the user
942 has confirmed that is what they really want to do, and
943 ssh will refuse to connect to hosts whose host key has changed.
944 The host keys of
945 known hosts will be verified automatically in all cases.
946 The argument must be
947 .Dq yes ,
948 .Dq no ,
949 or
950 .Dq ask .
951 The default is
952 .Dq ask .
953 .It Cm TCPKeepAlive
954 Specifies whether the system should send TCP keepalive messages to the
955 other side.
956 If they are sent, death of the connection or crash of one
957 of the machines will be properly noticed.
958 However, this means that
959 connections will die if the route is down temporarily, and some people
960 find it annoying.
961 .Pp
962 The default is
963 .Dq yes
964 (to send TCP keepalive messages), and the client will notice
965 if the network goes down or the remote host dies.
966 This is important in scripts, and many users want it too.
967 .Pp
968 To disable TCP keepalive messages, the value should be set to
969 .Dq no .
970 .It Cm Tunnel
971 Request
972 .Xr tun 4
973 device forwarding between the client and the server.
974 The argument must be
975 .Dq yes ,
976 .Dq point-to-point
977 (layer 3),
978 .Dq ethernet
979 (layer 2),
980 or
981 .Dq no .
982 Specifying
983 .Dq yes
984 requests the default tunnel mode, which is
985 .Dq point-to-point .
986 The default is
987 .Dq no .
988 .It Cm TunnelDevice
989 Specifies the
990 .Xr tun 4
991 devices to open on the client
992 .Pq Ar local_tun
993 and the server
994 .Pq Ar remote_tun .
995 .Pp
996 The argument must be
997 .Sm off
998 .Ar local_tun Op : Ar remote_tun .
999 .Sm on
1000 The devices may be specified by numerical ID or the keyword
1001 .Dq any ,
1002 which uses the next available tunnel device.
1003 If
1004 .Ar remote_tun
1005 is not specified, it defaults to
1006 .Dq any .
1007 The default is
1008 .Dq any:any .
1009 .It Cm UsePrivilegedPort
1010 Specifies whether to use a privileged port for outgoing connections.
1011 The argument must be
1012 .Dq yes
1013 or
1014 .Dq no .
1015 The default is
1016 .Dq no .
1017 If set to
1018 .Dq yes ,
1019 .Xr ssh 1
1020 must be setuid root.
1021 Note that this option must be set to
1022 .Dq yes
1023 for
1024 .Cm RhostsRSAAuthentication
1025 with older servers.
1026 .It Cm User
1027 Specifies the user to log in as.
1028 This can be useful when a different user name is used on different machines.
1029 This saves the trouble of
1030 having to remember to give the user name on the command line.
1031 .It Cm UserKnownHostsFile
1032 Specifies a file to use for the user
1033 host key database instead of
1034 .Pa ~/.ssh/known_hosts .
1035 .It Cm VerifyHostKeyDNS
1036 Specifies whether to verify the remote key using DNS and SSHFP resource
1037 records.
1038 If this option is set to
1039 .Dq yes ,
1040 the client will implicitly trust keys that match a secure fingerprint
1041 from DNS.
1042 Insecure fingerprints will be handled as if this option was set to
1043 .Dq ask .
1044 If this option is set to
1045 .Dq ask ,
1046 information on fingerprint match will be displayed, but the user will still
1047 need to confirm new host keys according to the
1048 .Cm StrictHostKeyChecking
1049 option.
1050 The argument must be
1051 .Dq yes ,
1052 .Dq no ,
1053 or
1054 .Dq ask .
1055 The default is
1056 .Dq no .
1057 Note that this option applies to protocol version 2 only.
1058 .Pp
1059 See also
1060 .Sx VERIFYING HOST KEYS
1061 in
1062 .Xr ssh 1 .
1063 .It Cm XAuthLocation
1064 Specifies the full pathname of the
1065 .Xr xauth 1
1066 program.
1067 The default is
1068 .Pa /usr/X11R6/bin/xauth .
1069 .El
1070 .Sh PATTERNS
1071 A
1072 .Em pattern
1073 consists of zero or more non-whitespace characters,
1074 .Sq *
1075 (a wildcard that matches zero or more characters),
1076 or
1077 .Sq ?\&
1078 (a wildcard that matches exactly one character).
1079 For example, to specify a set of declarations for any host in the
1080 .Dq .co.uk
1081 set of domains,
1082 the following pattern could be used:
1083 .Pp
1084 .Dl Host *.co.uk
1085 .Pp
1086 The following pattern
1087 would match any host in the 192.168.0.[0-9] network range:
1088 .Pp
1089 .Dl Host 192.168.0.?
1090 .Pp
1091 A
1092 .Em pattern-list
1093 is a comma-separated list of patterns.
1094 Patterns within pattern-lists may be negated
1095 by preceding them with an exclamation mark
1096 .Pq Sq !\& .
1097 For example,
1098 to allow a key to be used from anywhere within an organisation
1099 except from the
1100 .Dq dialup
1101 pool,
1102 the following entry (in authorized_keys) could be used:
1103 .Pp
1104 .Dl from=\&"!*.dialup.example.com,*.example.com\&"
1105 .Sh FILES
1106 .Bl -tag -width Ds
1107 .It Pa ~/.ssh/config
1108 This is the per-user configuration file.
1109 The format of this file is described above.
1110 This file is used by the SSH client.
1111 Because of the potential for abuse, this file must have strict permissions:
1112 read/write for the user, and not accessible by others.
1113 .It Pa /etc/ssh/ssh_config
1114 Systemwide configuration file.
1115 This file provides defaults for those
1116 values that are not specified in the user's configuration file, and
1117 for those users who do not have a configuration file.
1118 This file must be world-readable.
1119 .El
1120 .Sh SEE ALSO
1121 .Xr ssh 1
1122 .Sh AUTHORS
1123 OpenSSH is a derivative of the original and free
1124 ssh 1.2.12 release by Tatu Ylonen.
1125 Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1126 Theo de Raadt and Dug Song
1127 removed many bugs, re-added newer features and
1128 created OpenSSH.
1129 Markus Friedl contributed the support for SSH
1130 protocol versions 1.5 and 2.0.
This page took 1.36321 seconds and 3 git commands to generate.