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