]> andersk Git - openssh.git/blob - ssh.1
- Merged OpenBSD updates to include paths.
[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 afgknqtvxCPX46
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 4
459 Forces
460 .Nm
461 to use IPv4 addresses only.
462 .It Fl 6
463 Forces
464 .Nm
465 to use IPv6 addresses only.
466 .El
467 .Sh CONFIGURATION FILES
468 .Nm
469 obtains configuration data from the following sources (in this order):
470 command line options, user's configuration file
471 .Pq Pa $HOME/.ssh/config ,
472 and system-wide configuration file
473 .Pq Pa /etc/ssh_config .
474 For each parameter, the first obtained value
475 will be used.
476 The configuration files contain sections bracketed by
477 .Dq Host
478 specifications, and that section is only applied for hosts that
479 match one of the patterns given in the specification.
480 The matched host name is the one given on the command line.
481 .Pp
482 Since the first obtained value for each parameter is used, more
483 host-specific declarations should be given near the beginning of the
484 file, and general defaults at the end.
485 .Pp
486 The configuration file has the following format:
487 .Pp
488 Empty lines and lines starting with
489 .Ql #
490 are comments.
491 .Pp
492 Otherwise a line is of the format
493 .Dq keyword arguments .
494 The possible
495 keywords and their meanings are as follows (note that the
496 configuration files are case-sensitive):
497 .Bl -tag -width Ds
498 .It Cm Host
499 Restricts the following declarations (up to the next
500 .Cm Host
501 keyword) to be only for those hosts that match one of the patterns
502 given after the keyword.
503 .Ql \&*
504 and
505 .Ql ?
506 can be used as wildcards in the
507 patterns.
508 A single
509 .Ql \&*
510 as a pattern can be used to provide global
511 defaults for all hosts.
512 The host is the
513 .Ar hostname
514 argument given on the command line (i.e., the name is not converted to
515 a canonicalized host name before matching).
516 .It Cm AFSTokenPassing
517 Specifies whether to pass AFS tokens to remote host.
518 The argument to this keyword must be
519 .Dq yes
520 or
521 .Dq no .
522 .It Cm BatchMode
523 If set to
524 .Dq yes ,
525 passphrase/password querying will be disabled.
526 This option is useful in scripts and other batch jobs where you have no
527 user to supply the password.
528 The argument must be
529 .Dq yes
530 or
531 .Dq no .
532 .It Cm CheckHostIP
533 If this flag is set to
534 .Dq yes ,
535 ssh will additionally check the host ip address in the
536 .Pa known_hosts
537 file.
538 This allows ssh to detect if a host key changed due to DNS spoofing.
539 If the option is set to
540 .Dq no ,
541 the check will not be executed.
542 .It Cm Cipher
543 Specifies the cipher to use for encrypting the session.
544 Currently,
545 .Dq blowfish ,
546 and
547 .Dq 3des
548 are supported.
549 The default is
550 .Dq 3des .
551 .It Cm Ciphers
552 Specifies the ciphers allowed for protocol version 2
553 in order of preference.
554 Multiple ciphers must be comma-separated.
555 The default is
556 .Dq blowfish-cbc,3des-cbc,arcfour,cast128-cbc .
557 .It Cm Compression
558 Specifies whether to use compression.
559 The argument must be
560 .Dq yes
561 or
562 .Dq no .
563 .It Cm CompressionLevel
564 Specifies the compression level to use if compression is enable.
565 The argument must be an integer from 1 (fast) to 9 (slow, best).
566 The default level is 6, which is good for most applications.
567 The meaning of the values is the same as in
568 .Xr gzip 1 .
569 .It Cm ConnectionAttempts
570 Specifies the number of tries (one per second) to make before falling
571 back to rsh or exiting.
572 The argument must be an integer.
573 This may be useful in scripts if the connection sometimes fails.
574 .It Cm EscapeChar
575 Sets the escape character (default:
576 .Ql ~ ) .
577 The escape character can also
578 be set on the command line.
579 The argument should be a single character,
580 .Ql ^
581 followed by a letter, or
582 .Dq none
583 to disable the escape
584 character entirely (making the connection transparent for binary
585 data).
586 .It Cm FallBackToRsh
587 Specifies that if connecting via
588 .Nm
589 fails due to a connection refused error (there is no
590 .Xr sshd 8
591 listening on the remote host),
592 .Xr rsh 1
593 should automatically be used instead (after a suitable warning about
594 the session being unencrypted).
595 The argument must be
596 .Dq yes
597 or
598 .Dq no .
599 .It Cm ForwardAgent
600 Specifies whether the connection to the authentication agent (if any)
601 will be forwarded to the remote machine.
602 The argument must be
603 .Dq yes
604 or
605 .Dq no .
606 .It Cm ForwardX11
607 Specifies whether X11 connections will be automatically redirected
608 over the secure channel and
609 .Ev DISPLAY
610 set.
611 The argument must be
612 .Dq yes
613 or
614 .Dq no .
615 The default is
616 .Dq no .
617 .It Cm GatewayPorts
618 Specifies whether remote hosts are allowed to connect to local
619 forwarded ports.
620 The argument must be
621 .Dq yes
622 or
623 .Dq no .
624 The default is
625 .Dq no .
626 .It Cm GlobalKnownHostsFile
627 Specifies a file to use instead of
628 .Pa /etc/ssh_known_hosts .
629 .It Cm HostName
630 Specifies the real host name to log into.
631 This can be used to specify nicknames or abbreviations for hosts.
632 Default is the name given on the command line.
633 Numeric IP addresses are also permitted (both on the command line and in
634 .Cm HostName
635 specifications).
636 .It Cm IdentityFile
637 Specifies the file from which the user's RSA authentication identity
638 is read (default
639 .Pa .ssh/identity
640 in the user's home directory).
641 Additionally, any identities represented by the authentication agent
642 will be used for authentication.
643 The file name may use the tilde
644 syntax to refer to a user's home directory.
645 It is possible to have
646 multiple identity files specified in configuration files; all these
647 identities will be tried in sequence.
648 .It Cm KeepAlive
649 Specifies whether the system should send keepalive messages to the
650 other side.
651 If they are sent, death of the connection or crash of one
652 of the machines will be properly noticed.
653 However, this means that
654 connections will die if the route is down temporarily, and some people
655 find it annoying.
656 .Pp
657 The default is
658 .Dq yes
659 (to send keepalives), and the client will notice
660 if the network goes down or the remote host dies.
661 This is important in scripts, and many users want it too.
662 .Pp
663 To disable keepalives, the value should be set to
664 .Dq no
665 in both the server and the client configuration files.
666 .It Cm KerberosAuthentication
667 Specifies whether Kerberos authentication will be used.
668 The argument to this keyword must be
669 .Dq yes
670 or
671 .Dq no .
672 .It Cm KerberosTgtPassing
673 Specifies whether a Kerberos TGT will be forwarded to the server.
674 This will only work if the Kerberos server is actually an AFS kaserver.
675 The argument to this keyword must be
676 .Dq yes
677 or
678 .Dq no .
679 .It Cm LocalForward
680 Specifies that a TCP/IP port on the local machine be forwarded over
681 the secure channel to given host:port from the remote machine.
682 The first argument must be a port number, and the second must be
683 host:port.
684 Multiple forwardings may be specified, and additional
685 forwardings can be given on the command line.
686 Only the superuser can forward privileged ports.
687 .It Cm LogLevel
688 Gives the verbosity level that is used when logging messages from
689 .Nm ssh .
690 The possible values are:
691 QUIET, FATAL, ERROR, INFO, VERBOSE and DEBUG.
692 The default is INFO.
693 .It Cm NumberOfPasswordPrompts
694 Specifies the number of password prompts before giving up.
695 The argument to this keyword must be an integer.
696 Default is 3.
697 .It Cm PasswordAuthentication
698 Specifies whether to use password authentication.
699 The argument to this keyword must be
700 .Dq yes
701 or
702 .Dq no .
703 .It Cm Port
704 Specifies the port number to connect on the remote host.
705 Default is 22.
706 .It Cm Protocol
707 Specifies the protocol versions
708 .Nm
709 should support in order of preference.
710 The possible values are
711 .Dq 1
712 and
713 .Dq 2 .
714 Multiple versions must be comma-separated.
715 The default is
716 .Dq 1 .
717 .It Cm ProxyCommand
718 Specifies the command to use to connect to the server.
719 The command
720 string extends to the end of the line, and is executed with
721 .Pa /bin/sh .
722 In the command string,
723 .Ql %h
724 will be substituted by the host name to
725 connect and
726 .Ql %p
727 by the port.
728 The command can be basically anything,
729 and should read from its standard input and write to its standard output.
730 It should eventually connect an
731 .Xr sshd 8
732 server running on some machine, or execute
733 .Ic sshd -i
734 somewhere.
735 Host key management will be done using the
736 HostName of the host being connected (defaulting to the name typed by
737 the user).
738 Note that
739 .Cm CheckHostIP
740 is not available for connects with a proxy command.
741 .Pp
742 .It Cm RemoteForward
743 Specifies that a TCP/IP port on the remote machine be forwarded over
744 the secure channel to given host:port from the local machine.
745 The first argument must be a port number, and the second must be
746 host:port.
747 Multiple forwardings may be specified, and additional
748 forwardings can be given on the command line.
749 Only the superuser can forward privileged ports.
750 .It Cm RhostsAuthentication
751 Specifies whether to try rhosts based authentication.
752 Note that this
753 declaration only affects the client side and has no effect whatsoever
754 on security.
755 Disabling rhosts authentication may reduce
756 authentication time on slow connections when rhosts authentication is
757 not used.
758 Most servers do not permit RhostsAuthentication because it
759 is not secure (see RhostsRSAAuthentication).
760 The argument to this keyword must be
761 .Dq yes
762 or
763 .Dq no .
764 .It Cm RhostsRSAAuthentication
765 Specifies whether to try rhosts based authentication with RSA host
766 authentication.
767 This is the primary authentication method for most sites.
768 The argument must be
769 .Dq yes
770 or
771 .Dq no .
772 .It Cm RSAAuthentication
773 Specifies whether to try RSA authentication.
774 The argument to this keyword must be
775 .Dq yes
776 or
777 .Dq no .
778 RSA authentication will only be
779 attempted if the identity file exists, or an authentication agent is
780 running.
781 .It Cm SkeyAuthentication
782 Specifies whether to use
783 .Xr skey 1
784 authentication.
785 The argument to this keyword must be
786 .Dq yes
787 or
788 .Dq no .
789 The default is
790 .Dq no .
791 .It Cm StrictHostKeyChecking
792 If this flag is set to
793 .Dq yes ,
794 .Nm
795 ssh will never automatically add host keys to the
796 .Pa $HOME/.ssh/known_hosts
797 file, and refuses to connect hosts whose host key has changed.
798 This provides maximum protection against trojan horse attacks.
799 However, it can be somewhat annoying if you don't have good
800 .Pa /etc/ssh_known_hosts
801 files installed and frequently
802 connect new hosts.
803 Basically this option forces the user to manually
804 add any new hosts.
805 Normally this option is disabled, and new hosts
806 will automatically be added to the known host files.
807 The host keys of
808 known hosts will be verified automatically in either case.
809 The argument must be
810 .Dq yes
811 or
812 .Dq no .
813 .It Cm UsePrivilegedPort
814 Specifies whether to use a privileged port for outgoing connections.
815 The argument must be
816 .Dq yes
817 or
818 .Dq no .
819 The default is
820 .Dq yes .
821 Note that setting this option to
822 .Dq no
823 turns off
824 .Cm RhostsAuthentication
825 and
826 .Cm RhostsRSAAuthentication .
827 .It Cm User
828 Specifies the user to log in as.
829 This can be useful if you have a different user name on different machines.
830 This saves the trouble of
831 having to remember to give the user name on the command line.
832 .It Cm UserKnownHostsFile
833 Specifies a file to use instead of
834 .Pa $HOME/.ssh/known_hosts .
835 .It Cm UseRsh
836 Specifies that rlogin/rsh should be used for this host.
837 It is possible that the host does not at all support the
838 .Nm
839 protocol.
840 This causes
841 .Nm
842 to immediately execute
843 .Xr rsh 1 .
844 All other options (except
845 .Cm HostName )
846 are ignored if this has been specified.
847 The argument must be
848 .Dq yes
849 or
850 .Dq no .
851 .Sh ENVIRONMENT
852 .Nm
853 will normally set the following environment variables:
854 .Bl -tag -width Ds
855 .It Ev DISPLAY
856 The
857 .Ev DISPLAY
858 variable indicates the location of the X11 server.
859 It is automatically set by
860 .Nm
861 to point to a value of the form
862 .Dq hostname:n
863 where hostname indicates
864 the host where the shell runs, and n is an integer >= 1.
865 .Nm
866 uses this special value to forward X11 connections over the secure
867 channel.
868 The user should normally not set DISPLAY explicitly, as that
869 will render the X11 connection insecure (and will require the user to
870 manually copy any required authorization cookies).
871 .It Ev HOME
872 Set to the path of the user's home directory.
873 .It Ev LOGNAME
874 Synonym for
875 .Ev USER ;
876 set for compatibility with systems that use this variable.
877 .It Ev MAIL
878 Set to point the user's mailbox.
879 .It Ev PATH
880 Set to the default
881 .Ev PATH ,
882 as specified when compiling
883 .Nm ssh .
884 .It Ev SSH_AUTH_SOCK
885 indicates the path of a unix-domain socket used to communicate with the
886 agent.
887 .It Ev SSH_CLIENT
888 Identifies the client end of the connection.
889 The variable contains
890 three space-separated values: client ip-address, client port number,
891 and server port number.
892 .It Ev SSH_TTY
893 This is set to the name of the tty (path to the device) associated
894 with the current shell or command.
895 If the current session has no tty,
896 this variable is not set.
897 .It Ev TZ
898 The timezone variable is set to indicate the present timezone if it
899 was set when the daemon was started (e.i., the daemon passes the value
900 on to new connections).
901 .It Ev USER
902 Set to the name of the user logging in.
903 .El
904 .Pp
905 Additionally,
906 .Nm
907 reads
908 .Pa $HOME/.ssh/environment ,
909 and adds lines of the format
910 .Dq VARNAME=value
911 to the environment.
912 .Sh FILES
913 .Bl -tag -width Ds
914 .It Pa $HOME/.ssh/known_hosts
915 Records host keys for all hosts the user has logged into (that are not
916 in
917 .Pa /etc/ssh_known_hosts ) .
918 See
919 .Xr sshd 8 .
920 .It Pa $HOME/.ssh/identity
921 Contains the RSA authentication identity of the user.
922 This file
923 contains sensitive data and should be readable by the user but not
924 accessible by others (read/write/execute).
925 Note that
926 .Nm
927 ignores this file if it is accessible by others.
928 It is possible to specify a passphrase when
929 generating the key; the passphrase will be used to encrypt the
930 sensitive part of this file using 3DES.
931 .It Pa $HOME/.ssh/identity.pub
932 Contains the public key for authentication (public part of the
933 identity file in human-readable form).
934 The contents of this file should be added to
935 .Pa $HOME/.ssh/authorized_keys
936 on all machines
937 where you wish to log in using RSA authentication.
938 This file is not
939 sensitive and can (but need not) be readable by anyone.
940 This file is
941 never used automatically and is not necessary; it is only provided for
942 the convenience of the user.
943 .It Pa $HOME/.ssh/config
944 This is the per-user configuration file.
945 The format of this file is described above.
946 This file is used by the
947 .Nm
948 client.
949 This file does not usually contain any sensitive information,
950 but the recommended permissions are read/write for the user, and not
951 accessible by others.
952 .It Pa $HOME/.ssh/authorized_keys
953 Lists the RSA keys that can be used for logging in as this user.
954 The format of this file is described in the
955 .Xr sshd 8
956 manual page.
957 In the simplest form the format is the same as the .pub
958 identity files (that is, each line contains the number of bits in
959 modulus, public exponent, modulus, and comment fields, separated by
960 spaces).
961 This file is not highly sensitive, but the recommended
962 permissions are read/write for the user, and not accessible by others.
963 .It Pa /etc/ssh_known_hosts
964 Systemwide list of known host keys.
965 This file should be prepared by the
966 system administrator to contain the public host keys of all machines in the
967 organization.
968 This file should be world-readable.
969 This file contains
970 public keys, one per line, in the following format (fields separated
971 by spaces): system name, number of bits in modulus, public exponent,
972 modulus, and optional comment field.
973 When different names are used
974 for the same machine, all such names should be listed, separated by
975 commas.
976 The format is described on the
977 .Xr sshd 8
978 manual page.
979 .Pp
980 The canonical system name (as returned by name servers) is used by
981 .Xr sshd 8
982 to verify the client host when logging in; other names are needed because
983 .Nm
984 does not convert the user-supplied name to a canonical name before
985 checking the key, because someone with access to the name servers
986 would then be able to fool host authentication.
987 .It Pa /etc/ssh_config
988 Systemwide configuration file.
989 This file provides defaults for those
990 values that are not specified in the user's configuration file, and
991 for those users who do not have a configuration file.
992 This file must be world-readable.
993 .It Pa $HOME/.rhosts
994 This file is used in
995 .Pa \&.rhosts
996 authentication to list the
997 host/user pairs that are permitted to log in.
998 (Note that this file is
999 also used by rlogin and rsh, which makes using this file insecure.)
1000 Each line of the file contains a host name (in the canonical form
1001 returned by name servers), and then a user name on that host,
1002 separated by a space.
1003 One some machines this file may need to be
1004 world-readable if the user's home directory is on a NFS partition,
1005 because
1006 .Xr sshd 8
1007 reads it as root.
1008 Additionally, this file must be owned by the user,
1009 and must not have write permissions for anyone else.
1010 The recommended
1011 permission for most machines is read/write for the user, and not
1012 accessible by others.
1013 .Pp
1014 Note that by default
1015 .Xr sshd 8
1016 will be installed so that it requires successful RSA host
1017 authentication before permitting \s+2.\s0rhosts authentication.
1018 If your server machine does not have the client's host key in
1019 .Pa /etc/ssh_known_hosts ,
1020 you can store it in
1021 .Pa $HOME/.ssh/known_hosts .
1022 The easiest way to do this is to
1023 connect back to the client from the server machine using ssh; this
1024 will automatically add the host key inxi
1025 .Pa $HOME/.ssh/known_hosts .
1026 .It Pa $HOME/.shosts
1027 This file is used exactly the same way as
1028 .Pa \&.rhosts .
1029 The purpose for
1030 having this file is to be able to use rhosts authentication with
1031 .Nm
1032 without permitting login with
1033 .Xr rlogin 1
1034 or
1035 .Xr rsh 1 .
1036 .It Pa /etc/hosts.equiv
1037 This file is used during
1038 .Pa \&.rhosts authentication.
1039 It contains
1040 canonical hosts names, one per line (the full format is described on
1041 the
1042 .Xr sshd 8
1043 manual page).
1044 If the client host is found in this file, login is
1045 automatically permitted provided client and server user names are the
1046 same.
1047 Additionally, successful RSA host authentication is normally
1048 required.
1049 This file should only be writable by root.
1050 .It Pa /etc/shosts.equiv
1051 This file is processed exactly as
1052 .Pa /etc/hosts.equiv .
1053 This file may be useful to permit logins using
1054 .Nm
1055 but not using rsh/rlogin.
1056 .It Pa /etc/sshrc
1057 Commands in this file are executed by
1058 .Nm
1059 when the user logs in just before the user's shell (or command) is started.
1060 See the
1061 .Xr sshd 8
1062 manual page for more information.
1063 .It Pa $HOME/.ssh/rc
1064 Commands in this file are executed by
1065 .Nm
1066 when the user logs in just before the user's shell (or command) is
1067 started.
1068 See the
1069 .Xr sshd 8
1070 manual page for more information.
1071 .It Pa $HOME/.ssh/environment
1072 Contains additional definitions for environment variables, see section
1073 .Sx ENVIRONMENT
1074 above.
1075 .It Pa libcrypto.so.X.1
1076 A version of this library which includes support for the RSA algorithm
1077 is required for proper operation.
1078 .Sh AUTHOR
1079 OpenSSH
1080 is a derivative of the original (free) ssh 1.2.12 release by Tatu Ylonen,
1081 but with bugs removed and newer features re-added.
1082 Rapidly after the
1083 1.2.12 release, newer versions of the original ssh bore successively
1084 more restrictive licenses, and thus demand for a free version was born.
1085 This version of OpenSSH
1086 .Bl -bullet
1087 .It
1088 has all components of a restrictive nature (i.e., patents, see
1089 .Xr ssl 8 )
1090 directly removed from the source code; any licensed or patented components
1091 are chosen from
1092 external libraries.
1093 .It
1094 has been updated to support ssh protocol 1.5, making it compatible with
1095 all other ssh protocol 1 clients and servers.
1096 .It
1097 contains added support for
1098 .Xr kerberos 8
1099 authentication and ticket passing.
1100 .It
1101 supports one-time password authentication with
1102 .Xr skey 1 .
1103 .El
1104 .Pp
1105 The libraries described in
1106 .Xr ssl 8
1107 are required for proper operation.
1108 .Pp
1109 OpenSSH has been created by Aaron Campbell, Bob Beck, Markus Friedl,
1110 Niels Provos, Theo de Raadt, and Dug Song.
1111 .Sh SEE ALSO
1112 .Xr rlogin 1 ,
1113 .Xr rsh 1 ,
1114 .Xr scp 1 ,
1115 .Xr ssh-add 1 ,
1116 .Xr ssh-agent 1 ,
1117 .Xr ssh-keygen 1 ,
1118 .Xr telnet 1 ,
1119 .Xr sshd 8 ,
1120 .Xr ssl 8
This page took 0.14002 seconds and 5 git commands to generate.