blob: 1d1a76cf7da731afda46a559b0c510ffa8c08285 [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 Miller4af51302000-04-16 11:18:38 +100012.\" $Id: ssh.1,v 1.22 2000/04/16 01:18:46 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 Miller32aa1441999-10-29 09:15:49 +100028.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
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
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
Damien Miller886c63a2000-01-20 23:13:36 +110071.Pa /etc/shosts.equiv
Damien Miller32aa1441999-10-29 09:15:49 +100072on the remote machine, and the user names are
73the same on both sides, the user is immediately permitted to log in.
Damien Miller22c77262000-04-13 12:26:34 +100074Second, if
Damien Miller32aa1441999-10-29 09:15:49 +100075.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
Damien Miller7684ee12000-03-17 23:40:15 +110081permitted to log in.
82This form of authentication alone is normally not
Damien Miller32aa1441999-10-29 09:15:49 +100083allowed 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
Damien Miller7684ee12000-03-17 23:40:15 +110089method combined with RSA-based host authentication.
90It means that if the login would be permitted by
Damien Miller32aa1441999-10-29 09:15:49 +100091.Pa \&.rhosts ,
92.Pa \&.shosts ,
93.Pa /etc/hosts.equiv ,
94or
Damien Miller886c63a2000-01-20 23:13:36 +110095.Pa /etc/shosts.equiv ,
Damien Miller32aa1441999-10-29 09:15:49 +100096and if additionally the server can verify the client's
Damien Miller22c77262000-04-13 12:26:34 +100097host key (see
Damien Miller886c63a2000-01-20 23:13:36 +110098.Pa /etc/ssh_known_hosts
Damien Miller33e511e1999-11-11 11:43:13 +110099and
100.Pa $HOME/.ssh/known_hosts
Damien Miller32aa1441999-10-29 09:15:49 +1000101in the
102.Sx FILES
Damien Miller7684ee12000-03-17 23:40:15 +1100103section), 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:
Damien Miller32aa1441999-10-29 09:15:49 +1000107.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
Damien Miller22c77262000-04-13 12:26:34 +1000112As a third authentication method,
Damien Miller32aa1441999-10-29 09:15:49 +1000113.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.
Damien Miller7684ee12000-03-17 23:40:15 +1100118RSA is one such system.
Damien Miller22c77262000-04-13 12:26:34 +1000119The idea is that each user creates a public/private
Damien Miller7684ee12000-03-17 23:40:15 +1100120key pair for authentication purposes.
121The server knows the public key, and only the user knows the private key.
Damien Miller22c77262000-04-13 12:26:34 +1000122The file
Damien Miller32aa1441999-10-29 09:15:49 +1000123.Pa $HOME/.ssh/authorized_keys
124lists the public keys that are permitted for logging
Damien Miller7684ee12000-03-17 23:40:15 +1100125in.
126When the user logs in, the
Damien Miller32aa1441999-10-29 09:15:49 +1000127.Nm
128program tells the server which key pair it would like to use for
Damien Miller7684ee12000-03-17 23:40:15 +1100129authentication.
130The server checks if this key is permitted, and if
Damien Miller32aa1441999-10-29 09:15:49 +1000131so, sends the user (actually the
132.Nm
133program running on behalf of the user) a challenge, a random number,
Damien Miller7684ee12000-03-17 23:40:15 +1100134encrypted by the user's public key.
135The challenge can only be
136decrypted using the proper private key.
137The user's client then decrypts the
Damien Miller32aa1441999-10-29 09:15:49 +1000138challenge using the private key, proving that he/she knows the private
139key but without disclosing it to the server.
140.Pp
141.Nm
Damien Miller7684ee12000-03-17 23:40:15 +1100142implements the RSA authentication protocol automatically.
143The user creates his/her RSA key pair by running
Damien Miller32aa1441999-10-29 09:15:49 +1000144.Xr ssh-keygen 1 .
Damien Miller22c77262000-04-13 12:26:34 +1000145This stores the private key in
Damien Miller32aa1441999-10-29 09:15:49 +1000146.Pa \&.ssh/identity
147and the public key in
148.Pa \&.ssh/identity.pub
Damien Miller7684ee12000-03-17 23:40:15 +1100149in the user's home directory.
150The user should then copy the
Damien Miller32aa1441999-10-29 09:15:49 +1000151.Pa identity.pub
Damien Miller22c77262000-04-13 12:26:34 +1000152to
Damien Miller32aa1441999-10-29 09:15:49 +1000153.Pa \&.ssh/authorized_keys
Damien Miller22c77262000-04-13 12:26:34 +1000154in his/her home directory on the remote machine (the
Damien Miller32aa1441999-10-29 09:15:49 +1000155.Pa authorized_keys
Damien Miller22c77262000-04-13 12:26:34 +1000156file corresponds to the conventional
Damien Miller32aa1441999-10-29 09:15:49 +1000157.Pa \&.rhosts
158file, and has one key
Damien Miller7684ee12000-03-17 23:40:15 +1100159per line, though the lines can be very long).
160After this, the user can log in without giving the password.
161RSA authentication is much
Damien Miller32aa1441999-10-29 09:15:49 +1000162more secure than rhosts authentication.
163.Pp
164The most convenient way to use RSA authentication may be with an
Damien Miller7684ee12000-03-17 23:40:15 +1100165authentication agent.
166See
Damien Miller32aa1441999-10-29 09:15:49 +1000167.Xr ssh-agent 1
168for more information.
169.Pp
Damien Miller22c77262000-04-13 12:26:34 +1000170If other authentication methods fail,
Damien Miller32aa1441999-10-29 09:15:49 +1000171.Nm
Damien Miller7684ee12000-03-17 23:40:15 +1100172prompts the user for a password.
173The password is sent to the remote
Damien Miller32aa1441999-10-29 09:15:49 +1000174host 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
Damien Miller7684ee12000-03-17 23:40:15 +1100179the user a normal shell on the remote machine.
180All communication with
Damien Miller32aa1441999-10-29 09:15:49 +1000181the 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
Damien Miller22c77262000-04-13 12:26:34 +1000191.Ic ~#
Damien Miller32aa1441999-10-29 09:15:49 +1000192and 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
Damien Miller7684ee12000-03-17 23:40:15 +1100197shell to hang).
198All available escapes can be listed with
Damien Miller32aa1441999-10-29 09:15:49 +1000199.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
Damien Miller7684ee12000-03-17 23:40:15 +1100205special.
206The escape character can be changed in configuration files
207or on the command line.
Damien Miller32aa1441999-10-29 09:15:49 +1000208.Pp
209If no pseudo tty has been allocated, the
210session is transparent and can be used to reliably transfer binary
Damien Miller7684ee12000-03-17 23:40:15 +1100211data.
212On most systems, setting the escape character to
Damien Miller32aa1441999-10-29 09:15:49 +1000213.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
Damien Miller7684ee12000-03-17 23:40:15 +1100228from the local machine.
229The user should not manually set
Damien Miller32aa1441999-10-29 09:15:49 +1000230.Ev DISPLAY .
231Forwarding of X11 connections can be
232configured on the command line or in configuration files.
233.Pp
234The
Damien Miller22c77262000-04-13 12:26:34 +1000235.Ev DISPLAY
Damien Miller32aa1441999-10-29 09:15:49 +1000236value set by
237.Nm
238will point to the server machine, but with a display number greater
Damien Miller7684ee12000-03-17 23:40:15 +1100239than zero.
240This is normal, and happens because
Damien Miller32aa1441999-10-29 09:15:49 +1000241.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
Damien Miller7684ee12000-03-17 23:40:15 +1100252the connection is opened.
253The real authentication cookie is never
Damien Miller32aa1441999-10-29 09:15:49 +1000254sent 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
Damien Miller7684ee12000-03-17 23:40:15 +1100261be specified either on command line or in a configuration file.
262One possible application of TCP/IP forwarding is a secure connection to an
Damien Miller32aa1441999-10-29 09:15:49 +1000263electronic purse; another is going trough firewalls.
264.Pp
265.Nm
266automatically maintains and checks a database containing RSA-based
Damien Miller7684ee12000-03-17 23:40:15 +1100267identifications for all hosts it has ever been used with.
Damien Miller22c77262000-04-13 12:26:34 +1000268The database is stored in
Damien Miller32aa1441999-10-29 09:15:49 +1000269.Pa \&.ssh/known_hosts
Damien Miller7684ee12000-03-17 23:40:15 +1100270in the user's home directory.
Damien Miller22c77262000-04-13 12:26:34 +1000271Additionally, the file
Damien Miller886c63a2000-01-20 23:13:36 +1100272.Pa /etc/ssh_known_hosts
Damien Miller7684ee12000-03-17 23:40:15 +1100273is automatically checked for known hosts.
274Any new hosts are automatically added to the user's file.
275If a host's identification
Damien Miller32aa1441999-10-29 09:15:49 +1000276ever changes,
277.Nm
278warns about this and disables password authentication to prevent a
Damien Miller7684ee12000-03-17 23:40:15 +1100279trojan horse from getting the user's password.
280Another purpose of
Damien Miller32aa1441999-10-29 09:15:49 +1000281this mechanism is to prevent man-in-the-middle attacks which could
Damien Miller7684ee12000-03-17 23:40:15 +1100282otherwise be used to circumvent the encryption.
283The
Damien Miller32aa1441999-10-29 09:15:49 +1000284.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
Damien Miller450a7a12000-03-26 13:04:51 +1000290Disables forwarding of the authentication agent connection.
291This may also be specified on a per-host basis in the configuration file.
Damien Miller32aa1441999-10-29 09:15:49 +1000292.It Fl c Ar blowfish|3des
Damien Miller22c77262000-04-13 12:26:34 +1000293Selects the cipher to use for encrypting the session.
Damien Miller32aa1441999-10-29 09:15:49 +1000294.Ar 3des
Damien Miller7684ee12000-03-17 23:40:15 +1100295is used by default.
Damien Miller22c77262000-04-13 12:26:34 +1000296It is believed to be secure.
Damien Miller32aa1441999-10-29 09:15:49 +1000297.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
Damien Miller7684ee12000-03-17 23:40:15 +1100304.Ar 3des .
Damien Miller32aa1441999-10-29 09:15:49 +1000305.It Fl e Ar ch|^ch|none
306Sets the escape character for sessions with a pty (default:
307.Ql ~ ) .
Damien Miller7684ee12000-03-17 23:40:15 +1100308The escape character is only recognized at the beginning of a line.
309The escape character followed by a dot
Damien Miller32aa1441999-10-29 09:15:49 +1000310.Pq Ql \&.
311closes the connection, followed
312by control-Z suspends the connection, and followed by itself sends the
Damien Miller7684ee12000-03-17 23:40:15 +1100313escape character once.
314Setting the character to
Damien Miller32aa1441999-10-29 09:15:49 +1000315.Dq none
316disables any escapes and makes the session fully transparent.
317.It Fl f
318Requests
319.Nm
Damien Miller7684ee12000-03-17 23:40:15 +1100320to go to background just before command execution.
321This is useful if
Damien Miller32aa1441999-10-29 09:15:49 +1000322.Nm
323is going to ask for passwords or passphrases, but the user
Damien Miller7684ee12000-03-17 23:40:15 +1100324wants it in the background.
Damien Miller22c77262000-04-13 12:26:34 +1000325This implies
Damien Miller32aa1441999-10-29 09:15:49 +1000326.Fl n .
327The recommended way to start X11 programs at a remote site is with
328something like
329.Ic ssh -f host xterm .
Damien Miller396691a2000-01-20 22:44:08 +1100330.It Fl g
331Allows remote hosts to connect to local forwarded ports.
Damien Miller32aa1441999-10-29 09:15:49 +1000332.It Fl i Ar identity_file
Damien Miller22c77262000-04-13 12:26:34 +1000333Selects the file from which the identity (private key) for
Damien Miller7684ee12000-03-17 23:40:15 +1100334RSA authentication is read.
Damien Miller22c77262000-04-13 12:26:34 +1000335Default is
Damien Miller32aa1441999-10-29 09:15:49 +1000336.Pa \&.ssh/identity
Damien Miller7684ee12000-03-17 23:40:15 +1100337in 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
Damien Miller32aa1441999-10-29 09:15:49 +1000341.Fl i
342options (and multiple identities specified in
343configuration files).
Damien Miller32aa1441999-10-29 09:15:49 +1000344.It Fl k
Damien Miller450a7a12000-03-26 13:04:51 +1000345Disables forwarding of Kerberos tickets and AFS tokens.
346This may also be specified on a per-host basis in the configuration file.
Damien Miller32aa1441999-10-29 09:15:49 +1000347.It Fl l Ar login_name
Damien Miller7684ee12000-03-17 23:40:15 +1100348Specifies the user to log in as on the remote machine.
349This also may be specified on a per-host basis in the configuration file.
Damien Miller32aa1441999-10-29 09:15:49 +1000350.It Fl n
351Redirects stdin from
352.Pa /dev/null
353(actually, prevents reading from stdin).
354This must be used when
355.Nm
Damien Miller7684ee12000-03-17 23:40:15 +1100356is run in the background.
357A common trick is to use this to run X11 programs on a remote machine.
358For example,
Damien Miller32aa1441999-10-29 09:15:49 +1000359.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
Damien Miller7684ee12000-03-17 23:40:15 +1100373command-line flag.
374The option has the same format as a line in the configuration file.
Damien Miller32aa1441999-10-29 09:15:49 +1000375.It Fl p Ar port
Damien Miller7684ee12000-03-17 23:40:15 +1100376Port to connect to on the remote host.
377This can be specified on a
Damien Miller32aa1441999-10-29 09:15:49 +1000378per-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.
Damien Millera34a28b1999-12-14 10:47:15 +1100383Note that this option turns off
Damien Miller32aa1441999-10-29 09:15:49 +1000384.Cm RhostsAuthentication
385and
386.Cm RhostsRSAAuthentication .
387.It Fl q
Damien Miller7684ee12000-03-17 23:40:15 +1100388Quiet mode.
389Causes all warning and diagnostic messages to be suppressed.
390Only fatal errors are displayed.
Damien Miller32aa1441999-10-29 09:15:49 +1000391.It Fl t
Damien Miller7684ee12000-03-17 23:40:15 +1100392Force pseudo-tty allocation.
Damien Miller450a7a12000-03-26 13:04:51 +1000393This can be used to execute arbitrary
Damien Miller7684ee12000-03-17 23:40:15 +1100394screen-based programs on a remote machine, which can be very useful,
395e.g., when implementing menu services.
Damien Miller32aa1441999-10-29 09:15:49 +1000396.It Fl v
Damien Miller7684ee12000-03-17 23:40:15 +1100397Verbose mode.
398Causes
Damien Miller32aa1441999-10-29 09:15:49 +1000399.Nm
Damien Miller7684ee12000-03-17 23:40:15 +1100400to print debugging messages about its progress.
401This is helpful in
Damien Miller32aa1441999-10-29 09:15:49 +1000402debugging 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
Damien Miller7684ee12000-03-17 23:40:15 +1100407Disables X11 forwarding.
408This can also be specified on a per-host basis in a configuration file.
Damien Miller32aa1441999-10-29 09:15:49 +1000409.It Fl X
410Enables X11 forwarding.
411.It Fl C
412Requests compression of all data (including stdin, stdout, stderr, and
Damien Miller7684ee12000-03-17 23:40:15 +1100413data for forwarded X11 and TCP/IP connections).
414The compression algorithm is the same used by
Damien Miller396691a2000-01-20 22:44:08 +1100415.Xr gzip 1 ,
416and the
Damien Miller32aa1441999-10-29 09:15:49 +1000417.Dq level
418can be controlled by the
419.Cm CompressionLevel
Damien Miller7684ee12000-03-17 23:40:15 +1100420option (see below).
421Compression is desirable on modem lines and other
Damien Miller32aa1441999-10-29 09:15:49 +1000422slow 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
Damien Miller7684ee12000-03-17 23:40:15 +1100429forwarded to the given host and port on the remote side.
430This works by allocating a socket to listen to
Damien Miller32aa1441999-10-29 09:15:49 +1000431.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
Damien Miller34132e52000-01-14 15:45:46 +1100435.Ar host
436port
437.Ar hostport
Damien Miller7684ee12000-03-17 23:40:15 +1100438from the remote machine.
439Port forwardings can also be specified in the configuration file.
440Only root can forward privileged ports.
Damien Miller34132e52000-01-14 15:45:46 +1100441IPv6 addresses can be specified with an alternative syntax:
442.Ar port/host/hostport
Damien Miller32aa1441999-10-29 09:15:49 +1000443.It Fl R Ar port:host:hostport
444Specifies that the given port on the remote (server) host is to be
Damien Miller7684ee12000-03-17 23:40:15 +1100445forwarded to the given host and port on the local side.
446This works by allocating a socket to listen to
Damien Miller32aa1441999-10-29 09:15:49 +1000447.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
Damien Miller34132e52000-01-14 15:45:46 +1100451.Ar host
452port
453.Ar hostport
Damien Miller7684ee12000-03-17 23:40:15 +1100454from the local machine.
455Port forwardings can also be specified in the configuration file.
456Privileged ports can be forwarded only when
Damien Miller32aa1441999-10-29 09:15:49 +1000457logging in as root on the remote machine.
Damien Miller4af51302000-04-16 11:18:38 +1000458.It Fl 2
459Forces
460.Nm
461to use protocol version 2 only.
Damien Miller34132e52000-01-14 15:45:46 +1100462.It Fl 4
463Forces
464.Nm
465to use IPv4 addresses only.
466.It Fl 6
467Forces
468.Nm
469to use IPv6 addresses only.
Damien Miller32aa1441999-10-29 09:15:49 +1000470.El
471.Sh CONFIGURATION FILES
472.Nm
473obtains configuration data from the following sources (in this order):
474command line options, user's configuration file
475.Pq Pa $HOME/.ssh/config ,
476and system-wide configuration file
Damien Miller886c63a2000-01-20 23:13:36 +1100477.Pq Pa /etc/ssh_config .
Damien Miller32aa1441999-10-29 09:15:49 +1000478For each parameter, the first obtained value
Damien Miller7684ee12000-03-17 23:40:15 +1100479will be used.
480The configuration files contain sections bracketed by
481.Dq Host
482specifications, and that section is only applied for hosts that
483match one of the patterns given in the specification.
484The matched host name is the one given on the command line.
Damien Miller32aa1441999-10-29 09:15:49 +1000485.Pp
486Since the first obtained value for each parameter is used, more
487host-specific declarations should be given near the beginning of the
488file, and general defaults at the end.
489.Pp
490The configuration file has the following format:
491.Pp
492Empty lines and lines starting with
493.Ql #
494are comments.
495.Pp
496Otherwise a line is of the format
497.Dq keyword arguments .
498The possible
499keywords and their meanings are as follows (note that the
500configuration files are case-sensitive):
501.Bl -tag -width Ds
502.It Cm Host
503Restricts the following declarations (up to the next
504.Cm Host
505keyword) to be only for those hosts that match one of the patterns
506given after the keyword.
507.Ql \&*
508and
509.Ql ?
510can be used as wildcards in the
Damien Miller7684ee12000-03-17 23:40:15 +1100511patterns.
512A single
Damien Miller32aa1441999-10-29 09:15:49 +1000513.Ql \&*
514as a pattern can be used to provide global
Damien Miller7684ee12000-03-17 23:40:15 +1100515defaults for all hosts.
516The host is the
Damien Miller32aa1441999-10-29 09:15:49 +1000517.Ar hostname
518argument given on the command line (i.e., the name is not converted to
519a canonicalized host name before matching).
520.It Cm AFSTokenPassing
Damien Miller450a7a12000-03-26 13:04:51 +1000521Specifies whether to pass AFS tokens to remote host.
522The argument to this keyword must be
Damien Miller32aa1441999-10-29 09:15:49 +1000523.Dq yes
524or
525.Dq no .
526.It Cm BatchMode
527If set to
528.Dq yes ,
Damien Miller7684ee12000-03-17 23:40:15 +1100529passphrase/password querying will be disabled.
530This option is useful in scripts and other batch jobs where you have no
531user to supply the password.
532The argument must be
Damien Miller32aa1441999-10-29 09:15:49 +1000533.Dq yes
534or
535.Dq no .
Damien Miller396691a2000-01-20 22:44:08 +1100536.It Cm CheckHostIP
537If this flag is set to
538.Dq yes ,
539ssh will additionally check the host ip address in the
540.Pa known_hosts
Damien Miller450a7a12000-03-26 13:04:51 +1000541file.
542This allows ssh to detect if a host key changed due to DNS spoofing.
Damien Miller396691a2000-01-20 22:44:08 +1100543If the option is set to
544.Dq no ,
545the check will not be executed.
Damien Miller32aa1441999-10-29 09:15:49 +1000546.It Cm Cipher
Damien Miller7684ee12000-03-17 23:40:15 +1100547Specifies the cipher to use for encrypting the session.
548Currently,
Damien Miller32aa1441999-10-29 09:15:49 +1000549.Dq blowfish ,
550and
551.Dq 3des
Damien Miller7684ee12000-03-17 23:40:15 +1100552are supported.
553The default is
Damien Miller32aa1441999-10-29 09:15:49 +1000554.Dq 3des .
Damien Miller22c77262000-04-13 12:26:34 +1000555.It Cm Ciphers
556Specifies the ciphers allowed for protocol version 2
557in order of preference.
558Multiple ciphers must be comma-separated.
559The default is
560.Dq blowfish-cbc,3des-cbc,arcfour,cast128-cbc .
Damien Miller32aa1441999-10-29 09:15:49 +1000561.It Cm Compression
Damien Miller7684ee12000-03-17 23:40:15 +1100562Specifies whether to use compression.
563The argument must be
Damien Miller32aa1441999-10-29 09:15:49 +1000564.Dq yes
565or
566.Dq no .
567.It Cm CompressionLevel
Damien Miller7684ee12000-03-17 23:40:15 +1100568Specifies the compression level to use if compression is enable.
569The argument must be an integer from 1 (fast) to 9 (slow, best).
570The default level is 6, which is good for most applications.
571The meaning of the values is the same as in
Damien Miller396691a2000-01-20 22:44:08 +1100572.Xr gzip 1 .
Damien Miller32aa1441999-10-29 09:15:49 +1000573.It Cm ConnectionAttempts
574Specifies the number of tries (one per second) to make before falling
Damien Miller7684ee12000-03-17 23:40:15 +1100575back to rsh or exiting.
576The argument must be an integer.
577This may be useful in scripts if the connection sometimes fails.
Damien Miller32aa1441999-10-29 09:15:49 +1000578.It Cm EscapeChar
579Sets the escape character (default:
580.Ql ~ ) .
581The escape character can also
Damien Miller7684ee12000-03-17 23:40:15 +1100582be set on the command line.
583The argument should be a single character,
Damien Miller32aa1441999-10-29 09:15:49 +1000584.Ql ^
585followed by a letter, or
586.Dq none
587to disable the escape
588character entirely (making the connection transparent for binary
589data).
Damien Miller22c77262000-04-13 12:26:34 +1000590.It Cm FallBackToRsh
Damien Miller32aa1441999-10-29 09:15:49 +1000591Specifies that if connecting via
592.Nm
593fails due to a connection refused error (there is no
594.Xr sshd 8
Damien Miller22c77262000-04-13 12:26:34 +1000595listening on the remote host),
Damien Miller32aa1441999-10-29 09:15:49 +1000596.Xr rsh 1
597should automatically be used instead (after a suitable warning about
Damien Miller7684ee12000-03-17 23:40:15 +1100598the session being unencrypted).
599The argument must be
Damien Miller32aa1441999-10-29 09:15:49 +1000600.Dq yes
601or
602.Dq no .
603.It Cm ForwardAgent
604Specifies whether the connection to the authentication agent (if any)
Damien Miller7684ee12000-03-17 23:40:15 +1100605will be forwarded to the remote machine.
606The argument must be
Damien Miller32aa1441999-10-29 09:15:49 +1000607.Dq yes
608or
609.Dq no .
610.It Cm ForwardX11
611Specifies whether X11 connections will be automatically redirected
Damien Miller22c77262000-04-13 12:26:34 +1000612over the secure channel and
Damien Miller32aa1441999-10-29 09:15:49 +1000613.Ev DISPLAY
Damien Miller7684ee12000-03-17 23:40:15 +1100614set.
Damien Miller22c77262000-04-13 12:26:34 +1000615The argument must be
Damien Miller32aa1441999-10-29 09:15:49 +1000616.Dq yes
617or
618.Dq no .
Damien Miller98c7ad62000-03-09 21:27:49 +1100619The default is
620.Dq no .
Damien Miller32aa1441999-10-29 09:15:49 +1000621.It Cm GatewayPorts
622Specifies whether remote hosts are allowed to connect to local
623forwarded ports.
624The argument must be
625.Dq yes
626or
627.Dq no .
628The default is
629.Dq no .
630.It Cm GlobalKnownHostsFile
Damien Miller22c77262000-04-13 12:26:34 +1000631Specifies a file to use instead of
Damien Miller886c63a2000-01-20 23:13:36 +1100632.Pa /etc/ssh_known_hosts .
Damien Miller32aa1441999-10-29 09:15:49 +1000633.It Cm HostName
Damien Miller7684ee12000-03-17 23:40:15 +1100634Specifies the real host name to log into.
635This can be used to specify nicknames or abbreviations for hosts.
636Default is the name given on the command line.
637Numeric IP addresses are also permitted (both on the command line and in
Damien Miller32aa1441999-10-29 09:15:49 +1000638.Cm HostName
639specifications).
640.It Cm IdentityFile
641Specifies the file from which the user's RSA authentication identity
642is read (default
643.Pa .ssh/identity
644in the user's home directory).
645Additionally, any identities represented by the authentication agent
Damien Miller7684ee12000-03-17 23:40:15 +1100646will be used for authentication.
647The file name may use the tilde
648syntax to refer to a user's home directory.
649It is possible to have
Damien Miller32aa1441999-10-29 09:15:49 +1000650multiple identity files specified in configuration files; all these
651identities will be tried in sequence.
652.It Cm KeepAlive
653Specifies whether the system should send keepalive messages to the
Damien Miller7684ee12000-03-17 23:40:15 +1100654other side.
655If they are sent, death of the connection or crash of one
656of the machines will be properly noticed.
657However, this means that
Damien Miller32aa1441999-10-29 09:15:49 +1000658connections will die if the route is down temporarily, and some people
Damien Miller450a7a12000-03-26 13:04:51 +1000659find it annoying.
Damien Miller32aa1441999-10-29 09:15:49 +1000660.Pp
661The default is
662.Dq yes
663(to send keepalives), and the client will notice
Damien Miller7684ee12000-03-17 23:40:15 +1100664if the network goes down or the remote host dies.
665This is important in scripts, and many users want it too.
Damien Miller32aa1441999-10-29 09:15:49 +1000666.Pp
667To disable keepalives, the value should be set to
668.Dq no
669in both the server and the client configuration files.
670.It Cm KerberosAuthentication
Damien Miller450a7a12000-03-26 13:04:51 +1000671Specifies whether Kerberos authentication will be used.
672The argument to this keyword must be
Damien Miller32aa1441999-10-29 09:15:49 +1000673.Dq yes
674or
675.Dq no .
676.It Cm KerberosTgtPassing
Damien Miller450a7a12000-03-26 13:04:51 +1000677Specifies whether a Kerberos TGT will be forwarded to the server.
678This will only work if the Kerberos server is actually an AFS kaserver.
679The argument to this keyword must be
Damien Miller32aa1441999-10-29 09:15:49 +1000680.Dq yes
681or
682.Dq no .
683.It Cm LocalForward
684Specifies that a TCP/IP port on the local machine be forwarded over
Damien Miller7684ee12000-03-17 23:40:15 +1100685the secure channel to given host:port from the remote machine.
686The first argument must be a port number, and the second must be
687host:port.
688Multiple forwardings may be specified, and additional
689forwardings can be given on the command line.
690Only the superuser can forward privileged ports.
Damien Miller5ce662a1999-11-11 17:57:39 +1100691.It Cm LogLevel
692Gives the verbosity level that is used when logging messages from
693.Nm ssh .
694The possible values are:
Damien Miller00d4bb12000-03-03 22:48:49 +1100695QUIET, FATAL, ERROR, INFO, VERBOSE and DEBUG.
Damien Miller5ce662a1999-11-11 17:57:39 +1100696The default is INFO.
Damien Miller32aa1441999-10-29 09:15:49 +1000697.It Cm NumberOfPasswordPrompts
Damien Miller450a7a12000-03-26 13:04:51 +1000698Specifies the number of password prompts before giving up.
699The argument to this keyword must be an integer.
700Default is 3.
Damien Miller396691a2000-01-20 22:44:08 +1100701.It Cm PasswordAuthentication
Damien Miller7684ee12000-03-17 23:40:15 +1100702Specifies whether to use password authentication.
703The argument to this keyword must be
Damien Miller396691a2000-01-20 22:44:08 +1100704.Dq yes
705or
706.Dq no .
Damien Miller32aa1441999-10-29 09:15:49 +1000707.It Cm Port
Damien Miller7684ee12000-03-17 23:40:15 +1100708Specifies the port number to connect on the remote host.
709Default is 22.
Damien Miller22c77262000-04-13 12:26:34 +1000710.It Cm Protocol
711Specifies the protocol versions
712.Nm
713should support in order of preference.
714The possible values are
715.Dq 1
716and
717.Dq 2 .
718Multiple versions must be comma-separated.
719The default is
720.Dq 1 .
Damien Miller32aa1441999-10-29 09:15:49 +1000721.It Cm ProxyCommand
Damien Miller7684ee12000-03-17 23:40:15 +1100722Specifies the command to use to connect to the server.
723The command
724string extends to the end of the line, and is executed with
725.Pa /bin/sh .
726In the command string,
727.Ql %h
728will be substituted by the host name to
729connect and
730.Ql %p
731by the port.
732The command can be basically anything,
733and should read from its standard input and write to its standard output.
734It should eventually connect an
Damien Miller32aa1441999-10-29 09:15:49 +1000735.Xr sshd 8
736server running on some machine, or execute
737.Ic sshd -i
Damien Miller7684ee12000-03-17 23:40:15 +1100738somewhere.
739Host key management will be done using the
Damien Miller32aa1441999-10-29 09:15:49 +1000740HostName of the host being connected (defaulting to the name typed by
741the user).
Damien Milleraae6c611999-12-06 11:47:28 +1100742Note that
743.Cm CheckHostIP
744is not available for connects with a proxy command.
Damien Miller32aa1441999-10-29 09:15:49 +1000745.Pp
746.It Cm RemoteForward
747Specifies that a TCP/IP port on the remote machine be forwarded over
Damien Miller7684ee12000-03-17 23:40:15 +1100748the secure channel to given host:port from the local machine.
749The first argument must be a port number, and the second must be
750host:port.
751Multiple forwardings may be specified, and additional
752forwardings can be given on the command line.
753Only the superuser can forward privileged ports.
Damien Miller32aa1441999-10-29 09:15:49 +1000754.It Cm RhostsAuthentication
Damien Miller7684ee12000-03-17 23:40:15 +1100755Specifies whether to try rhosts based authentication.
756Note that this
Damien Miller32aa1441999-10-29 09:15:49 +1000757declaration only affects the client side and has no effect whatsoever
Damien Miller7684ee12000-03-17 23:40:15 +1100758on security.
759Disabling rhosts authentication may reduce
Damien Miller32aa1441999-10-29 09:15:49 +1000760authentication time on slow connections when rhosts authentication is
Damien Miller7684ee12000-03-17 23:40:15 +1100761not used.
762Most servers do not permit RhostsAuthentication because it
763is not secure (see RhostsRSAAuthentication).
764The argument to this keyword must be
Damien Miller32aa1441999-10-29 09:15:49 +1000765.Dq yes
766or
767.Dq no .
768.It Cm RhostsRSAAuthentication
769Specifies whether to try rhosts based authentication with RSA host
Damien Miller7684ee12000-03-17 23:40:15 +1100770authentication.
771This is the primary authentication method for most sites.
772The argument must be
Damien Miller32aa1441999-10-29 09:15:49 +1000773.Dq yes
774or
775.Dq no .
776.It Cm RSAAuthentication
Damien Miller7684ee12000-03-17 23:40:15 +1100777Specifies whether to try RSA authentication.
778The argument to this keyword must be
Damien Miller32aa1441999-10-29 09:15:49 +1000779.Dq yes
780or
781.Dq no .
782RSA authentication will only be
783attempted if the identity file exists, or an authentication agent is
784running.
Damien Miller95def091999-11-25 00:26:21 +1100785.It Cm SkeyAuthentication
786Specifies whether to use
787.Xr skey 1
Damien Miller7684ee12000-03-17 23:40:15 +1100788authentication.
789The argument to this keyword must be
Damien Miller95def091999-11-25 00:26:21 +1100790.Dq yes
791or
792.Dq no .
793The default is
794.Dq no .
Damien Miller32aa1441999-10-29 09:15:49 +1000795.It Cm StrictHostKeyChecking
796If this flag is set to
Damien Miller22c77262000-04-13 12:26:34 +1000797.Dq yes ,
Damien Miller32aa1441999-10-29 09:15:49 +1000798.Nm
799ssh will never automatically add host keys to the
800.Pa $HOME/.ssh/known_hosts
Damien Miller7684ee12000-03-17 23:40:15 +1100801file, and refuses to connect hosts whose host key has changed.
802This provides maximum protection against trojan horse attacks.
803However, it can be somewhat annoying if you don't have good
Damien Miller886c63a2000-01-20 23:13:36 +1100804.Pa /etc/ssh_known_hosts
Damien Miller32aa1441999-10-29 09:15:49 +1000805files installed and frequently
Damien Miller7684ee12000-03-17 23:40:15 +1100806connect new hosts.
807Basically this option forces the user to manually
808add any new hosts.
809Normally this option is disabled, and new hosts
810will automatically be added to the known host files.
811The host keys of
812known hosts will be verified automatically in either case.
813The argument must be
Damien Miller32aa1441999-10-29 09:15:49 +1000814.Dq yes
815or
816.Dq no .
Damien Miller32aa1441999-10-29 09:15:49 +1000817.It Cm UsePrivilegedPort
818Specifies whether to use a privileged port for outgoing connections.
819The argument must be
820.Dq yes
821or
822.Dq no .
823The default is
824.Dq yes .
825Note that setting this option to
826.Dq no
Damien Millera34a28b1999-12-14 10:47:15 +1100827turns off
Damien Miller32aa1441999-10-29 09:15:49 +1000828.Cm RhostsAuthentication
829and
830.Cm RhostsRSAAuthentication .
Damien Miller396691a2000-01-20 22:44:08 +1100831.It Cm User
Damien Miller7684ee12000-03-17 23:40:15 +1100832Specifies the user to log in as.
833This can be useful if you have a different user name on different machines.
834This saves the trouble of
Damien Miller396691a2000-01-20 22:44:08 +1100835having to remember to give the user name on the command line.
836.It Cm UserKnownHostsFile
837Specifies a file to use instead of
838.Pa $HOME/.ssh/known_hosts .
Damien Miller32aa1441999-10-29 09:15:49 +1000839.It Cm UseRsh
Damien Miller7684ee12000-03-17 23:40:15 +1100840Specifies that rlogin/rsh should be used for this host.
841It is possible that the host does not at all support the
Damien Miller32aa1441999-10-29 09:15:49 +1000842.Nm
Damien Miller7684ee12000-03-17 23:40:15 +1100843protocol.
844This causes
Damien Miller32aa1441999-10-29 09:15:49 +1000845.Nm
Damien Miller7684ee12000-03-17 23:40:15 +1100846to immediately execute
Damien Miller32aa1441999-10-29 09:15:49 +1000847.Xr rsh 1 .
848All other options (except
849.Cm HostName )
Damien Miller7684ee12000-03-17 23:40:15 +1100850are ignored if this has been specified.
851The argument must be
Damien Miller32aa1441999-10-29 09:15:49 +1000852.Dq yes
853or
854.Dq no .
855.Sh ENVIRONMENT
856.Nm
857will normally set the following environment variables:
858.Bl -tag -width Ds
859.It Ev DISPLAY
860The
861.Ev DISPLAY
Damien Miller7684ee12000-03-17 23:40:15 +1100862variable indicates the location of the X11 server.
Damien Miller22c77262000-04-13 12:26:34 +1000863It is automatically set by
Damien Miller32aa1441999-10-29 09:15:49 +1000864.Nm
865to point to a value of the form
866.Dq hostname:n
867where hostname indicates
Damien Miller7684ee12000-03-17 23:40:15 +1100868the host where the shell runs, and n is an integer >= 1.
869.Nm
870uses this special value to forward X11 connections over the secure
871channel.
872The user should normally not set DISPLAY explicitly, as that
Damien Miller32aa1441999-10-29 09:15:49 +1000873will render the X11 connection insecure (and will require the user to
874manually copy any required authorization cookies).
875.It Ev HOME
876Set to the path of the user's home directory.
877.It Ev LOGNAME
878Synonym for
879.Ev USER ;
880set for compatibility with systems that use this variable.
881.It Ev MAIL
882Set to point the user's mailbox.
Damien Miller7684ee12000-03-17 23:40:15 +1100883.It Ev PATH
Damien Miller32aa1441999-10-29 09:15:49 +1000884Set to the default
885.Ev PATH ,
886as specified when compiling
887.Nm ssh .
888.It Ev SSH_AUTH_SOCK
889indicates the path of a unix-domain socket used to communicate with the
890agent.
891.It Ev SSH_CLIENT
Damien Miller7684ee12000-03-17 23:40:15 +1100892Identifies the client end of the connection.
893The variable contains
Damien Miller32aa1441999-10-29 09:15:49 +1000894three space-separated values: client ip-address, client port number,
895and server port number.
896.It Ev SSH_TTY
897This is set to the name of the tty (path to the device) associated
Damien Miller7684ee12000-03-17 23:40:15 +1100898with the current shell or command.
899If the current session has no tty,
Damien Miller32aa1441999-10-29 09:15:49 +1000900this variable is not set.
901.It Ev TZ
902The timezone variable is set to indicate the present timezone if it
903was set when the daemon was started (e.i., the daemon passes the value
904on to new connections).
905.It Ev USER
906Set to the name of the user logging in.
907.El
908.Pp
Damien Miller22c77262000-04-13 12:26:34 +1000909Additionally,
Damien Miller32aa1441999-10-29 09:15:49 +1000910.Nm
Damien Miller22c77262000-04-13 12:26:34 +1000911reads
912.Pa $HOME/.ssh/environment ,
Damien Miller32aa1441999-10-29 09:15:49 +1000913and adds lines of the format
914.Dq VARNAME=value
915to the environment.
916.Sh FILES
Damien Miller98c7ad62000-03-09 21:27:49 +1100917.Bl -tag -width Ds
Damien Miller32aa1441999-10-29 09:15:49 +1000918.It Pa $HOME/.ssh/known_hosts
919Records host keys for all hosts the user has logged into (that are not
920in
Damien Miller886c63a2000-01-20 23:13:36 +1100921.Pa /etc/ssh_known_hosts ) .
Damien Miller32aa1441999-10-29 09:15:49 +1000922See
923.Xr sshd 8 .
Damien Miller32aa1441999-10-29 09:15:49 +1000924.It Pa $HOME/.ssh/identity
Damien Miller7684ee12000-03-17 23:40:15 +1100925Contains the RSA authentication identity of the user.
926This file
Damien Miller32aa1441999-10-29 09:15:49 +1000927contains sensitive data and should be readable by the user but not
928accessible by others (read/write/execute).
929Note that
930.Nm
931ignores this file if it is accessible by others.
932It is possible to specify a passphrase when
933generating the key; the passphrase will be used to encrypt the
934sensitive part of this file using 3DES.
Damien Miller22c77262000-04-13 12:26:34 +1000935.It Pa $HOME/.ssh/identity.pub
Damien Miller32aa1441999-10-29 09:15:49 +1000936Contains the public key for authentication (public part of the
Damien Miller7684ee12000-03-17 23:40:15 +1100937identity file in human-readable form).
938The contents of this file should be added to
Damien Miller32aa1441999-10-29 09:15:49 +1000939.Pa $HOME/.ssh/authorized_keys
940on all machines
Damien Miller7684ee12000-03-17 23:40:15 +1100941where you wish to log in using RSA authentication.
942This file is not
943sensitive and can (but need not) be readable by anyone.
944This file is
Damien Miller32aa1441999-10-29 09:15:49 +1000945never used automatically and is not necessary; it is only provided for
946the convenience of the user.
947.It Pa $HOME/.ssh/config
Damien Miller7684ee12000-03-17 23:40:15 +1100948This is the per-user configuration file.
949The format of this file is described above.
950This file is used by the
Damien Miller32aa1441999-10-29 09:15:49 +1000951.Nm
Damien Miller7684ee12000-03-17 23:40:15 +1100952client.
953This file does not usually contain any sensitive information,
Damien Miller32aa1441999-10-29 09:15:49 +1000954but the recommended permissions are read/write for the user, and not
955accessible by others.
956.It Pa $HOME/.ssh/authorized_keys
Damien Miller7684ee12000-03-17 23:40:15 +1100957Lists the RSA keys that can be used for logging in as this user.
958The format of this file is described in the
Damien Miller32aa1441999-10-29 09:15:49 +1000959.Xr sshd 8
Damien Miller7684ee12000-03-17 23:40:15 +1100960manual page.
961In the simplest form the format is the same as the .pub
Damien Miller32aa1441999-10-29 09:15:49 +1000962identity files (that is, each line contains the number of bits in
963modulus, public exponent, modulus, and comment fields, separated by
Damien Miller7684ee12000-03-17 23:40:15 +1100964spaces).
965This file is not highly sensitive, but the recommended
Damien Miller32aa1441999-10-29 09:15:49 +1000966permissions are read/write for the user, and not accessible by others.
Damien Miller886c63a2000-01-20 23:13:36 +1100967.It Pa /etc/ssh_known_hosts
Damien Miller7684ee12000-03-17 23:40:15 +1100968Systemwide list of known host keys.
969This file should be prepared by the
Damien Miller32aa1441999-10-29 09:15:49 +1000970system administrator to contain the public host keys of all machines in the
Damien Miller7684ee12000-03-17 23:40:15 +1100971organization.
972This file should be world-readable.
973This file contains
Damien Miller32aa1441999-10-29 09:15:49 +1000974public keys, one per line, in the following format (fields separated
975by spaces): system name, number of bits in modulus, public exponent,
Damien Miller7684ee12000-03-17 23:40:15 +1100976modulus, and optional comment field.
977When different names are used
Damien Miller32aa1441999-10-29 09:15:49 +1000978for the same machine, all such names should be listed, separated by
Damien Miller7684ee12000-03-17 23:40:15 +1100979commas.
980The format is described on the
Damien Miller32aa1441999-10-29 09:15:49 +1000981.Xr sshd 8
982manual page.
983.Pp
984The canonical system name (as returned by name servers) is used by
985.Xr sshd 8
986to verify the client host when logging in; other names are needed because
987.Nm
988does not convert the user-supplied name to a canonical name before
989checking the key, because someone with access to the name servers
990would then be able to fool host authentication.
Damien Miller886c63a2000-01-20 23:13:36 +1100991.It Pa /etc/ssh_config
Damien Miller7684ee12000-03-17 23:40:15 +1100992Systemwide configuration file.
993This file provides defaults for those
Damien Miller32aa1441999-10-29 09:15:49 +1000994values that are not specified in the user's configuration file, and
Damien Miller7684ee12000-03-17 23:40:15 +1100995for those users who do not have a configuration file.
996This file must be world-readable.
Damien Miller32aa1441999-10-29 09:15:49 +1000997.It Pa $HOME/.rhosts
998This file is used in
999.Pa \&.rhosts
1000authentication to list the
Damien Miller7684ee12000-03-17 23:40:15 +11001001host/user pairs that are permitted to log in.
1002(Note that this file is
Damien Miller32aa1441999-10-29 09:15:49 +10001003also used by rlogin and rsh, which makes using this file insecure.)
1004Each line of the file contains a host name (in the canonical form
1005returned by name servers), and then a user name on that host,
Damien Miller7684ee12000-03-17 23:40:15 +11001006separated by a space.
1007One some machines this file may need to be
Damien Miller32aa1441999-10-29 09:15:49 +10001008world-readable if the user's home directory is on a NFS partition,
1009because
1010.Xr sshd 8
Damien Miller7684ee12000-03-17 23:40:15 +11001011reads it as root.
1012Additionally, this file must be owned by the user,
1013and must not have write permissions for anyone else.
1014The recommended
Damien Miller32aa1441999-10-29 09:15:49 +10001015permission for most machines is read/write for the user, and not
1016accessible by others.
1017.Pp
1018Note that by default
1019.Xr sshd 8
1020will be installed so that it requires successful RSA host
Damien Miller7684ee12000-03-17 23:40:15 +11001021authentication before permitting \s+2.\s0rhosts authentication.
1022If your server machine does not have the client's host key in
Damien Miller886c63a2000-01-20 23:13:36 +11001023.Pa /etc/ssh_known_hosts ,
Damien Miller32aa1441999-10-29 09:15:49 +10001024you can store it in
1025.Pa $HOME/.ssh/known_hosts .
1026The easiest way to do this is to
1027connect back to the client from the server machine using ssh; this
1028will automatically add the host key inxi
1029.Pa $HOME/.ssh/known_hosts .
1030.It Pa $HOME/.shosts
1031This file is used exactly the same way as
1032.Pa \&.rhosts .
1033The purpose for
1034having this file is to be able to use rhosts authentication with
1035.Nm
1036without permitting login with
1037.Xr rlogin 1
1038or
1039.Xr rsh 1 .
1040.It Pa /etc/hosts.equiv
1041This file is used during
Damien Miller7684ee12000-03-17 23:40:15 +11001042.Pa \&.rhosts authentication.
1043It contains
Damien Miller32aa1441999-10-29 09:15:49 +10001044canonical hosts names, one per line (the full format is described on
1045the
1046.Xr sshd 8
Damien Miller7684ee12000-03-17 23:40:15 +11001047manual page).
1048If the client host is found in this file, login is
Damien Miller32aa1441999-10-29 09:15:49 +10001049automatically permitted provided client and server user names are the
Damien Miller7684ee12000-03-17 23:40:15 +11001050same.
1051Additionally, successful RSA host authentication is normally
1052required.
1053This file should only be writable by root.
Damien Miller886c63a2000-01-20 23:13:36 +11001054.It Pa /etc/shosts.equiv
Damien Miller22c77262000-04-13 12:26:34 +10001055This file is processed exactly as
Damien Miller32aa1441999-10-29 09:15:49 +10001056.Pa /etc/hosts.equiv .
1057This file may be useful to permit logins using
1058.Nm
1059but not using rsh/rlogin.
Damien Miller886c63a2000-01-20 23:13:36 +11001060.It Pa /etc/sshrc
Damien Miller32aa1441999-10-29 09:15:49 +10001061Commands in this file are executed by
1062.Nm
1063when the user logs in just before the user's shell (or command) is started.
1064See the
1065.Xr sshd 8
1066manual page for more information.
1067.It Pa $HOME/.ssh/rc
1068Commands in this file are executed by
1069.Nm
1070when the user logs in just before the user's shell (or command) is
1071started.
Damien Miller22c77262000-04-13 12:26:34 +10001072See the
Damien Miller32aa1441999-10-29 09:15:49 +10001073.Xr sshd 8
1074manual page for more information.
Damien Miller4f0fa561999-12-26 14:24:41 +11001075.It Pa $HOME/.ssh/environment
1076Contains additional definitions for environment variables, see section
1077.Sx ENVIRONMENT
1078above.
Damien Miller32aa1441999-10-29 09:15:49 +10001079.It Pa libcrypto.so.X.1
1080A version of this library which includes support for the RSA algorithm
1081is required for proper operation.
1082.Sh AUTHOR
Damien Miller32aa1441999-10-29 09:15:49 +10001083OpenSSH
Damien Miller98c7ad62000-03-09 21:27:49 +11001084is a derivative of the original (free) ssh 1.2.12 release by Tatu Ylonen,
Damien Miller7684ee12000-03-17 23:40:15 +11001085but with bugs removed and newer features re-added.
1086Rapidly after the
Damien Miller98c7ad62000-03-09 21:27:49 +110010871.2.12 release, newer versions of the original ssh bore successively
1088more restrictive licenses, and thus demand for a free version was born.
1089This version of OpenSSH
Damien Miller32aa1441999-10-29 09:15:49 +10001090.Bl -bullet
1091.It
Damien Miller14537852000-01-22 19:57:40 +11001092has all components of a restrictive nature (i.e., patents, see
Damien Miller32aa1441999-10-29 09:15:49 +10001093.Xr ssl 8 )
1094directly removed from the source code; any licensed or patented components
1095are chosen from
1096external libraries.
1097.It
Damien Miller98c7ad62000-03-09 21:27:49 +11001098has been updated to support ssh protocol 1.5, making it compatible with
1099all other ssh protocol 1 clients and servers.
Damien Miller32aa1441999-10-29 09:15:49 +10001100.It
Damien Miller22c77262000-04-13 12:26:34 +10001101contains added support for
Damien Miller32aa1441999-10-29 09:15:49 +10001102.Xr kerberos 8
1103authentication and ticket passing.
1104.It
1105supports one-time password authentication with
1106.Xr skey 1 .
1107.El
1108.Pp
1109The libraries described in
1110.Xr ssl 8
1111are required for proper operation.
Damien Miller10f6f6b1999-11-17 17:29:08 +11001112.Pp
Damien Miller6ee95641999-11-18 11:35:13 +11001113OpenSSH has been created by Aaron Campbell, Bob Beck, Markus Friedl,
Damien Miller10f6f6b1999-11-17 17:29:08 +11001114Niels Provos, Theo de Raadt, and Dug Song.
Damien Miller32aa1441999-10-29 09:15:49 +10001115.Sh SEE ALSO
1116.Xr rlogin 1 ,
1117.Xr rsh 1 ,
1118.Xr scp 1 ,
1119.Xr ssh-add 1 ,
1120.Xr ssh-agent 1 ,
1121.Xr ssh-keygen 1 ,
1122.Xr telnet 1 ,
1123.Xr sshd 8 ,
1124.Xr ssl 8