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