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