blob: 48040c439ce92f03d153cf7569943342c344bae0 [file] [log] [blame]
Damien Miller32aa1441999-10-29 09:15:49 +10001.\" -*- 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.\"
Damien Miller30c3d422000-05-09 11:02:59 +100012.\" $Id: ssh.1,v 1.25 2000/05/09 01:03:02 damien Exp $
Damien Miller32aa1441999-10-29 09:15:49 +100013.\"
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
Damien Miller4af51302000-04-16 11:18:38 +100027.Op Fl afgknqtvxCPX246
Damien Miller30c3d422000-05-09 11:02:59 +100028.Op Fl c Ar cipher_spec
Damien Miller32aa1441999-10-29 09:15:49 +100029.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
Damien Miller32aa1441999-10-29 09:15:49 +100036.Ar port :
Damien Miller396691a2000-01-20 22:44:08 +110037.Ar host :
Damien Miller32aa1441999-10-29 09:15:49 +100038.Ar hostport
39.Sm on
40.Xc
41.Oc
42.Oo Fl R Xo
43.Sm off
Damien Miller32aa1441999-10-29 09:15:49 +100044.Ar port :
Damien Miller396691a2000-01-20 22:44:08 +110045.Ar host :
Damien Miller32aa1441999-10-29 09:15:49 +100046.Ar hostport
47.Sm on
48.Xc
49.Oc
50.Op Ar hostname | user@hostname
51.Op Ar command
Damien Miller22c77262000-04-13 12:26:34 +100052.Sh DESCRIPTION
Damien Miller32aa1441999-10-29 09:15:49 +100053.Nm
54(Secure Shell) is a program for logging into a remote machine and for
Damien Miller7684ee12000-03-17 23:40:15 +110055executing commands on a remote machine.
56It is intended to replace
Damien Miller32aa1441999-10-29 09:15:49 +100057rlogin and rsh, and provide secure encrypted communications between
Damien Miller7684ee12000-03-17 23:40:15 +110058two untrusted hosts over an insecure network.
59X11 connections and
Damien Miller32aa1441999-10-29 09:15:49 +100060arbitrary TCP/IP ports can also be forwarded over the secure channel.
61.Pp
62.Nm
Damien Miller22c77262000-04-13 12:26:34 +100063connects and logs into the specified
Damien Miller32aa1441999-10-29 09:15:49 +100064.Ar hostname .
65The user must prove
Damien Millere247cc42000-05-07 12:03:14 +100066his/her identity to the remote machine using one of several methods
67depending on the protocol version used:
68.Pp
69.Ss SSH protocol version 1
Damien Miller32aa1441999-10-29 09:15:49 +100070.Pp
71First, if the machine the user logs in from is listed in
72.Pa /etc/hosts.equiv
73or
Damien Miller886c63a2000-01-20 23:13:36 +110074.Pa /etc/shosts.equiv
Damien Miller32aa1441999-10-29 09:15:49 +100075on the remote machine, and the user names are
76the same on both sides, the user is immediately permitted to log in.
Damien Miller22c77262000-04-13 12:26:34 +100077Second, if
Damien Miller32aa1441999-10-29 09:15:49 +100078.Pa \&.rhosts
79or
80.Pa \&.shosts
81exists in the user's home directory on the
82remote machine and contains a line containing the name of the client
83machine and the name of the user on that machine, the user is
Damien Miller7684ee12000-03-17 23:40:15 +110084permitted to log in.
85This form of authentication alone is normally not
Damien Miller32aa1441999-10-29 09:15:49 +100086allowed by the server because it is not secure.
87.Pp
88The second (and primary) authentication method is the
89.Pa rhosts
90or
91.Pa hosts.equiv
Damien Miller7684ee12000-03-17 23:40:15 +110092method combined with RSA-based host authentication.
93It means that if the login would be permitted by
Damien Millere247cc42000-05-07 12:03:14 +100094.Pa $HOME/.rhosts ,
95.Pa $HOME/.shosts ,
Damien Miller32aa1441999-10-29 09:15:49 +100096.Pa /etc/hosts.equiv ,
97or
Damien Miller886c63a2000-01-20 23:13:36 +110098.Pa /etc/shosts.equiv ,
Damien Miller32aa1441999-10-29 09:15:49 +100099and if additionally the server can verify the client's
Damien Miller22c77262000-04-13 12:26:34 +1000100host key (see
Damien Miller886c63a2000-01-20 23:13:36 +1100101.Pa /etc/ssh_known_hosts
Damien Miller33e511e1999-11-11 11:43:13 +1100102and
103.Pa $HOME/.ssh/known_hosts
Damien Miller32aa1441999-10-29 09:15:49 +1000104in the
105.Sx FILES
Damien Miller7684ee12000-03-17 23:40:15 +1100106section), only then login is permitted.
107This authentication method closes security holes due to IP
108spoofing, DNS spoofing and routing spoofing.
109[Note to the administrator:
Damien Miller32aa1441999-10-29 09:15:49 +1000110.Pa /etc/hosts.equiv ,
Damien Millere247cc42000-05-07 12:03:14 +1000111.Pa $HOME/.rhosts ,
Damien Miller32aa1441999-10-29 09:15:49 +1000112and the rlogin/rsh protocol in general, are inherently insecure and should be
113disabled if security is desired.]
114.Pp
Damien Miller22c77262000-04-13 12:26:34 +1000115As a third authentication method,
Damien Miller32aa1441999-10-29 09:15:49 +1000116.Nm
117supports RSA based authentication.
118The scheme is based on public-key cryptography: there are cryptosystems
119where encryption and decryption are done using separate keys, and it
120is not possible to derive the decryption key from the encryption key.
Damien Miller7684ee12000-03-17 23:40:15 +1100121RSA is one such system.
Damien Miller22c77262000-04-13 12:26:34 +1000122The idea is that each user creates a public/private
Damien Miller7684ee12000-03-17 23:40:15 +1100123key pair for authentication purposes.
124The server knows the public key, and only the user knows the private key.
Damien Miller22c77262000-04-13 12:26:34 +1000125The file
Damien Miller32aa1441999-10-29 09:15:49 +1000126.Pa $HOME/.ssh/authorized_keys
127lists the public keys that are permitted for logging
Damien Miller7684ee12000-03-17 23:40:15 +1100128in.
129When the user logs in, the
Damien Miller32aa1441999-10-29 09:15:49 +1000130.Nm
131program tells the server which key pair it would like to use for
Damien Miller7684ee12000-03-17 23:40:15 +1100132authentication.
133The server checks if this key is permitted, and if
Damien Miller32aa1441999-10-29 09:15:49 +1000134so, sends the user (actually the
135.Nm
136program running on behalf of the user) a challenge, a random number,
Damien Miller7684ee12000-03-17 23:40:15 +1100137encrypted by the user's public key.
138The challenge can only be
139decrypted using the proper private key.
140The user's client then decrypts the
Damien Miller32aa1441999-10-29 09:15:49 +1000141challenge using the private key, proving that he/she knows the private
142key but without disclosing it to the server.
143.Pp
144.Nm
Damien Miller7684ee12000-03-17 23:40:15 +1100145implements the RSA authentication protocol automatically.
146The user creates his/her RSA key pair by running
Damien Miller32aa1441999-10-29 09:15:49 +1000147.Xr ssh-keygen 1 .
Damien Miller22c77262000-04-13 12:26:34 +1000148This stores the private key in
Damien Millere247cc42000-05-07 12:03:14 +1000149.Pa $HOME/.ssh/identity
Damien Miller32aa1441999-10-29 09:15:49 +1000150and the public key in
Damien Millere247cc42000-05-07 12:03:14 +1000151.Pa $HOME/.ssh/identity.pub
Damien Miller7684ee12000-03-17 23:40:15 +1100152in the user's home directory.
153The user should then copy the
Damien Miller32aa1441999-10-29 09:15:49 +1000154.Pa identity.pub
Damien Miller22c77262000-04-13 12:26:34 +1000155to
Damien Millere247cc42000-05-07 12:03:14 +1000156.Pa $HOME/.ssh/authorized_keys
Damien Miller22c77262000-04-13 12:26:34 +1000157in his/her home directory on the remote machine (the
Damien Miller32aa1441999-10-29 09:15:49 +1000158.Pa authorized_keys
Damien Miller22c77262000-04-13 12:26:34 +1000159file corresponds to the conventional
Damien Millere247cc42000-05-07 12:03:14 +1000160.Pa $HOME/.rhosts
Damien Miller32aa1441999-10-29 09:15:49 +1000161file, and has one key
Damien Miller7684ee12000-03-17 23:40:15 +1100162per line, though the lines can be very long).
163After this, the user can log in without giving the password.
164RSA authentication is much
Damien Miller32aa1441999-10-29 09:15:49 +1000165more secure than rhosts authentication.
166.Pp
167The most convenient way to use RSA authentication may be with an
Damien Miller7684ee12000-03-17 23:40:15 +1100168authentication agent.
169See
Damien Miller32aa1441999-10-29 09:15:49 +1000170.Xr ssh-agent 1
171for more information.
172.Pp
Damien Miller22c77262000-04-13 12:26:34 +1000173If other authentication methods fail,
Damien Miller32aa1441999-10-29 09:15:49 +1000174.Nm
Damien Miller7684ee12000-03-17 23:40:15 +1100175prompts the user for a password.
176The password is sent to the remote
Damien Miller32aa1441999-10-29 09:15:49 +1000177host for checking; however, since all communications are encrypted,
178the password cannot be seen by someone listening on the network.
179.Pp
Damien Millere247cc42000-05-07 12:03:14 +1000180.Ss SSH protocol version 2
181.Pp
182When a user connects using the protocol version 2
183different authentication methods are available:
184At first, the client attempts to authenticate using the public key method.
185If this method fails password authentication is tried.
186.Pp
187The public key method is similar to RSA authentication described
188in the previous section except that the DSA algorithm is used
189instead of the patented RSA algorithm.
190The client uses his private DSA key
191.Pa $HOME/.ssh/id_dsa
192to sign the session identifier and sends the result to the server.
193The server checks whether the matching public key is listed in
194.Pa $HOME/.ssh/authorized_keys2
195and grants access if both the key is found and the signature is correct.
196The session identifier is derived from a shared Diffie-Hellman value
197and is only known to the client and the server.
198.Pp
199If public key authentication fails or is not available a password
200can be sent encrypted to the remote host for proving the user's identity.
201This protocol 2 implementation does not yet support Kerberos or
202S/Key authentication.
203.Pp
204Protocol 2 provides additional mechanisms for confidentiality
Damien Miller30c3d422000-05-09 11:02:59 +1000205(the traffic is encrypted using 3DES, Blowfish, CAST128 or Arcfour)
Damien Millere247cc42000-05-07 12:03:14 +1000206and integrity (hmac-sha1, hmac-md5).
207Note that protocol 1 lacks a strong mechanism for ensuring the
208integrity of the connection.
209.Pp
210.Ss Login session and remote execution
211.Pp
Damien Miller32aa1441999-10-29 09:15:49 +1000212When the user's identity has been accepted by the server, the server
213either executes the given command, or logs into the machine and gives
Damien Miller7684ee12000-03-17 23:40:15 +1100214the user a normal shell on the remote machine.
215All communication with
Damien Miller32aa1441999-10-29 09:15:49 +1000216the remote command or shell will be automatically encrypted.
217.Pp
218If a pseudo-terminal has been allocated (normal login session), the
219user can disconnect with
220.Ic ~. ,
221and suspend
222.Nm
223with
224.Ic ~^Z .
225All forwarded connections can be listed with
Damien Miller22c77262000-04-13 12:26:34 +1000226.Ic ~#
Damien Miller32aa1441999-10-29 09:15:49 +1000227and if
228the session blocks waiting for forwarded X11 or TCP/IP
229connections to terminate, it can be backgrounded with
230.Ic ~&
231(this should not be used while the user shell is active, as it can cause the
Damien Miller7684ee12000-03-17 23:40:15 +1100232shell to hang).
233All available escapes can be listed with
Damien Miller32aa1441999-10-29 09:15:49 +1000234.Ic ~? .
235.Pp
236A single tilde character can be sent as
237.Ic ~~
238(or by following the tilde by a character other than those described above).
239The escape character must always follow a newline to be interpreted as
Damien Miller7684ee12000-03-17 23:40:15 +1100240special.
241The escape character can be changed in configuration files
242or on the command line.
Damien Miller32aa1441999-10-29 09:15:49 +1000243.Pp
244If no pseudo tty has been allocated, the
245session is transparent and can be used to reliably transfer binary
Damien Miller7684ee12000-03-17 23:40:15 +1100246data.
247On most systems, setting the escape character to
Damien Miller32aa1441999-10-29 09:15:49 +1000248.Dq none
249will also make the session transparent even if a tty is used.
250.Pp
251The session terminates when the command or shell in on the remote
252machine exists and all X11 and TCP/IP connections have been closed.
253The exit status of the remote program is returned as the exit status
254of
255.Nm ssh .
256.Pp
Damien Millere247cc42000-05-07 12:03:14 +1000257.Ss X11 and TCP forwarding
258.Pp
Damien Miller32aa1441999-10-29 09:15:49 +1000259If the user is using X11 (the
260.Ev DISPLAY
261environment variable is set), the connection to the X11 display is
262automatically forwarded to the remote side in such a way that any X11
263programs started from the shell (or command) will go through the
264encrypted channel, and the connection to the real X server will be made
Damien Miller7684ee12000-03-17 23:40:15 +1100265from the local machine.
266The user should not manually set
Damien Miller32aa1441999-10-29 09:15:49 +1000267.Ev DISPLAY .
268Forwarding of X11 connections can be
269configured on the command line or in configuration files.
270.Pp
271The
Damien Miller22c77262000-04-13 12:26:34 +1000272.Ev DISPLAY
Damien Miller32aa1441999-10-29 09:15:49 +1000273value set by
274.Nm
275will point to the server machine, but with a display number greater
Damien Miller7684ee12000-03-17 23:40:15 +1100276than zero.
277This is normal, and happens because
Damien Miller32aa1441999-10-29 09:15:49 +1000278.Nm
279creates a
280.Dq proxy
281X server on the server machine for forwarding the
282connections over the encrypted channel.
283.Pp
284.Nm
285will also automatically set up Xauthority data on the server machine.
286For this purpose, it will generate a random authorization cookie,
287store it in Xauthority on the server, and verify that any forwarded
288connections carry this cookie and replace it by the real cookie when
Damien Miller7684ee12000-03-17 23:40:15 +1100289the connection is opened.
290The real authentication cookie is never
Damien Miller32aa1441999-10-29 09:15:49 +1000291sent to the server machine (and no cookies are sent in the plain).
292.Pp
293If the user is using an authentication agent, the connection to the agent
294is automatically forwarded to the remote side unless disabled on
295command line or in a configuration file.
296.Pp
297Forwarding of arbitrary TCP/IP connections over the secure channel can
Damien Miller7684ee12000-03-17 23:40:15 +1100298be specified either on command line or in a configuration file.
299One possible application of TCP/IP forwarding is a secure connection to an
Damien Miller32aa1441999-10-29 09:15:49 +1000300electronic purse; another is going trough firewalls.
301.Pp
Damien Millere247cc42000-05-07 12:03:14 +1000302.Ss Server authentication
303.Pp
Damien Miller32aa1441999-10-29 09:15:49 +1000304.Nm
Damien Millere247cc42000-05-07 12:03:14 +1000305automatically maintains and checks a database containing
Damien Miller7684ee12000-03-17 23:40:15 +1100306identifications for all hosts it has ever been used with.
Damien Millere247cc42000-05-07 12:03:14 +1000307RSA host keys are stored in
308.Pa $HOME/.ssh/known_hosts
309and
310DSA host keys are stored in
311.Pa $HOME/.ssh/known_hosts2
Damien Miller7684ee12000-03-17 23:40:15 +1100312in the user's home directory.
Damien Millere247cc42000-05-07 12:03:14 +1000313Additionally, the files
Damien Miller886c63a2000-01-20 23:13:36 +1100314.Pa /etc/ssh_known_hosts
Damien Millere247cc42000-05-07 12:03:14 +1000315and
316.Pa /etc/ssh_known_hosts2
317are automatically checked for known hosts.
Damien Miller7684ee12000-03-17 23:40:15 +1100318Any new hosts are automatically added to the user's file.
319If a host's identification
Damien Miller32aa1441999-10-29 09:15:49 +1000320ever changes,
321.Nm
322warns about this and disables password authentication to prevent a
Damien Miller7684ee12000-03-17 23:40:15 +1100323trojan horse from getting the user's password.
324Another purpose of
Damien Miller32aa1441999-10-29 09:15:49 +1000325this mechanism is to prevent man-in-the-middle attacks which could
Damien Miller7684ee12000-03-17 23:40:15 +1100326otherwise be used to circumvent the encryption.
327The
Damien Miller32aa1441999-10-29 09:15:49 +1000328.Cm StrictHostKeyChecking
329option (see below) can be used to prevent logins to machines whose
330host key is not known or has changed.
331.Sh OPTIONS
332.Bl -tag -width Ds
333.It Fl a
Damien Miller450a7a12000-03-26 13:04:51 +1000334Disables forwarding of the authentication agent connection.
335This may also be specified on a per-host basis in the configuration file.
Damien Miller32aa1441999-10-29 09:15:49 +1000336.It Fl c Ar blowfish|3des
Damien Miller22c77262000-04-13 12:26:34 +1000337Selects the cipher to use for encrypting the session.
Damien Miller32aa1441999-10-29 09:15:49 +1000338.Ar 3des
Damien Miller7684ee12000-03-17 23:40:15 +1100339is used by default.
Damien Miller22c77262000-04-13 12:26:34 +1000340It is believed to be secure.
Damien Miller32aa1441999-10-29 09:15:49 +1000341.Ar 3des
342(triple-des) is an encrypt-decrypt-encrypt triple with three different keys.
343It is presumably more secure than the
344.Ar des
Damien Miller30c3d422000-05-09 11:02:59 +1000345cipher which is no longer supported in
346.Nm ssh .
Damien Miller32aa1441999-10-29 09:15:49 +1000347.Ar blowfish
348is a fast block cipher, it appears very secure and is much faster than
Damien Miller7684ee12000-03-17 23:40:15 +1100349.Ar 3des .
Damien Miller30c3d422000-05-09 11:02:59 +1000350.It Fl c Ar "3des-cbc,blowfish-cbc,arcfour,cast128-cbc"
351Additionally, for protocol version 2 a comma-separated list of ciphers can
352be specified in order of preference. Protocol version 2 supports
3533DES, Blowfish and CAST128 in CBC mode and Arcfour.
Damien Miller32aa1441999-10-29 09:15:49 +1000354.It Fl e Ar ch|^ch|none
355Sets the escape character for sessions with a pty (default:
356.Ql ~ ) .
Damien Miller7684ee12000-03-17 23:40:15 +1100357The escape character is only recognized at the beginning of a line.
358The escape character followed by a dot
Damien Miller32aa1441999-10-29 09:15:49 +1000359.Pq Ql \&.
360closes the connection, followed
361by control-Z suspends the connection, and followed by itself sends the
Damien Miller7684ee12000-03-17 23:40:15 +1100362escape character once.
363Setting the character to
Damien Miller32aa1441999-10-29 09:15:49 +1000364.Dq none
365disables any escapes and makes the session fully transparent.
366.It Fl f
367Requests
368.Nm
Damien Miller7684ee12000-03-17 23:40:15 +1100369to go to background just before command execution.
370This is useful if
Damien Miller32aa1441999-10-29 09:15:49 +1000371.Nm
372is going to ask for passwords or passphrases, but the user
Damien Miller7684ee12000-03-17 23:40:15 +1100373wants it in the background.
Damien Miller22c77262000-04-13 12:26:34 +1000374This implies
Damien Miller32aa1441999-10-29 09:15:49 +1000375.Fl n .
376The recommended way to start X11 programs at a remote site is with
377something like
378.Ic ssh -f host xterm .
Damien Miller396691a2000-01-20 22:44:08 +1100379.It Fl g
380Allows remote hosts to connect to local forwarded ports.
Damien Miller32aa1441999-10-29 09:15:49 +1000381.It Fl i Ar identity_file
Damien Miller22c77262000-04-13 12:26:34 +1000382Selects the file from which the identity (private key) for
Damien Miller7684ee12000-03-17 23:40:15 +1100383RSA authentication is read.
Damien Miller22c77262000-04-13 12:26:34 +1000384Default is
Damien Millere247cc42000-05-07 12:03:14 +1000385.Pa $HOME/.ssh/identity
Damien Miller7684ee12000-03-17 23:40:15 +1100386in the user's home directory.
387Identity files may also be specified on
388a per-host basis in the configuration file.
389It is possible to have multiple
Damien Miller32aa1441999-10-29 09:15:49 +1000390.Fl i
391options (and multiple identities specified in
392configuration files).
Damien Miller32aa1441999-10-29 09:15:49 +1000393.It Fl k
Damien Miller450a7a12000-03-26 13:04:51 +1000394Disables forwarding of Kerberos tickets and AFS tokens.
395This may also be specified on a per-host basis in the configuration file.
Damien Miller32aa1441999-10-29 09:15:49 +1000396.It Fl l Ar login_name
Damien Miller7684ee12000-03-17 23:40:15 +1100397Specifies the user to log in as on the remote machine.
398This also may be specified on a per-host basis in the configuration file.
Damien Miller32aa1441999-10-29 09:15:49 +1000399.It Fl n
400Redirects stdin from
401.Pa /dev/null
402(actually, prevents reading from stdin).
403This must be used when
404.Nm
Damien Miller7684ee12000-03-17 23:40:15 +1100405is run in the background.
406A common trick is to use this to run X11 programs on a remote machine.
407For example,
Damien Miller32aa1441999-10-29 09:15:49 +1000408.Ic ssh -n shadows.cs.hut.fi emacs &
409will start an emacs on shadows.cs.hut.fi, and the X11
410connection will be automatically forwarded over an encrypted channel.
411The
412.Nm
413program will be put in the background.
414(This does not work if
415.Nm
416needs to ask for a password or passphrase; see also the
417.Fl f
418option.)
419.It Fl o Ar option
420Can be used to give options in the format used in the config file.
421This is useful for specifying options for which there is no separate
Damien Miller7684ee12000-03-17 23:40:15 +1100422command-line flag.
423The option has the same format as a line in the configuration file.
Damien Miller32aa1441999-10-29 09:15:49 +1000424.It Fl p Ar port
Damien Miller7684ee12000-03-17 23:40:15 +1100425Port to connect to on the remote host.
426This can be specified on a
Damien Miller32aa1441999-10-29 09:15:49 +1000427per-host basis in the configuration file.
428.It Fl P
429Use a non-privileged port for outgoing connections.
430This can be used if your firewall does
431not permit connections from privileged ports.
Damien Millera34a28b1999-12-14 10:47:15 +1100432Note that this option turns off
Damien Miller32aa1441999-10-29 09:15:49 +1000433.Cm RhostsAuthentication
434and
435.Cm RhostsRSAAuthentication .
436.It Fl q
Damien Miller7684ee12000-03-17 23:40:15 +1100437Quiet mode.
438Causes all warning and diagnostic messages to be suppressed.
439Only fatal errors are displayed.
Damien Miller32aa1441999-10-29 09:15:49 +1000440.It Fl t
Damien Miller7684ee12000-03-17 23:40:15 +1100441Force pseudo-tty allocation.
Damien Miller450a7a12000-03-26 13:04:51 +1000442This can be used to execute arbitrary
Damien Miller7684ee12000-03-17 23:40:15 +1100443screen-based programs on a remote machine, which can be very useful,
444e.g., when implementing menu services.
Damien Miller32aa1441999-10-29 09:15:49 +1000445.It Fl v
Damien Miller7684ee12000-03-17 23:40:15 +1100446Verbose mode.
447Causes
Damien Miller32aa1441999-10-29 09:15:49 +1000448.Nm
Damien Miller7684ee12000-03-17 23:40:15 +1100449to print debugging messages about its progress.
450This is helpful in
Damien Miller32aa1441999-10-29 09:15:49 +1000451debugging connection, authentication, and configuration problems.
452The verbose mode is also used to display
453.Xr skey 1
454challenges, if the user entered "s/key" as password.
455.It Fl x
Damien Miller7684ee12000-03-17 23:40:15 +1100456Disables X11 forwarding.
457This can also be specified on a per-host basis in a configuration file.
Damien Miller32aa1441999-10-29 09:15:49 +1000458.It Fl X
459Enables X11 forwarding.
460.It Fl C
461Requests compression of all data (including stdin, stdout, stderr, and
Damien Miller7684ee12000-03-17 23:40:15 +1100462data for forwarded X11 and TCP/IP connections).
463The compression algorithm is the same used by
Damien Miller396691a2000-01-20 22:44:08 +1100464.Xr gzip 1 ,
465and the
Damien Miller32aa1441999-10-29 09:15:49 +1000466.Dq level
467can be controlled by the
468.Cm CompressionLevel
Damien Miller7684ee12000-03-17 23:40:15 +1100469option (see below).
470Compression is desirable on modem lines and other
Damien Miller32aa1441999-10-29 09:15:49 +1000471slow connections, but will only slow down things on fast networks.
472The default value can be set on a host-by-host basis in the
473configuration files; see the
474.Cm Compress
475option below.
476.It Fl L Ar port:host:hostport
477Specifies that the given port on the local (client) host is to be
Damien Miller7684ee12000-03-17 23:40:15 +1100478forwarded to the given host and port on the remote side.
479This works by allocating a socket to listen to
Damien Miller32aa1441999-10-29 09:15:49 +1000480.Ar port
481on the local side, and whenever a connection is made to this port, the
482connection is forwarded over the secure channel, and a connection is
483made to
Damien Miller34132e52000-01-14 15:45:46 +1100484.Ar host
485port
486.Ar hostport
Damien Miller7684ee12000-03-17 23:40:15 +1100487from the remote machine.
488Port forwardings can also be specified in the configuration file.
489Only root can forward privileged ports.
Damien Miller34132e52000-01-14 15:45:46 +1100490IPv6 addresses can be specified with an alternative syntax:
491.Ar port/host/hostport
Damien Miller32aa1441999-10-29 09:15:49 +1000492.It Fl R Ar port:host:hostport
493Specifies that the given port on the remote (server) host is to be
Damien Miller7684ee12000-03-17 23:40:15 +1100494forwarded to the given host and port on the local side.
495This works by allocating a socket to listen to
Damien Miller32aa1441999-10-29 09:15:49 +1000496.Ar port
497on the remote side, and whenever a connection is made to this port, the
498connection is forwarded over the secure channel, and a connection is
499made to
Damien Miller34132e52000-01-14 15:45:46 +1100500.Ar host
501port
502.Ar hostport
Damien Miller7684ee12000-03-17 23:40:15 +1100503from the local machine.
504Port forwardings can also be specified in the configuration file.
505Privileged ports can be forwarded only when
Damien Miller32aa1441999-10-29 09:15:49 +1000506logging in as root on the remote machine.
Damien Miller4af51302000-04-16 11:18:38 +1000507.It Fl 2
508Forces
509.Nm
Damien Millere247cc42000-05-07 12:03:14 +1000510to try protocol version 2 only.
Damien Miller34132e52000-01-14 15:45:46 +1100511.It Fl 4
512Forces
513.Nm
514to use IPv4 addresses only.
515.It Fl 6
516Forces
517.Nm
518to use IPv6 addresses only.
Damien Miller32aa1441999-10-29 09:15:49 +1000519.El
520.Sh CONFIGURATION FILES
521.Nm
522obtains configuration data from the following sources (in this order):
523command line options, user's configuration file
524.Pq Pa $HOME/.ssh/config ,
525and system-wide configuration file
Damien Miller886c63a2000-01-20 23:13:36 +1100526.Pq Pa /etc/ssh_config .
Damien Miller32aa1441999-10-29 09:15:49 +1000527For each parameter, the first obtained value
Damien Miller7684ee12000-03-17 23:40:15 +1100528will be used.
529The configuration files contain sections bracketed by
530.Dq Host
531specifications, and that section is only applied for hosts that
532match one of the patterns given in the specification.
533The matched host name is the one given on the command line.
Damien Miller32aa1441999-10-29 09:15:49 +1000534.Pp
535Since the first obtained value for each parameter is used, more
536host-specific declarations should be given near the beginning of the
537file, and general defaults at the end.
538.Pp
539The configuration file has the following format:
540.Pp
541Empty lines and lines starting with
542.Ql #
543are comments.
544.Pp
545Otherwise a line is of the format
546.Dq keyword arguments .
547The possible
548keywords and their meanings are as follows (note that the
549configuration files are case-sensitive):
550.Bl -tag -width Ds
551.It Cm Host
552Restricts the following declarations (up to the next
553.Cm Host
554keyword) to be only for those hosts that match one of the patterns
555given after the keyword.
556.Ql \&*
557and
558.Ql ?
559can be used as wildcards in the
Damien Miller7684ee12000-03-17 23:40:15 +1100560patterns.
561A single
Damien Miller32aa1441999-10-29 09:15:49 +1000562.Ql \&*
563as a pattern can be used to provide global
Damien Miller7684ee12000-03-17 23:40:15 +1100564defaults for all hosts.
565The host is the
Damien Miller32aa1441999-10-29 09:15:49 +1000566.Ar hostname
567argument given on the command line (i.e., the name is not converted to
568a canonicalized host name before matching).
569.It Cm AFSTokenPassing
Damien Miller450a7a12000-03-26 13:04:51 +1000570Specifies whether to pass AFS tokens to remote host.
571The argument to this keyword must be
Damien Miller32aa1441999-10-29 09:15:49 +1000572.Dq yes
573or
574.Dq no .
575.It Cm BatchMode
576If set to
577.Dq yes ,
Damien Miller7684ee12000-03-17 23:40:15 +1100578passphrase/password querying will be disabled.
579This option is useful in scripts and other batch jobs where you have no
580user to supply the password.
581The argument must be
Damien Miller32aa1441999-10-29 09:15:49 +1000582.Dq yes
583or
584.Dq no .
Damien Miller396691a2000-01-20 22:44:08 +1100585.It Cm CheckHostIP
586If this flag is set to
587.Dq yes ,
588ssh will additionally check the host ip address in the
589.Pa known_hosts
Damien Miller450a7a12000-03-26 13:04:51 +1000590file.
591This allows ssh to detect if a host key changed due to DNS spoofing.
Damien Miller396691a2000-01-20 22:44:08 +1100592If the option is set to
593.Dq no ,
594the check will not be executed.
Damien Miller32aa1441999-10-29 09:15:49 +1000595.It Cm Cipher
Damien Miller7684ee12000-03-17 23:40:15 +1100596Specifies the cipher to use for encrypting the session.
597Currently,
Damien Miller32aa1441999-10-29 09:15:49 +1000598.Dq blowfish ,
599and
600.Dq 3des
Damien Miller7684ee12000-03-17 23:40:15 +1100601are supported.
602The default is
Damien Miller32aa1441999-10-29 09:15:49 +1000603.Dq 3des .
Damien Miller22c77262000-04-13 12:26:34 +1000604.It Cm Ciphers
605Specifies the ciphers allowed for protocol version 2
606in order of preference.
607Multiple ciphers must be comma-separated.
608The default is
Damien Miller30c3d422000-05-09 11:02:59 +1000609.Dq 3des-cbc,blowfish-cbc,arcfour,cast128-cbc .
Damien Miller32aa1441999-10-29 09:15:49 +1000610.It Cm Compression
Damien Miller7684ee12000-03-17 23:40:15 +1100611Specifies whether to use compression.
612The argument must be
Damien Miller32aa1441999-10-29 09:15:49 +1000613.Dq yes
614or
615.Dq no .
616.It Cm CompressionLevel
Damien Miller7684ee12000-03-17 23:40:15 +1100617Specifies the compression level to use if compression is enable.
618The argument must be an integer from 1 (fast) to 9 (slow, best).
619The default level is 6, which is good for most applications.
620The meaning of the values is the same as in
Damien Miller396691a2000-01-20 22:44:08 +1100621.Xr gzip 1 .
Damien Miller32aa1441999-10-29 09:15:49 +1000622.It Cm ConnectionAttempts
623Specifies the number of tries (one per second) to make before falling
Damien Miller7684ee12000-03-17 23:40:15 +1100624back to rsh or exiting.
625The argument must be an integer.
626This may be useful in scripts if the connection sometimes fails.
Damien Millere247cc42000-05-07 12:03:14 +1000627.It Cm DSAAuthentication
628Specifies whether to try DSA authentication.
629The argument to this keyword must be
630.Dq yes
631or
632.Dq no .
633DSA authentication will only be
634attempted if a DSA identity file exists.
635Note that this option applies to protocol version 2 only.
Damien Miller32aa1441999-10-29 09:15:49 +1000636.It Cm EscapeChar
637Sets the escape character (default:
638.Ql ~ ) .
639The escape character can also
Damien Miller7684ee12000-03-17 23:40:15 +1100640be set on the command line.
641The argument should be a single character,
Damien Miller32aa1441999-10-29 09:15:49 +1000642.Ql ^
643followed by a letter, or
644.Dq none
645to disable the escape
646character entirely (making the connection transparent for binary
647data).
Damien Miller22c77262000-04-13 12:26:34 +1000648.It Cm FallBackToRsh
Damien Miller32aa1441999-10-29 09:15:49 +1000649Specifies that if connecting via
650.Nm
651fails due to a connection refused error (there is no
652.Xr sshd 8
Damien Miller22c77262000-04-13 12:26:34 +1000653listening on the remote host),
Damien Miller32aa1441999-10-29 09:15:49 +1000654.Xr rsh 1
655should automatically be used instead (after a suitable warning about
Damien Miller7684ee12000-03-17 23:40:15 +1100656the session being unencrypted).
657The argument must be
Damien Miller32aa1441999-10-29 09:15:49 +1000658.Dq yes
659or
660.Dq no .
661.It Cm ForwardAgent
662Specifies whether the connection to the authentication agent (if any)
Damien Miller7684ee12000-03-17 23:40:15 +1100663will be forwarded to the remote machine.
664The argument must be
Damien Miller32aa1441999-10-29 09:15:49 +1000665.Dq yes
666or
667.Dq no .
668.It Cm ForwardX11
669Specifies whether X11 connections will be automatically redirected
Damien Miller22c77262000-04-13 12:26:34 +1000670over the secure channel and
Damien Miller32aa1441999-10-29 09:15:49 +1000671.Ev DISPLAY
Damien Miller7684ee12000-03-17 23:40:15 +1100672set.
Damien Miller22c77262000-04-13 12:26:34 +1000673The argument must be
Damien Miller32aa1441999-10-29 09:15:49 +1000674.Dq yes
675or
676.Dq no .
Damien Miller98c7ad62000-03-09 21:27:49 +1100677The default is
678.Dq no .
Damien Miller32aa1441999-10-29 09:15:49 +1000679.It Cm GatewayPorts
680Specifies whether remote hosts are allowed to connect to local
681forwarded ports.
682The argument must be
683.Dq yes
684or
685.Dq no .
686The default is
687.Dq no .
688.It Cm GlobalKnownHostsFile
Damien Miller22c77262000-04-13 12:26:34 +1000689Specifies a file to use instead of
Damien Miller886c63a2000-01-20 23:13:36 +1100690.Pa /etc/ssh_known_hosts .
Damien Miller32aa1441999-10-29 09:15:49 +1000691.It Cm HostName
Damien Miller7684ee12000-03-17 23:40:15 +1100692Specifies the real host name to log into.
693This can be used to specify nicknames or abbreviations for hosts.
694Default is the name given on the command line.
695Numeric IP addresses are also permitted (both on the command line and in
Damien Miller32aa1441999-10-29 09:15:49 +1000696.Cm HostName
697specifications).
698.It Cm IdentityFile
699Specifies the file from which the user's RSA authentication identity
700is read (default
Damien Millere247cc42000-05-07 12:03:14 +1000701.Pa $HOME/.ssh/identity
Damien Miller32aa1441999-10-29 09:15:49 +1000702in the user's home directory).
703Additionally, any identities represented by the authentication agent
Damien Miller7684ee12000-03-17 23:40:15 +1100704will be used for authentication.
705The file name may use the tilde
706syntax to refer to a user's home directory.
707It is possible to have
Damien Miller32aa1441999-10-29 09:15:49 +1000708multiple identity files specified in configuration files; all these
709identities will be tried in sequence.
Damien Millere247cc42000-05-07 12:03:14 +1000710.It Cm IdentityFile2
711Specifies the file from which the user's DSA authentication identity
712is read (default
713.Pa $HOME/.ssh/id_dsa
714in the user's home directory).
715The file name may use the tilde
716syntax to refer to a user's home directory.
717It is possible to have
718multiple identity files specified in configuration files; all these
719identities will be tried in sequence.
Damien Miller32aa1441999-10-29 09:15:49 +1000720.It Cm KeepAlive
721Specifies whether the system should send keepalive messages to the
Damien Miller7684ee12000-03-17 23:40:15 +1100722other side.
723If they are sent, death of the connection or crash of one
724of the machines will be properly noticed.
725However, this means that
Damien Miller32aa1441999-10-29 09:15:49 +1000726connections will die if the route is down temporarily, and some people
Damien Miller450a7a12000-03-26 13:04:51 +1000727find it annoying.
Damien Miller32aa1441999-10-29 09:15:49 +1000728.Pp
729The default is
730.Dq yes
731(to send keepalives), and the client will notice
Damien Miller7684ee12000-03-17 23:40:15 +1100732if the network goes down or the remote host dies.
733This is important in scripts, and many users want it too.
Damien Miller32aa1441999-10-29 09:15:49 +1000734.Pp
735To disable keepalives, the value should be set to
736.Dq no
737in both the server and the client configuration files.
738.It Cm KerberosAuthentication
Damien Miller450a7a12000-03-26 13:04:51 +1000739Specifies whether Kerberos authentication will be used.
740The argument to this keyword must be
Damien Miller32aa1441999-10-29 09:15:49 +1000741.Dq yes
742or
743.Dq no .
744.It Cm KerberosTgtPassing
Damien Miller450a7a12000-03-26 13:04:51 +1000745Specifies whether a Kerberos TGT will be forwarded to the server.
746This will only work if the Kerberos server is actually an AFS kaserver.
747The argument to this keyword must be
Damien Miller32aa1441999-10-29 09:15:49 +1000748.Dq yes
749or
750.Dq no .
751.It Cm LocalForward
752Specifies that a TCP/IP port on the local machine be forwarded over
Damien Miller7684ee12000-03-17 23:40:15 +1100753the secure channel to given host:port from the remote machine.
754The first argument must be a port number, and the second must be
755host:port.
756Multiple forwardings may be specified, and additional
757forwardings can be given on the command line.
758Only the superuser can forward privileged ports.
Damien Miller5ce662a1999-11-11 17:57:39 +1100759.It Cm LogLevel
760Gives the verbosity level that is used when logging messages from
761.Nm ssh .
762The possible values are:
Damien Miller00d4bb12000-03-03 22:48:49 +1100763QUIET, FATAL, ERROR, INFO, VERBOSE and DEBUG.
Damien Miller5ce662a1999-11-11 17:57:39 +1100764The default is INFO.
Damien Miller32aa1441999-10-29 09:15:49 +1000765.It Cm NumberOfPasswordPrompts
Damien Miller450a7a12000-03-26 13:04:51 +1000766Specifies the number of password prompts before giving up.
767The argument to this keyword must be an integer.
768Default is 3.
Damien Miller396691a2000-01-20 22:44:08 +1100769.It Cm PasswordAuthentication
Damien Miller7684ee12000-03-17 23:40:15 +1100770Specifies whether to use password authentication.
771The argument to this keyword must be
Damien Miller396691a2000-01-20 22:44:08 +1100772.Dq yes
773or
774.Dq no .
Damien Millere247cc42000-05-07 12:03:14 +1000775Note that this option applies to both protocol version 1 and 2.
Damien Miller32aa1441999-10-29 09:15:49 +1000776.It Cm Port
Damien Miller7684ee12000-03-17 23:40:15 +1100777Specifies the port number to connect on the remote host.
778Default is 22.
Damien Miller22c77262000-04-13 12:26:34 +1000779.It Cm Protocol
780Specifies the protocol versions
781.Nm
782should support in order of preference.
783The possible values are
784.Dq 1
785and
786.Dq 2 .
787Multiple versions must be comma-separated.
788The default is
Damien Millere247cc42000-05-07 12:03:14 +1000789.Dq 1,2 .
790This means that
791.Nm
792tries version 1 and falls back to version 2
Damien Miller30c3d422000-05-09 11:02:59 +1000793if version 1 is not available.
Damien Miller32aa1441999-10-29 09:15:49 +1000794.It Cm ProxyCommand
Damien Miller7684ee12000-03-17 23:40:15 +1100795Specifies the command to use to connect to the server.
796The command
797string extends to the end of the line, and is executed with
798.Pa /bin/sh .
799In the command string,
800.Ql %h
801will be substituted by the host name to
802connect and
803.Ql %p
804by the port.
805The command can be basically anything,
806and should read from its standard input and write to its standard output.
807It should eventually connect an
Damien Miller32aa1441999-10-29 09:15:49 +1000808.Xr sshd 8
809server running on some machine, or execute
810.Ic sshd -i
Damien Miller7684ee12000-03-17 23:40:15 +1100811somewhere.
812Host key management will be done using the
Damien Miller32aa1441999-10-29 09:15:49 +1000813HostName of the host being connected (defaulting to the name typed by
814the user).
Damien Milleraae6c611999-12-06 11:47:28 +1100815Note that
816.Cm CheckHostIP
817is not available for connects with a proxy command.
Damien Miller32aa1441999-10-29 09:15:49 +1000818.Pp
819.It Cm RemoteForward
820Specifies that a TCP/IP port on the remote machine be forwarded over
Damien Miller7684ee12000-03-17 23:40:15 +1100821the secure channel to given host:port from the local machine.
822The first argument must be a port number, and the second must be
823host:port.
824Multiple forwardings may be specified, and additional
825forwardings can be given on the command line.
826Only the superuser can forward privileged ports.
Damien Miller32aa1441999-10-29 09:15:49 +1000827.It Cm RhostsAuthentication
Damien Miller7684ee12000-03-17 23:40:15 +1100828Specifies whether to try rhosts based authentication.
829Note that this
Damien Miller32aa1441999-10-29 09:15:49 +1000830declaration only affects the client side and has no effect whatsoever
Damien Miller7684ee12000-03-17 23:40:15 +1100831on security.
832Disabling rhosts authentication may reduce
Damien Miller32aa1441999-10-29 09:15:49 +1000833authentication time on slow connections when rhosts authentication is
Damien Miller7684ee12000-03-17 23:40:15 +1100834not used.
835Most servers do not permit RhostsAuthentication because it
836is not secure (see RhostsRSAAuthentication).
837The argument to this keyword must be
Damien Miller32aa1441999-10-29 09:15:49 +1000838.Dq yes
839or
840.Dq no .
841.It Cm RhostsRSAAuthentication
842Specifies whether to try rhosts based authentication with RSA host
Damien Miller7684ee12000-03-17 23:40:15 +1100843authentication.
844This is the primary authentication method for most sites.
845The argument must be
Damien Miller32aa1441999-10-29 09:15:49 +1000846.Dq yes
847or
848.Dq no .
849.It Cm RSAAuthentication
Damien Miller7684ee12000-03-17 23:40:15 +1100850Specifies whether to try RSA authentication.
851The argument to this keyword must be
Damien Miller32aa1441999-10-29 09:15:49 +1000852.Dq yes
853or
854.Dq no .
855RSA authentication will only be
856attempted if the identity file exists, or an authentication agent is
857running.
Damien Millere247cc42000-05-07 12:03:14 +1000858Note that this option applies to protocol version 1 only.
Damien Miller95def091999-11-25 00:26:21 +1100859.It Cm SkeyAuthentication
860Specifies whether to use
861.Xr skey 1
Damien Miller7684ee12000-03-17 23:40:15 +1100862authentication.
863The argument to this keyword must be
Damien Miller95def091999-11-25 00:26:21 +1100864.Dq yes
865or
866.Dq no .
867The default is
868.Dq no .
Damien Miller32aa1441999-10-29 09:15:49 +1000869.It Cm StrictHostKeyChecking
870If this flag is set to
Damien Miller22c77262000-04-13 12:26:34 +1000871.Dq yes ,
Damien Miller32aa1441999-10-29 09:15:49 +1000872.Nm
873ssh will never automatically add host keys to the
874.Pa $HOME/.ssh/known_hosts
Damien Millere247cc42000-05-07 12:03:14 +1000875and
876.Pa $HOME/.ssh/known_hosts2
877files, and refuses to connect hosts whose host key has changed.
Damien Miller7684ee12000-03-17 23:40:15 +1100878This provides maximum protection against trojan horse attacks.
879However, it can be somewhat annoying if you don't have good
Damien Miller886c63a2000-01-20 23:13:36 +1100880.Pa /etc/ssh_known_hosts
Damien Millere247cc42000-05-07 12:03:14 +1000881and
882.Pa /etc/ssh_known_hosts2
Damien Miller32aa1441999-10-29 09:15:49 +1000883files installed and frequently
Damien Miller7684ee12000-03-17 23:40:15 +1100884connect new hosts.
885Basically this option forces the user to manually
886add any new hosts.
887Normally this option is disabled, and new hosts
888will automatically be added to the known host files.
889The host keys of
890known hosts will be verified automatically in either case.
891The argument must be
Damien Miller32aa1441999-10-29 09:15:49 +1000892.Dq yes
893or
894.Dq no .
Damien Miller32aa1441999-10-29 09:15:49 +1000895.It Cm UsePrivilegedPort
896Specifies whether to use a privileged port for outgoing connections.
897The argument must be
898.Dq yes
899or
900.Dq no .
901The default is
902.Dq yes .
903Note that setting this option to
904.Dq no
Damien Millera34a28b1999-12-14 10:47:15 +1100905turns off
Damien Miller32aa1441999-10-29 09:15:49 +1000906.Cm RhostsAuthentication
907and
908.Cm RhostsRSAAuthentication .
Damien Miller396691a2000-01-20 22:44:08 +1100909.It Cm User
Damien Miller7684ee12000-03-17 23:40:15 +1100910Specifies the user to log in as.
911This can be useful if you have a different user name on different machines.
912This saves the trouble of
Damien Miller396691a2000-01-20 22:44:08 +1100913having to remember to give the user name on the command line.
914.It Cm UserKnownHostsFile
915Specifies a file to use instead of
916.Pa $HOME/.ssh/known_hosts .
Damien Miller32aa1441999-10-29 09:15:49 +1000917.It Cm UseRsh
Damien Miller7684ee12000-03-17 23:40:15 +1100918Specifies that rlogin/rsh should be used for this host.
919It is possible that the host does not at all support the
Damien Miller32aa1441999-10-29 09:15:49 +1000920.Nm
Damien Miller7684ee12000-03-17 23:40:15 +1100921protocol.
922This causes
Damien Miller32aa1441999-10-29 09:15:49 +1000923.Nm
Damien Miller7684ee12000-03-17 23:40:15 +1100924to immediately execute
Damien Miller32aa1441999-10-29 09:15:49 +1000925.Xr rsh 1 .
926All other options (except
927.Cm HostName )
Damien Miller7684ee12000-03-17 23:40:15 +1100928are ignored if this has been specified.
929The argument must be
Damien Miller32aa1441999-10-29 09:15:49 +1000930.Dq yes
931or
932.Dq no .
933.Sh ENVIRONMENT
934.Nm
935will normally set the following environment variables:
936.Bl -tag -width Ds
937.It Ev DISPLAY
938The
939.Ev DISPLAY
Damien Miller7684ee12000-03-17 23:40:15 +1100940variable indicates the location of the X11 server.
Damien Miller22c77262000-04-13 12:26:34 +1000941It is automatically set by
Damien Miller32aa1441999-10-29 09:15:49 +1000942.Nm
943to point to a value of the form
944.Dq hostname:n
945where hostname indicates
Damien Miller7684ee12000-03-17 23:40:15 +1100946the host where the shell runs, and n is an integer >= 1.
947.Nm
948uses this special value to forward X11 connections over the secure
949channel.
950The user should normally not set DISPLAY explicitly, as that
Damien Miller32aa1441999-10-29 09:15:49 +1000951will render the X11 connection insecure (and will require the user to
952manually copy any required authorization cookies).
953.It Ev HOME
954Set to the path of the user's home directory.
955.It Ev LOGNAME
956Synonym for
957.Ev USER ;
958set for compatibility with systems that use this variable.
959.It Ev MAIL
960Set to point the user's mailbox.
Damien Miller7684ee12000-03-17 23:40:15 +1100961.It Ev PATH
Damien Miller32aa1441999-10-29 09:15:49 +1000962Set to the default
963.Ev PATH ,
964as specified when compiling
965.Nm ssh .
966.It Ev SSH_AUTH_SOCK
967indicates the path of a unix-domain socket used to communicate with the
968agent.
969.It Ev SSH_CLIENT
Damien Miller7684ee12000-03-17 23:40:15 +1100970Identifies the client end of the connection.
971The variable contains
Damien Miller32aa1441999-10-29 09:15:49 +1000972three space-separated values: client ip-address, client port number,
973and server port number.
974.It Ev SSH_TTY
975This is set to the name of the tty (path to the device) associated
Damien Miller7684ee12000-03-17 23:40:15 +1100976with the current shell or command.
977If the current session has no tty,
Damien Miller32aa1441999-10-29 09:15:49 +1000978this variable is not set.
979.It Ev TZ
980The timezone variable is set to indicate the present timezone if it
981was set when the daemon was started (e.i., the daemon passes the value
982on to new connections).
983.It Ev USER
984Set to the name of the user logging in.
985.El
986.Pp
Damien Miller22c77262000-04-13 12:26:34 +1000987Additionally,
Damien Miller32aa1441999-10-29 09:15:49 +1000988.Nm
Damien Miller22c77262000-04-13 12:26:34 +1000989reads
990.Pa $HOME/.ssh/environment ,
Damien Miller32aa1441999-10-29 09:15:49 +1000991and adds lines of the format
992.Dq VARNAME=value
993to the environment.
994.Sh FILES
Damien Miller98c7ad62000-03-09 21:27:49 +1100995.Bl -tag -width Ds
Damien Miller32aa1441999-10-29 09:15:49 +1000996.It Pa $HOME/.ssh/known_hosts
997Records host keys for all hosts the user has logged into (that are not
998in
Damien Miller886c63a2000-01-20 23:13:36 +1100999.Pa /etc/ssh_known_hosts ) .
Damien Miller32aa1441999-10-29 09:15:49 +10001000See
1001.Xr sshd 8 .
Damien Millere247cc42000-05-07 12:03:14 +10001002.It Pa $HOME/.ssh/identity, $HOME/.ssh/id_dsa
1003Contains the RSA and the DSA authentication identity of the user.
1004These files
1005contain sensitive data and should be readable by the user but not
Damien Miller32aa1441999-10-29 09:15:49 +10001006accessible by others (read/write/execute).
1007Note that
1008.Nm
Damien Millere247cc42000-05-07 12:03:14 +10001009ignores a private key file if it is accessible by others.
Damien Miller32aa1441999-10-29 09:15:49 +10001010It is possible to specify a passphrase when
1011generating the key; the passphrase will be used to encrypt the
1012sensitive part of this file using 3DES.
Damien Millere247cc42000-05-07 12:03:14 +10001013.It Pa $HOME/.ssh/identity.pub, $HOME/.ssh/id_dsa.pub
Damien Miller32aa1441999-10-29 09:15:49 +10001014Contains the public key for authentication (public part of the
Damien Miller7684ee12000-03-17 23:40:15 +11001015identity file in human-readable form).
Damien Millere247cc42000-05-07 12:03:14 +10001016The contents of the
1017.Pa $HOME/.ssh/identity.pub
1018file should be added to
Damien Miller32aa1441999-10-29 09:15:49 +10001019.Pa $HOME/.ssh/authorized_keys
1020on all machines
Damien Miller7684ee12000-03-17 23:40:15 +11001021where you wish to log in using RSA authentication.
Damien Millere247cc42000-05-07 12:03:14 +10001022The contents of the
1023.Pa $HOME/.ssh/id_dsa.pub
1024file should be added to
1025.Pa $HOME/.ssh/authorized_keys2
1026on all machines
1027where you wish to log in using DSA authentication.
1028These files are not
Damien Miller7684ee12000-03-17 23:40:15 +11001029sensitive and can (but need not) be readable by anyone.
Damien Millere247cc42000-05-07 12:03:14 +10001030These files are
1031never used automatically and are not necessary; they is only provided for
Damien Miller32aa1441999-10-29 09:15:49 +10001032the convenience of the user.
1033.It Pa $HOME/.ssh/config
Damien Miller7684ee12000-03-17 23:40:15 +11001034This is the per-user configuration file.
1035The format of this file is described above.
1036This file is used by the
Damien Miller32aa1441999-10-29 09:15:49 +10001037.Nm
Damien Miller7684ee12000-03-17 23:40:15 +11001038client.
1039This file does not usually contain any sensitive information,
Damien Miller32aa1441999-10-29 09:15:49 +10001040but the recommended permissions are read/write for the user, and not
1041accessible by others.
1042.It Pa $HOME/.ssh/authorized_keys
Damien Miller7684ee12000-03-17 23:40:15 +11001043Lists the RSA keys that can be used for logging in as this user.
1044The format of this file is described in the
Damien Miller32aa1441999-10-29 09:15:49 +10001045.Xr sshd 8
Damien Miller7684ee12000-03-17 23:40:15 +11001046manual page.
1047In the simplest form the format is the same as the .pub
Damien Miller32aa1441999-10-29 09:15:49 +10001048identity files (that is, each line contains the number of bits in
1049modulus, public exponent, modulus, and comment fields, separated by
Damien Miller7684ee12000-03-17 23:40:15 +11001050spaces).
1051This file is not highly sensitive, but the recommended
Damien Miller32aa1441999-10-29 09:15:49 +10001052permissions are read/write for the user, and not accessible by others.
Damien Millere247cc42000-05-07 12:03:14 +10001053.It Pa $HOME/.ssh/authorized_keys2
1054Lists the DSA keys that can be used for logging in as this user.
1055This file is not highly sensitive, but the recommended
1056permissions are read/write for the user, and not accessible by others.
1057.It Pa /etc/ssh_known_hosts, /etc/ssh_known_hosts2
Damien Miller7684ee12000-03-17 23:40:15 +11001058Systemwide list of known host keys.
Damien Millere247cc42000-05-07 12:03:14 +10001059.Pa /etc/ssh_known_hosts
1060contains RSA and
1061.Pa /etc/ssh_known_hosts2
1062contains DSA keys.
1063These files should be prepared by the
Damien Miller32aa1441999-10-29 09:15:49 +10001064system administrator to contain the public host keys of all machines in the
Damien Miller7684ee12000-03-17 23:40:15 +11001065organization.
1066This file should be world-readable.
1067This file contains
Damien Miller32aa1441999-10-29 09:15:49 +10001068public keys, one per line, in the following format (fields separated
1069by spaces): system name, number of bits in modulus, public exponent,
Damien Miller7684ee12000-03-17 23:40:15 +11001070modulus, and optional comment field.
1071When different names are used
Damien Miller32aa1441999-10-29 09:15:49 +10001072for the same machine, all such names should be listed, separated by
Damien Miller7684ee12000-03-17 23:40:15 +11001073commas.
1074The format is described on the
Damien Miller32aa1441999-10-29 09:15:49 +10001075.Xr sshd 8
1076manual page.
1077.Pp
1078The canonical system name (as returned by name servers) is used by
1079.Xr sshd 8
1080to verify the client host when logging in; other names are needed because
1081.Nm
1082does not convert the user-supplied name to a canonical name before
1083checking the key, because someone with access to the name servers
1084would then be able to fool host authentication.
Damien Miller886c63a2000-01-20 23:13:36 +11001085.It Pa /etc/ssh_config
Damien Miller7684ee12000-03-17 23:40:15 +11001086Systemwide configuration file.
1087This file provides defaults for those
Damien Miller32aa1441999-10-29 09:15:49 +10001088values that are not specified in the user's configuration file, and
Damien Miller7684ee12000-03-17 23:40:15 +11001089for those users who do not have a configuration file.
1090This file must be world-readable.
Damien Miller32aa1441999-10-29 09:15:49 +10001091.It Pa $HOME/.rhosts
1092This file is used in
1093.Pa \&.rhosts
1094authentication to list the
Damien Miller7684ee12000-03-17 23:40:15 +11001095host/user pairs that are permitted to log in.
1096(Note that this file is
Damien Miller32aa1441999-10-29 09:15:49 +10001097also used by rlogin and rsh, which makes using this file insecure.)
1098Each line of the file contains a host name (in the canonical form
1099returned by name servers), and then a user name on that host,
Damien Miller7684ee12000-03-17 23:40:15 +11001100separated by a space.
1101One some machines this file may need to be
Damien Miller32aa1441999-10-29 09:15:49 +10001102world-readable if the user's home directory is on a NFS partition,
1103because
1104.Xr sshd 8
Damien Miller7684ee12000-03-17 23:40:15 +11001105reads it as root.
1106Additionally, this file must be owned by the user,
1107and must not have write permissions for anyone else.
1108The recommended
Damien Miller32aa1441999-10-29 09:15:49 +10001109permission for most machines is read/write for the user, and not
1110accessible by others.
1111.Pp
1112Note that by default
1113.Xr sshd 8
1114will be installed so that it requires successful RSA host
Damien Miller7684ee12000-03-17 23:40:15 +11001115authentication before permitting \s+2.\s0rhosts authentication.
1116If your server machine does not have the client's host key in
Damien Miller886c63a2000-01-20 23:13:36 +11001117.Pa /etc/ssh_known_hosts ,
Damien Miller32aa1441999-10-29 09:15:49 +10001118you can store it in
1119.Pa $HOME/.ssh/known_hosts .
1120The easiest way to do this is to
1121connect back to the client from the server machine using ssh; this
Damien Millere247cc42000-05-07 12:03:14 +10001122will automatically add the host key to
Damien Miller32aa1441999-10-29 09:15:49 +10001123.Pa $HOME/.ssh/known_hosts .
1124.It Pa $HOME/.shosts
1125This file is used exactly the same way as
1126.Pa \&.rhosts .
1127The purpose for
1128having this file is to be able to use rhosts authentication with
1129.Nm
1130without permitting login with
1131.Xr rlogin 1
1132or
1133.Xr rsh 1 .
1134.It Pa /etc/hosts.equiv
1135This file is used during
Damien Miller7684ee12000-03-17 23:40:15 +11001136.Pa \&.rhosts authentication.
1137It contains
Damien Miller32aa1441999-10-29 09:15:49 +10001138canonical hosts names, one per line (the full format is described on
1139the
1140.Xr sshd 8
Damien Miller7684ee12000-03-17 23:40:15 +11001141manual page).
1142If the client host is found in this file, login is
Damien Miller32aa1441999-10-29 09:15:49 +10001143automatically permitted provided client and server user names are the
Damien Miller7684ee12000-03-17 23:40:15 +11001144same.
1145Additionally, successful RSA host authentication is normally
1146required.
1147This file should only be writable by root.
Damien Miller886c63a2000-01-20 23:13:36 +11001148.It Pa /etc/shosts.equiv
Damien Miller22c77262000-04-13 12:26:34 +10001149This file is processed exactly as
Damien Miller32aa1441999-10-29 09:15:49 +10001150.Pa /etc/hosts.equiv .
1151This file may be useful to permit logins using
1152.Nm
1153but not using rsh/rlogin.
Damien Miller886c63a2000-01-20 23:13:36 +11001154.It Pa /etc/sshrc
Damien Miller32aa1441999-10-29 09:15:49 +10001155Commands in this file are executed by
1156.Nm
1157when the user logs in just before the user's shell (or command) is started.
1158See the
1159.Xr sshd 8
1160manual page for more information.
1161.It Pa $HOME/.ssh/rc
1162Commands in this file are executed by
1163.Nm
1164when the user logs in just before the user's shell (or command) is
1165started.
Damien Miller22c77262000-04-13 12:26:34 +10001166See the
Damien Miller32aa1441999-10-29 09:15:49 +10001167.Xr sshd 8
1168manual page for more information.
Damien Miller4f0fa561999-12-26 14:24:41 +11001169.It Pa $HOME/.ssh/environment
1170Contains additional definitions for environment variables, see section
1171.Sx ENVIRONMENT
1172above.
Damien Miller32aa1441999-10-29 09:15:49 +10001173.It Pa libcrypto.so.X.1
1174A version of this library which includes support for the RSA algorithm
1175is required for proper operation.
1176.Sh AUTHOR
Damien Miller32aa1441999-10-29 09:15:49 +10001177OpenSSH
Damien Miller98c7ad62000-03-09 21:27:49 +11001178is a derivative of the original (free) ssh 1.2.12 release by Tatu Ylonen,
Damien Miller7684ee12000-03-17 23:40:15 +11001179but with bugs removed and newer features re-added.
1180Rapidly after the
Damien Miller98c7ad62000-03-09 21:27:49 +110011811.2.12 release, newer versions of the original ssh bore successively
1182more restrictive licenses, and thus demand for a free version was born.
Damien Millere247cc42000-05-07 12:03:14 +10001183.Pp
Damien Miller98c7ad62000-03-09 21:27:49 +11001184This version of OpenSSH
Damien Miller32aa1441999-10-29 09:15:49 +10001185.Bl -bullet
1186.It
Damien Millercfabe862000-04-20 23:27:27 +10001187has all components of a restrictive nature (i.e., patents)
Damien Miller32aa1441999-10-29 09:15:49 +10001188directly removed from the source code; any licensed or patented components
1189are chosen from
1190external libraries.
1191.It
Damien Millere247cc42000-05-07 12:03:14 +10001192has been updated to support SSH protocol 1.5 and 2, making it compatible with
1193all other SSH clients and servers.
Damien Miller32aa1441999-10-29 09:15:49 +10001194.It
Damien Miller22c77262000-04-13 12:26:34 +10001195contains added support for
Damien Miller32aa1441999-10-29 09:15:49 +10001196.Xr kerberos 8
1197authentication and ticket passing.
1198.It
1199supports one-time password authentication with
1200.Xr skey 1 .
1201.El
1202.Pp
Damien Miller6ee95641999-11-18 11:35:13 +11001203OpenSSH has been created by Aaron Campbell, Bob Beck, Markus Friedl,
Damien Miller10f6f6b1999-11-17 17:29:08 +11001204Niels Provos, Theo de Raadt, and Dug Song.
Damien Millere247cc42000-05-07 12:03:14 +10001205.Pp
1206The support for SSH protocol 2 was written by Markus Friedl.
Damien Miller32aa1441999-10-29 09:15:49 +10001207.Sh SEE ALSO
1208.Xr rlogin 1 ,
1209.Xr rsh 1 ,
1210.Xr scp 1 ,
1211.Xr ssh-add 1 ,
1212.Xr ssh-agent 1 ,
1213.Xr ssh-keygen 1 ,
1214.Xr telnet 1 ,
1215.Xr sshd 8 ,