]> andersk Git - openssh.git/blob - ssh.1
- (djm) Merge OpenBSD changes:
[openssh.git] / ssh.1
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 .Dd September 25, 1999
38 .Dt SSH 1
39 .Os
40 .Sh NAME
41 .Nm ssh
42 .Nd OpenSSH secure shell client (remote login program)
43 .Sh SYNOPSIS
44 .Nm ssh
45 .Op Fl l Ar login_name
46 .Op Ar hostname | user@hostname
47 .Op Ar command
48 .Pp
49 .Nm ssh
50 .Op Fl afgknqtvxACNPTX246
51 .Op Fl c Ar cipher_spec
52 .Op Fl e Ar escape_char
53 .Op Fl i Ar identity_file
54 .Op Fl l Ar login_name
55 .Op Fl o Ar option
56 .Op Fl p Ar port
57 .Oo Fl L Xo
58 .Sm off
59 .Ar port :
60 .Ar host :
61 .Ar hostport
62 .Sm on
63 .Xc
64 .Oc
65 .Oo Fl R Xo
66 .Sm off
67 .Ar port :
68 .Ar host :
69 .Ar hostport
70 .Sm on
71 .Xc
72 .Oc
73 .Op Ar hostname | user@hostname
74 .Op Ar command
75 .Sh DESCRIPTION
76 .Nm
77 (Secure Shell) is a program for logging into a remote machine and for
78 executing commands on a remote machine.
79 It is intended to replace
80 rlogin and rsh, and provide secure encrypted communications between
81 two untrusted hosts over an insecure network.
82 X11 connections and
83 arbitrary TCP/IP ports can also be forwarded over the secure channel.
84 .Pp
85 .Nm
86 connects and logs into the specified
87 .Ar hostname .
88 The user must prove
89 his/her identity to the remote machine using one of several methods
90 depending on the protocol version used:
91 .Pp
92 .Ss SSH protocol version 1
93 .Pp
94 First, if the machine the user logs in from is listed in
95 .Pa /etc/hosts.equiv
96 or
97 .Pa /etc/shosts.equiv
98 on the remote machine, and the user names are
99 the same on both sides, the user is immediately permitted to log in.
100 Second, if
101 .Pa \&.rhosts
102 or
103 .Pa \&.shosts
104 exists in the user's home directory on the
105 remote machine and contains a line containing the name of the client
106 machine and the name of the user on that machine, the user is
107 permitted to log in.
108 This form of authentication alone is normally not
109 allowed by the server because it is not secure.
110 .Pp
111 The second (and primary) authentication method is the
112 .Pa rhosts
113 or
114 .Pa hosts.equiv
115 method combined with RSA-based host authentication.
116 It means that if the login would be permitted by
117 .Pa $HOME/.rhosts ,
118 .Pa $HOME/.shosts ,
119 .Pa /etc/hosts.equiv ,
120 or
121 .Pa /etc/shosts.equiv ,
122 and if additionally the server can verify the client's
123 host key (see
124 .Pa /etc/ssh_known_hosts
125 and
126 .Pa $HOME/.ssh/known_hosts
127 in the
128 .Sx FILES
129 section), only then login is permitted.
130 This authentication method closes security holes due to IP
131 spoofing, DNS spoofing and routing spoofing.
132 [Note to the administrator:
133 .Pa /etc/hosts.equiv ,
134 .Pa $HOME/.rhosts ,
135 and the rlogin/rsh protocol in general, are inherently insecure and should be
136 disabled if security is desired.]
137 .Pp
138 As a third authentication method,
139 .Nm
140 supports RSA based authentication.
141 The scheme is based on public-key cryptography: there are cryptosystems
142 where encryption and decryption are done using separate keys, and it
143 is not possible to derive the decryption key from the encryption key.
144 RSA is one such system.
145 The idea is that each user creates a public/private
146 key pair for authentication purposes.
147 The server knows the public key, and only the user knows the private key.
148 The file
149 .Pa $HOME/.ssh/authorized_keys
150 lists the public keys that are permitted for logging
151 in.
152 When the user logs in, the
153 .Nm
154 program tells the server which key pair it would like to use for
155 authentication.
156 The server checks if this key is permitted, and if
157 so, sends the user (actually the
158 .Nm
159 program running on behalf of the user) a challenge, a random number,
160 encrypted by the user's public key.
161 The challenge can only be
162 decrypted using the proper private key.
163 The user's client then decrypts the
164 challenge using the private key, proving that he/she knows the private
165 key but without disclosing it to the server.
166 .Pp
167 .Nm
168 implements the RSA authentication protocol automatically.
169 The user creates his/her RSA key pair by running
170 .Xr ssh-keygen 1 .
171 This stores the private key in
172 .Pa $HOME/.ssh/identity
173 and the public key in
174 .Pa $HOME/.ssh/identity.pub
175 in the user's home directory.
176 The user should then copy the
177 .Pa identity.pub
178 to
179 .Pa $HOME/.ssh/authorized_keys
180 in his/her home directory on the remote machine (the
181 .Pa authorized_keys
182 file corresponds to the conventional
183 .Pa $HOME/.rhosts
184 file, and has one key
185 per line, though the lines can be very long).
186 After this, the user can log in without giving the password.
187 RSA authentication is much
188 more secure than rhosts authentication.
189 .Pp
190 The most convenient way to use RSA authentication may be with an
191 authentication agent.
192 See
193 .Xr ssh-agent 1
194 for more information.
195 .Pp
196 If other authentication methods fail,
197 .Nm
198 prompts the user for a password.
199 The password is sent to the remote
200 host for checking; however, since all communications are encrypted,
201 the password cannot be seen by someone listening on the network.
202 .Pp
203 .Ss SSH protocol version 2
204 .Pp
205 When a user connects using the protocol version 2
206 different authentication methods are available:
207 At first, the client attempts to authenticate using the public key method.
208 If this method fails password authentication is tried.
209 .Pp
210 The public key method is similar to RSA authentication described
211 in the previous section except that the DSA algorithm is used
212 instead of the patented RSA algorithm.
213 The client uses his private DSA key
214 .Pa $HOME/.ssh/id_dsa
215 to sign the session identifier and sends the result to the server.
216 The server checks whether the matching public key is listed in
217 .Pa $HOME/.ssh/authorized_keys2
218 and grants access if both the key is found and the signature is correct.
219 The session identifier is derived from a shared Diffie-Hellman value
220 and is only known to the client and the server.
221 .Pp
222 If public key authentication fails or is not available a password
223 can be sent encrypted to the remote host for proving the user's identity.
224 This protocol 2 implementation does not yet support Kerberos or
225 S/Key authentication.
226 .Pp
227 Protocol 2 provides additional mechanisms for confidentiality
228 (the traffic is encrypted using 3DES, Blowfish, CAST128 or Arcfour)
229 and integrity (hmac-sha1, hmac-md5).
230 Note that protocol 1 lacks a strong mechanism for ensuring the
231 integrity of the connection.
232 .Pp
233 .Ss Login session and remote execution
234 .Pp
235 When the user's identity has been accepted by the server, the server
236 either executes the given command, or logs into the machine and gives
237 the user a normal shell on the remote machine.
238 All communication with
239 the remote command or shell will be automatically encrypted.
240 .Pp
241 If a pseudo-terminal has been allocated (normal login session), the
242 user can disconnect with
243 .Ic ~. ,
244 and suspend
245 .Nm
246 with
247 .Ic ~^Z .
248 All forwarded connections can be listed with
249 .Ic ~#
250 and if
251 the session blocks waiting for forwarded X11 or TCP/IP
252 connections to terminate, it can be backgrounded with
253 .Ic ~&
254 (this should not be used while the user shell is active, as it can cause the
255 shell to hang).
256 All available escapes can be listed with
257 .Ic ~? .
258 .Pp
259 A single tilde character can be sent as
260 .Ic ~~
261 (or by following the tilde by a character other than those described above).
262 The escape character must always follow a newline to be interpreted as
263 special.
264 The escape character can be changed in configuration files
265 or on the command line.
266 .Pp
267 If no pseudo tty has been allocated, the
268 session is transparent and can be used to reliably transfer binary
269 data.
270 On most systems, setting the escape character to
271 .Dq none
272 will also make the session transparent even if a tty is used.
273 .Pp
274 The session terminates when the command or shell in on the remote
275 machine exists and all X11 and TCP/IP connections have been closed.
276 The exit status of the remote program is returned as the exit status
277 of
278 .Nm ssh .
279 .Pp
280 .Ss X11 and TCP forwarding
281 .Pp
282 If the user is using X11 (the
283 .Ev DISPLAY
284 environment variable is set), the connection to the X11 display is
285 automatically forwarded to the remote side in such a way that any X11
286 programs started from the shell (or command) will go through the
287 encrypted channel, and the connection to the real X server will be made
288 from the local machine.
289 The user should not manually set
290 .Ev DISPLAY .
291 Forwarding of X11 connections can be
292 configured on the command line or in configuration files.
293 .Pp
294 The
295 .Ev DISPLAY
296 value set by
297 .Nm
298 will point to the server machine, but with a display number greater
299 than zero.
300 This is normal, and happens because
301 .Nm
302 creates a
303 .Dq proxy
304 X server on the server machine for forwarding the
305 connections over the encrypted channel.
306 .Pp
307 .Nm
308 will also automatically set up Xauthority data on the server machine.
309 For this purpose, it will generate a random authorization cookie,
310 store it in Xauthority on the server, and verify that any forwarded
311 connections carry this cookie and replace it by the real cookie when
312 the connection is opened.
313 The real authentication cookie is never
314 sent to the server machine (and no cookies are sent in the plain).
315 .Pp
316 If the user is using an authentication agent, the connection to the agent
317 is automatically forwarded to the remote side unless disabled on
318 command line or in a configuration file.
319 .Pp
320 Forwarding of arbitrary TCP/IP connections over the secure channel can
321 be specified either on command line or in a configuration file.
322 One possible application of TCP/IP forwarding is a secure connection to an
323 electronic purse; another is going trough firewalls.
324 .Pp
325 .Ss Server authentication
326 .Pp
327 .Nm
328 automatically maintains and checks a database containing
329 identifications for all hosts it has ever been used with.
330 RSA host keys are stored in
331 .Pa $HOME/.ssh/known_hosts
332 and
333 DSA host keys are stored in
334 .Pa $HOME/.ssh/known_hosts2
335 in the user's home directory.
336 Additionally, the files
337 .Pa /etc/ssh_known_hosts
338 and
339 .Pa /etc/ssh_known_hosts2
340 are automatically checked for known hosts.
341 Any new hosts are automatically added to the user's file.
342 If a host's identification
343 ever changes,
344 .Nm
345 warns about this and disables password authentication to prevent a
346 trojan horse from getting the user's password.
347 Another purpose of
348 this mechanism is to prevent man-in-the-middle attacks which could
349 otherwise be used to circumvent the encryption.
350 The
351 .Cm StrictHostKeyChecking
352 option (see below) can be used to prevent logins to machines whose
353 host key is not known or has changed.
354 .Sh OPTIONS
355 .Bl -tag -width Ds
356 .It Fl a
357 Disables forwarding of the authentication agent connection.
358 .It Fl A
359 Enables forwarding of the authentication agent connection.
360 This can also be specified on a per-host basis in a configuration file.
361 .It Fl c Ar blowfish|3des
362 Selects the cipher to use for encrypting the session.
363 .Ar 3des
364 is used by default.
365 It is believed to be secure.
366 .Ar 3des
367 (triple-des) is an encrypt-decrypt-encrypt triple with three different keys.
368 It is presumably more secure than the
369 .Ar des
370 cipher which is no longer supported in
371 .Nm ssh .
372 .Ar blowfish
373 is a fast block cipher, it appears very secure and is much faster than
374 .Ar 3des .
375 .It Fl c Ar "3des-cbc,blowfish-cbc,arcfour,cast128-cbc"
376 Additionally, for protocol version 2 a comma-separated list of ciphers can
377 be specified in order of preference. Protocol version 2 supports
378 3DES, Blowfish and CAST128 in CBC mode and Arcfour.
379 .It Fl e Ar ch|^ch|none
380 Sets the escape character for sessions with a pty (default:
381 .Ql ~ ) .
382 The escape character is only recognized at the beginning of a line.
383 The escape character followed by a dot
384 .Pq Ql \&.
385 closes the connection, followed
386 by control-Z suspends the connection, and followed by itself sends the
387 escape character once.
388 Setting the character to
389 .Dq none
390 disables any escapes and makes the session fully transparent.
391 .It Fl f
392 Requests
393 .Nm
394 to go to background just before command execution.
395 This is useful if
396 .Nm
397 is going to ask for passwords or passphrases, but the user
398 wants it in the background.
399 This implies
400 .Fl n .
401 The recommended way to start X11 programs at a remote site is with
402 something like
403 .Ic ssh -f host xterm .
404 .It Fl g
405 Allows remote hosts to connect to local forwarded ports.
406 .It Fl i Ar identity_file
407 Selects the file from which the identity (private key) for
408 RSA authentication is read.
409 Default is
410 .Pa $HOME/.ssh/identity
411 in the user's home directory.
412 Identity files may also be specified on
413 a per-host basis in the configuration file.
414 It is possible to have multiple
415 .Fl i
416 options (and multiple identities specified in
417 configuration files).
418 .It Fl k
419 Disables forwarding of Kerberos tickets and AFS tokens.
420 This may also be specified on a per-host basis in the configuration file.
421 .It Fl l Ar login_name
422 Specifies the user to log in as on the remote machine.
423 This also may be specified on a per-host basis in the configuration file.
424 .It Fl n
425 Redirects stdin from
426 .Pa /dev/null
427 (actually, prevents reading from stdin).
428 This must be used when
429 .Nm
430 is run in the background.
431 A common trick is to use this to run X11 programs on a remote machine.
432 For example,
433 .Ic ssh -n shadows.cs.hut.fi emacs &
434 will start an emacs on shadows.cs.hut.fi, and the X11
435 connection will be automatically forwarded over an encrypted channel.
436 The
437 .Nm
438 program will be put in the background.
439 (This does not work if
440 .Nm
441 needs to ask for a password or passphrase; see also the
442 .Fl f
443 option.)
444 .It Fl N
445 Do not execute a remote command.
446 This is usefull if you just want to forward ports
447 (protocol version 2 only).
448 .It Fl o Ar option
449 Can be used to give options in the format used in the config file.
450 This is useful for specifying options for which there is no separate
451 command-line flag.
452 The option has the same format as a line in the configuration file.
453 .It Fl p Ar port
454 Port to connect to on the remote host.
455 This can be specified on a
456 per-host basis in the configuration file.
457 .It Fl P
458 Use a non-privileged port for outgoing connections.
459 This can be used if your firewall does
460 not permit connections from privileged ports.
461 Note that this option turns off
462 .Cm RhostsAuthentication
463 and
464 .Cm RhostsRSAAuthentication .
465 .It Fl q
466 Quiet mode.
467 Causes all warning and diagnostic messages to be suppressed.
468 Only fatal errors are displayed.
469 .It Fl t
470 Force pseudo-tty allocation.
471 This can be used to execute arbitrary
472 screen-based programs on a remote machine, which can be very useful,
473 e.g., when implementing menu services.
474 .It Fl T
475 Disable pseudo-tty allocation (protocol version 2 only).
476 .It Fl v
477 Verbose mode.
478 Causes
479 .Nm
480 to print debugging messages about its progress.
481 This is helpful in
482 debugging connection, authentication, and configuration problems.
483 The verbose mode is also used to display
484 .Xr skey 1
485 challenges, if the user entered "s/key" as password.
486 Multiple -v options increases the verbosity. Maximum is 3.
487 .It Fl x
488 Disables X11 forwarding.
489 .It Fl X
490 Enables X11 forwarding.
491 This can also be specified on a per-host basis in a configuration file.
492 .It Fl C
493 Requests compression of all data (including stdin, stdout, stderr, and
494 data for forwarded X11 and TCP/IP connections).
495 The compression algorithm is the same used by
496 .Xr gzip 1 ,
497 and the
498 .Dq level
499 can be controlled by the
500 .Cm CompressionLevel
501 option (see below).
502 Compression is desirable on modem lines and other
503 slow connections, but will only slow down things on fast networks.
504 The default value can be set on a host-by-host basis in the
505 configuration files; see the
506 .Cm Compress
507 option below.
508 .It Fl L Ar port:host:hostport
509 Specifies that the given port on the local (client) host is to be
510 forwarded to the given host and port on the remote side.
511 This works by allocating a socket to listen to
512 .Ar port
513 on the local side, and whenever a connection is made to this port, the
514 connection is forwarded over the secure channel, and a connection is
515 made to
516 .Ar host
517 port
518 .Ar hostport
519 from the remote machine.
520 Port forwardings can also be specified in the configuration file.
521 Only root can forward privileged ports.
522 IPv6 addresses can be specified with an alternative syntax:
523 .Ar port/host/hostport
524 .It Fl R Ar port:host:hostport
525 Specifies that the given port on the remote (server) host is to be
526 forwarded to the given host and port on the local side.
527 This works by allocating a socket to listen to
528 .Ar port
529 on the remote side, and whenever a connection is made to this port, the
530 connection is forwarded over the secure channel, and a connection is
531 made to
532 .Ar host
533 port
534 .Ar hostport
535 from the local machine.
536 Port forwardings can also be specified in the configuration file.
537 Privileged ports can be forwarded only when
538 logging in as root on the remote machine.
539 .It Fl 2
540 Forces
541 .Nm
542 to try protocol version 2 only.
543 .It Fl 4
544 Forces
545 .Nm
546 to use IPv4 addresses only.
547 .It Fl 6
548 Forces
549 .Nm
550 to use IPv6 addresses only.
551 .El
552 .Sh CONFIGURATION FILES
553 .Nm
554 obtains configuration data from the following sources (in this order):
555 command line options, user's configuration file
556 .Pq Pa $HOME/.ssh/config ,
557 and system-wide configuration file
558 .Pq Pa /etc/ssh_config .
559 For each parameter, the first obtained value
560 will be used.
561 The configuration files contain sections bracketed by
562 .Dq Host
563 specifications, and that section is only applied for hosts that
564 match one of the patterns given in the specification.
565 The matched host name is the one given on the command line.
566 .Pp
567 Since the first obtained value for each parameter is used, more
568 host-specific declarations should be given near the beginning of the
569 file, and general defaults at the end.
570 .Pp
571 The configuration file has the following format:
572 .Pp
573 Empty lines and lines starting with
574 .Ql #
575 are comments.
576 .Pp
577 Otherwise a line is of the format
578 .Dq keyword arguments .
579 The possible
580 keywords and their meanings are as follows (note that the
581 configuration files are case-sensitive):
582 .Bl -tag -width Ds
583 .It Cm Host
584 Restricts the following declarations (up to the next
585 .Cm Host
586 keyword) to be only for those hosts that match one of the patterns
587 given after the keyword.
588 .Ql \&*
589 and
590 .Ql ?
591 can be used as wildcards in the
592 patterns.
593 A single
594 .Ql \&*
595 as a pattern can be used to provide global
596 defaults for all hosts.
597 The host is the
598 .Ar hostname
599 argument given on the command line (i.e., the name is not converted to
600 a canonicalized host name before matching).
601 .It Cm AFSTokenPassing
602 Specifies whether to pass AFS tokens to remote host.
603 The argument to this keyword must be
604 .Dq yes
605 or
606 .Dq no .
607 .It Cm BatchMode
608 If set to
609 .Dq yes ,
610 passphrase/password querying will be disabled.
611 This option is useful in scripts and other batch jobs where you have no
612 user to supply the password.
613 The argument must be
614 .Dq yes
615 or
616 .Dq no .
617 .It Cm CheckHostIP
618 If this flag is set to
619 .Dq yes ,
620 ssh will additionally check the host ip address in the
621 .Pa known_hosts
622 file.
623 This allows ssh to detect if a host key changed due to DNS spoofing.
624 If the option is set to
625 .Dq no ,
626 the check will not be executed.
627 .It Cm Cipher
628 Specifies the cipher to use for encrypting the session.
629 Currently,
630 .Dq blowfish ,
631 and
632 .Dq 3des
633 are supported.
634 The default is
635 .Dq 3des .
636 .It Cm Ciphers
637 Specifies the ciphers allowed for protocol version 2
638 in order of preference.
639 Multiple ciphers must be comma-separated.
640 The default is
641 .Dq 3des-cbc,blowfish-cbc,arcfour,cast128-cbc .
642 .It Cm Compression
643 Specifies whether to use compression.
644 The argument must be
645 .Dq yes
646 or
647 .Dq no .
648 .It Cm CompressionLevel
649 Specifies the compression level to use if compression is enable.
650 The argument must be an integer from 1 (fast) to 9 (slow, best).
651 The default level is 6, which is good for most applications.
652 The meaning of the values is the same as in
653 .Xr gzip 1 .
654 .It Cm ConnectionAttempts
655 Specifies the number of tries (one per second) to make before falling
656 back to rsh or exiting.
657 The argument must be an integer.
658 This may be useful in scripts if the connection sometimes fails.
659 .It Cm DSAAuthentication
660 Specifies whether to try DSA authentication.
661 The argument to this keyword must be
662 .Dq yes
663 or
664 .Dq no .
665 DSA authentication will only be
666 attempted if a DSA identity file exists.
667 Note that this option applies to protocol version 2 only.
668 .It Cm EscapeChar
669 Sets the escape character (default:
670 .Ql ~ ) .
671 The escape character can also
672 be set on the command line.
673 The argument should be a single character,
674 .Ql ^
675 followed by a letter, or
676 .Dq none
677 to disable the escape
678 character entirely (making the connection transparent for binary
679 data).
680 .It Cm FallBackToRsh
681 Specifies that if connecting via
682 .Nm
683 fails due to a connection refused error (there is no
684 .Xr sshd 8
685 listening on the remote host),
686 .Xr rsh 1
687 should automatically be used instead (after a suitable warning about
688 the session being unencrypted).
689 The argument must be
690 .Dq yes
691 or
692 .Dq no .
693 .It Cm ForwardAgent
694 Specifies whether the connection to the authentication agent (if any)
695 will be forwarded to the remote machine.
696 The argument must be
697 .Dq yes
698 or
699 .Dq no .
700 The default is
701 .Dq no .
702 .It Cm ForwardX11
703 Specifies whether X11 connections will be automatically redirected
704 over the secure channel and
705 .Ev DISPLAY
706 set.
707 The argument must be
708 .Dq yes
709 or
710 .Dq no .
711 The default is
712 .Dq no .
713 .It Cm GatewayPorts
714 Specifies whether remote hosts are allowed to connect to local
715 forwarded ports.
716 The argument must be
717 .Dq yes
718 or
719 .Dq no .
720 The default is
721 .Dq no .
722 .It Cm GlobalKnownHostsFile
723 Specifies a file to use instead of
724 .Pa /etc/ssh_known_hosts .
725 .It Cm HostName
726 Specifies the real host name to log into.
727 This can be used to specify nicknames or abbreviations for hosts.
728 Default is the name given on the command line.
729 Numeric IP addresses are also permitted (both on the command line and in
730 .Cm HostName
731 specifications).
732 .It Cm IdentityFile
733 Specifies the file from which the user's RSA authentication identity
734 is read (default
735 .Pa $HOME/.ssh/identity
736 in the user's home directory).
737 Additionally, any identities represented by the authentication agent
738 will be used for authentication.
739 The file name may use the tilde
740 syntax to refer to a user's home directory.
741 It is possible to have
742 multiple identity files specified in configuration files; all these
743 identities will be tried in sequence.
744 .It Cm IdentityFile2
745 Specifies the file from which the user's DSA authentication identity
746 is read (default
747 .Pa $HOME/.ssh/id_dsa
748 in the user's home directory).
749 The file name may use the tilde
750 syntax to refer to a user's home directory.
751 It is possible to have
752 multiple identity files specified in configuration files; all these
753 identities will be tried in sequence.
754 .It Cm KeepAlive
755 Specifies whether the system should send keepalive messages to the
756 other side.
757 If they are sent, death of the connection or crash of one
758 of the machines will be properly noticed.
759 However, this means that
760 connections will die if the route is down temporarily, and some people
761 find it annoying.
762 .Pp
763 The default is
764 .Dq yes
765 (to send keepalives), and the client will notice
766 if the network goes down or the remote host dies.
767 This is important in scripts, and many users want it too.
768 .Pp
769 To disable keepalives, the value should be set to
770 .Dq no
771 in both the server and the client configuration files.
772 .It Cm KerberosAuthentication
773 Specifies whether Kerberos authentication will be used.
774 The argument to this keyword must be
775 .Dq yes
776 or
777 .Dq no .
778 .It Cm KerberosTgtPassing
779 Specifies whether a Kerberos TGT will be forwarded to the server.
780 This will only work if the Kerberos server is actually an AFS kaserver.
781 The argument to this keyword must be
782 .Dq yes
783 or
784 .Dq no .
785 .It Cm LocalForward
786 Specifies that a TCP/IP port on the local machine be forwarded over
787 the secure channel to given host:port from the remote machine.
788 The first argument must be a port number, and the second must be
789 host:port.
790 Multiple forwardings may be specified, and additional
791 forwardings can be given on the command line.
792 Only the superuser can forward privileged ports.
793 .It Cm LogLevel
794 Gives the verbosity level that is used when logging messages from
795 .Nm ssh .
796 The possible values are:
797 QUIET, FATAL, ERROR, INFO, VERBOSE and DEBUG.
798 The default is INFO.
799 .It Cm NumberOfPasswordPrompts
800 Specifies the number of password prompts before giving up.
801 The argument to this keyword must be an integer.
802 Default is 3.
803 .It Cm PasswordAuthentication
804 Specifies whether to use password authentication.
805 The argument to this keyword must be
806 .Dq yes
807 or
808 .Dq no .
809 Note that this option applies to both protocol version 1 and 2.
810 .It Cm Port
811 Specifies the port number to connect on the remote host.
812 Default is 22.
813 .It Cm Protocol
814 Specifies the protocol versions
815 .Nm
816 should support in order of preference.
817 The possible values are
818 .Dq 1
819 and
820 .Dq 2 .
821 Multiple versions must be comma-separated.
822 The default is
823 .Dq 1,2 .
824 This means that
825 .Nm
826 tries version 1 and falls back to version 2
827 if version 1 is not available.
828 .It Cm ProxyCommand
829 Specifies the command to use to connect to the server.
830 The command
831 string extends to the end of the line, and is executed with
832 .Pa /bin/sh .
833 In the command string,
834 .Ql %h
835 will be substituted by the host name to
836 connect and
837 .Ql %p
838 by the port.
839 The command can be basically anything,
840 and should read from its standard input and write to its standard output.
841 It should eventually connect an
842 .Xr sshd 8
843 server running on some machine, or execute
844 .Ic sshd -i
845 somewhere.
846 Host key management will be done using the
847 HostName of the host being connected (defaulting to the name typed by
848 the user).
849 Note that
850 .Cm CheckHostIP
851 is not available for connects with a proxy command.
852 .Pp
853 .It Cm RemoteForward
854 Specifies that a TCP/IP port on the remote machine be forwarded over
855 the secure channel to given host:port from the local machine.
856 The first argument must be a port number, and the second must be
857 host:port.
858 Multiple forwardings may be specified, and additional
859 forwardings can be given on the command line.
860 Only the superuser can forward privileged ports.
861 .It Cm RhostsAuthentication
862 Specifies whether to try rhosts based authentication.
863 Note that this
864 declaration only affects the client side and has no effect whatsoever
865 on security.
866 Disabling rhosts authentication may reduce
867 authentication time on slow connections when rhosts authentication is
868 not used.
869 Most servers do not permit RhostsAuthentication because it
870 is not secure (see RhostsRSAAuthentication).
871 The argument to this keyword must be
872 .Dq yes
873 or
874 .Dq no .
875 .It Cm RhostsRSAAuthentication
876 Specifies whether to try rhosts based authentication with RSA host
877 authentication.
878 This is the primary authentication method for most sites.
879 The argument must be
880 .Dq yes
881 or
882 .Dq no .
883 .It Cm RSAAuthentication
884 Specifies whether to try RSA authentication.
885 The argument to this keyword must be
886 .Dq yes
887 or
888 .Dq no .
889 RSA authentication will only be
890 attempted if the identity file exists, or an authentication agent is
891 running.
892 Note that this option applies to protocol version 1 only.
893 .It Cm SkeyAuthentication
894 Specifies whether to use
895 .Xr skey 1
896 authentication.
897 The argument to this keyword must be
898 .Dq yes
899 or
900 .Dq no .
901 The default is
902 .Dq no .
903 .It Cm StrictHostKeyChecking
904 If this flag is set to
905 .Dq yes ,
906 .Nm
907 ssh will never automatically add host keys to the
908 .Pa $HOME/.ssh/known_hosts
909 and
910 .Pa $HOME/.ssh/known_hosts2
911 files, and refuses to connect hosts whose host key has changed.
912 This provides maximum protection against trojan horse attacks.
913 However, it can be somewhat annoying if you don't have good
914 .Pa /etc/ssh_known_hosts
915 and
916 .Pa /etc/ssh_known_hosts2
917 files installed and frequently
918 connect new hosts.
919 Basically this option forces the user to manually
920 add any new hosts.
921 Normally this option is disabled, and new hosts
922 will automatically be added to the known host files.
923 The host keys of
924 known hosts will be verified automatically in either case.
925 The argument must be
926 .Dq yes
927 or
928 .Dq no .
929 .It Cm UsePrivilegedPort
930 Specifies whether to use a privileged port for outgoing connections.
931 The argument must be
932 .Dq yes
933 or
934 .Dq no .
935 The default is
936 .Dq yes .
937 Note that setting this option to
938 .Dq no
939 turns off
940 .Cm RhostsAuthentication
941 and
942 .Cm RhostsRSAAuthentication .
943 .It Cm User
944 Specifies the user to log in as.
945 This can be useful if you have a different user name on different machines.
946 This saves the trouble of
947 having to remember to give the user name on the command line.
948 .It Cm UserKnownHostsFile
949 Specifies a file to use instead of
950 .Pa $HOME/.ssh/known_hosts .
951 .It Cm UseRsh
952 Specifies that rlogin/rsh should be used for this host.
953 It is possible that the host does not at all support the
954 .Nm
955 protocol.
956 This causes
957 .Nm
958 to immediately execute
959 .Xr rsh 1 .
960 All other options (except
961 .Cm HostName )
962 are ignored if this has been specified.
963 The argument must be
964 .Dq yes
965 or
966 .Dq no .
967 .It Cm XAuthLocation
968 Specifies the location of the
969 .Xr xauth 1
970 program.
971 The default is
972 .Pa /usr/X11R6/bin/xauth .
973 .El
974 .Sh ENVIRONMENT
975 .Nm
976 will normally set the following environment variables:
977 .Bl -tag -width Ds
978 .It Ev DISPLAY
979 The
980 .Ev DISPLAY
981 variable indicates the location of the X11 server.
982 It is automatically set by
983 .Nm
984 to point to a value of the form
985 .Dq hostname:n
986 where hostname indicates
987 the host where the shell runs, and n is an integer >= 1.
988 .Nm
989 uses this special value to forward X11 connections over the secure
990 channel.
991 The user should normally not set DISPLAY explicitly, as that
992 will render the X11 connection insecure (and will require the user to
993 manually copy any required authorization cookies).
994 .It Ev HOME
995 Set to the path of the user's home directory.
996 .It Ev LOGNAME
997 Synonym for
998 .Ev USER ;
999 set for compatibility with systems that use this variable.
1000 .It Ev MAIL
1001 Set to point the user's mailbox.
1002 .It Ev PATH
1003 Set to the default
1004 .Ev PATH ,
1005 as specified when compiling
1006 .Nm ssh .
1007 .It Ev SSH_AUTH_SOCK
1008 indicates the path of a unix-domain socket used to communicate with the
1009 agent.
1010 .It Ev SSH_CLIENT
1011 Identifies the client end of the connection.
1012 The variable contains
1013 three space-separated values: client ip-address, client port number,
1014 and server port number.
1015 .It Ev SSH_TTY
1016 This is set to the name of the tty (path to the device) associated
1017 with the current shell or command.
1018 If the current session has no tty,
1019 this variable is not set.
1020 .It Ev TZ
1021 The timezone variable is set to indicate the present timezone if it
1022 was set when the daemon was started (i.e., the daemon passes the value
1023 on to new connections).
1024 .It Ev USER
1025 Set to the name of the user logging in.
1026 .El
1027 .Pp
1028 Additionally,
1029 .Nm
1030 reads
1031 .Pa $HOME/.ssh/environment ,
1032 and adds lines of the format
1033 .Dq VARNAME=value
1034 to the environment.
1035 .Sh FILES
1036 .Bl -tag -width Ds
1037 .It Pa $HOME/.ssh/known_hosts
1038 Records host keys for all hosts the user has logged into (that are not
1039 in
1040 .Pa /etc/ssh_known_hosts ) .
1041 See
1042 .Xr sshd 8 .
1043 .It Pa $HOME/.ssh/identity, $HOME/.ssh/id_dsa
1044 Contains the RSA and the DSA authentication identity of the user.
1045 These files
1046 contain sensitive data and should be readable by the user but not
1047 accessible by others (read/write/execute).
1048 Note that
1049 .Nm
1050 ignores a private key file if it is accessible by others.
1051 It is possible to specify a passphrase when
1052 generating the key; the passphrase will be used to encrypt the
1053 sensitive part of this file using 3DES.
1054 .It Pa $HOME/.ssh/identity.pub, $HOME/.ssh/id_dsa.pub
1055 Contains the public key for authentication (public part of the
1056 identity file in human-readable form).
1057 The contents of the
1058 .Pa $HOME/.ssh/identity.pub
1059 file should be added to
1060 .Pa $HOME/.ssh/authorized_keys
1061 on all machines
1062 where you wish to log in using RSA authentication.
1063 The contents of the
1064 .Pa $HOME/.ssh/id_dsa.pub
1065 file should be added to
1066 .Pa $HOME/.ssh/authorized_keys2
1067 on all machines
1068 where you wish to log in using DSA authentication.
1069 These files are not
1070 sensitive and can (but need not) be readable by anyone.
1071 These files are
1072 never used automatically and are not necessary; they is only provided for
1073 the convenience of the user.
1074 .It Pa $HOME/.ssh/config
1075 This is the per-user configuration file.
1076 The format of this file is described above.
1077 This file is used by the
1078 .Nm
1079 client.
1080 This file does not usually contain any sensitive information,
1081 but the recommended permissions are read/write for the user, and not
1082 accessible by others.
1083 .It Pa $HOME/.ssh/authorized_keys
1084 Lists the RSA keys that can be used for logging in as this user.
1085 The format of this file is described in the
1086 .Xr sshd 8
1087 manual page.
1088 In the simplest form the format is the same as the .pub
1089 identity files (that is, each line contains the number of bits in
1090 modulus, public exponent, modulus, and comment fields, separated by
1091 spaces).
1092 This file is not highly sensitive, but the recommended
1093 permissions are read/write for the user, and not accessible by others.
1094 .It Pa $HOME/.ssh/authorized_keys2
1095 Lists the DSA keys that can be used for logging in as this user.
1096 This file is not highly sensitive, but the recommended
1097 permissions are read/write for the user, and not accessible by others.
1098 .It Pa /etc/ssh_known_hosts, /etc/ssh_known_hosts2
1099 Systemwide list of known host keys.
1100 .Pa /etc/ssh_known_hosts
1101 contains RSA and
1102 .Pa /etc/ssh_known_hosts2
1103 contains DSA keys.
1104 These files should be prepared by the
1105 system administrator to contain the public host keys of all machines in the
1106 organization.
1107 This file should be world-readable.
1108 This file contains
1109 public keys, one per line, in the following format (fields separated
1110 by spaces): system name, number of bits in modulus, public exponent,
1111 modulus, and optional comment field.
1112 When different names are used
1113 for the same machine, all such names should be listed, separated by
1114 commas.
1115 The format is described on the
1116 .Xr sshd 8
1117 manual page.
1118 .Pp
1119 The canonical system name (as returned by name servers) is used by
1120 .Xr sshd 8
1121 to verify the client host when logging in; other names are needed because
1122 .Nm
1123 does not convert the user-supplied name to a canonical name before
1124 checking the key, because someone with access to the name servers
1125 would then be able to fool host authentication.
1126 .It Pa /etc/ssh_config
1127 Systemwide configuration file.
1128 This file provides defaults for those
1129 values that are not specified in the user's configuration file, and
1130 for those users who do not have a configuration file.
1131 This file must be world-readable.
1132 .It Pa $HOME/.rhosts
1133 This file is used in
1134 .Pa \&.rhosts
1135 authentication to list the
1136 host/user pairs that are permitted to log in.
1137 (Note that this file is
1138 also used by rlogin and rsh, which makes using this file insecure.)
1139 Each line of the file contains a host name (in the canonical form
1140 returned by name servers), and then a user name on that host,
1141 separated by a space.
1142 One some machines this file may need to be
1143 world-readable if the user's home directory is on a NFS partition,
1144 because
1145 .Xr sshd 8
1146 reads it as root.
1147 Additionally, this file must be owned by the user,
1148 and must not have write permissions for anyone else.
1149 The recommended
1150 permission for most machines is read/write for the user, and not
1151 accessible by others.
1152 .Pp
1153 Note that by default
1154 .Xr sshd 8
1155 will be installed so that it requires successful RSA host
1156 authentication before permitting \s+2.\s0rhosts authentication.
1157 If your server machine does not have the client's host key in
1158 .Pa /etc/ssh_known_hosts ,
1159 you can store it in
1160 .Pa $HOME/.ssh/known_hosts .
1161 The easiest way to do this is to
1162 connect back to the client from the server machine using ssh; this
1163 will automatically add the host key to
1164 .Pa $HOME/.ssh/known_hosts .
1165 .It Pa $HOME/.shosts
1166 This file is used exactly the same way as
1167 .Pa \&.rhosts .
1168 The purpose for
1169 having this file is to be able to use rhosts authentication with
1170 .Nm
1171 without permitting login with
1172 .Xr rlogin 1
1173 or
1174 .Xr rsh 1 .
1175 .It Pa /etc/hosts.equiv
1176 This file is used during
1177 .Pa \&.rhosts authentication.
1178 It contains
1179 canonical hosts names, one per line (the full format is described on
1180 the
1181 .Xr sshd 8
1182 manual page).
1183 If the client host is found in this file, login is
1184 automatically permitted provided client and server user names are the
1185 same.
1186 Additionally, successful RSA host authentication is normally
1187 required.
1188 This file should only be writable by root.
1189 .It Pa /etc/shosts.equiv
1190 This file is processed exactly as
1191 .Pa /etc/hosts.equiv .
1192 This file may be useful to permit logins using
1193 .Nm
1194 but not using rsh/rlogin.
1195 .It Pa /etc/sshrc
1196 Commands in this file are executed by
1197 .Nm
1198 when the user logs in just before the user's shell (or command) is started.
1199 See the
1200 .Xr sshd 8
1201 manual page for more information.
1202 .It Pa $HOME/.ssh/rc
1203 Commands in this file are executed by
1204 .Nm
1205 when the user logs in just before the user's shell (or command) is
1206 started.
1207 See the
1208 .Xr sshd 8
1209 manual page for more information.
1210 .It Pa $HOME/.ssh/environment
1211 Contains additional definitions for environment variables, see section
1212 .Sx ENVIRONMENT
1213 above.
1214 .It Pa libcrypto.so.X.1
1215 A version of this library which includes support for the RSA algorithm
1216 is required for proper operation.
1217 .El
1218 .Sh AUTHOR
1219 OpenSSH
1220 is a derivative of the original (free) ssh 1.2.12 release by Tatu Ylonen,
1221 but with bugs removed and newer features re-added.
1222 Rapidly after the
1223 1.2.12 release, newer versions of the original ssh bore successively
1224 more restrictive licenses, and thus demand for a free version was born.
1225 .Pp
1226 This version of OpenSSH
1227 .Bl -bullet
1228 .It
1229 has all components of a restrictive nature (i.e., patents, see
1230 .Xr crypto 3 )
1231 directly removed from the source code; any licensed or patented components
1232 are chosen from
1233 external libraries.
1234 .It
1235 has been updated to support SSH protocol 1.5 and 2, making it compatible with
1236 all other SSH clients and servers.
1237 .It
1238 contains added support for
1239 .Xr kerberos 8
1240 authentication and ticket passing.
1241 .It
1242 supports one-time password authentication with
1243 .Xr skey 1 .
1244 .El
1245 .Pp
1246 OpenSSH has been created by Aaron Campbell, Bob Beck, Markus Friedl,
1247 Niels Provos, Theo de Raadt, and Dug Song.
1248 .Pp
1249 The support for SSH protocol 2 was written by Markus Friedl.
1250 .Sh SEE ALSO
1251 .Xr rlogin 1 ,
1252 .Xr rsh 1 ,
1253 .Xr scp 1 ,
1254 .Xr ssh-add 1 ,
1255 .Xr ssh-agent 1 ,
1256 .Xr ssh-keygen 1 ,
1257 .Xr telnet 1 ,
1258 .Xr sshd 8 ,
1259 .Xr crypto 3
This page took 0.231096 seconds and 5 git commands to generate.