xref: /titanic_44/usr/src/cmd/ssh/doc/README.Ylonen (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate
2*7c478bd9Sstevel@tonic-gate[ Please note that this file has not been updated for OpenSSH and
3*7c478bd9Sstevel@tonic-gate  covers the ssh-1.2.12 release from Dec 1995 only. ]
4*7c478bd9Sstevel@tonic-gate
5*7c478bd9Sstevel@tonic-gateSsh (Secure Shell) is a program to log into another computer over a
6*7c478bd9Sstevel@tonic-gatenetwork, to execute commands in a remote machine, and to move files
7*7c478bd9Sstevel@tonic-gatefrom one machine to another.  It provides strong authentication and
8*7c478bd9Sstevel@tonic-gatesecure communications over insecure channels.  It is inteded as a
9*7c478bd9Sstevel@tonic-gatereplacement for rlogin, rsh, rcp, and rdist.
10*7c478bd9Sstevel@tonic-gate
11*7c478bd9Sstevel@tonic-gateSee the file INSTALL for installation instructions.  See COPYING for
12*7c478bd9Sstevel@tonic-gatelicense terms and other legal issues.  See RFC for a description of
13*7c478bd9Sstevel@tonic-gatethe protocol.  There is a WWW page for ssh; see http://www.cs.hut.fi/ssh.
14*7c478bd9Sstevel@tonic-gate
15*7c478bd9Sstevel@tonic-gateThis file has been updated to match ssh-1.2.12.
16*7c478bd9Sstevel@tonic-gate
17*7c478bd9Sstevel@tonic-gate
18*7c478bd9Sstevel@tonic-gateFEATURES
19*7c478bd9Sstevel@tonic-gate
20*7c478bd9Sstevel@tonic-gate o  Strong authentication.  Closes several security holes (e.g., IP,
21*7c478bd9Sstevel@tonic-gate    routing, and DNS spoofing).  New authentication methods: .rhosts
22*7c478bd9Sstevel@tonic-gate    together with RSA based host authentication, and pure RSA
23*7c478bd9Sstevel@tonic-gate    authentication.
24*7c478bd9Sstevel@tonic-gate
25*7c478bd9Sstevel@tonic-gate o  Improved privacy.  All communications are automatically and
26*7c478bd9Sstevel@tonic-gate    transparently encrypted.  RSA is used for key exchange, and a
27*7c478bd9Sstevel@tonic-gate    conventional cipher (normally IDEA, DES, or triple-DES) for
28*7c478bd9Sstevel@tonic-gate    encrypting the session.  Encryption is started before
29*7c478bd9Sstevel@tonic-gate    authentication, and no passwords or other information is
30*7c478bd9Sstevel@tonic-gate    transmitted in the clear.  Encryption is also used to protect
31*7c478bd9Sstevel@tonic-gate    against spoofed packets.
32*7c478bd9Sstevel@tonic-gate
33*7c478bd9Sstevel@tonic-gate o  Secure X11 sessions.  The program automatically sets DISPLAY on
34*7c478bd9Sstevel@tonic-gate    the server machine, and forwards any X11 connections over the
35*7c478bd9Sstevel@tonic-gate    secure channel.  Fake Xauthority information is automatically
36*7c478bd9Sstevel@tonic-gate    generated and forwarded to the remote machine; the local client
37*7c478bd9Sstevel@tonic-gate    automatically examines incoming X11 connections and replaces the
38*7c478bd9Sstevel@tonic-gate    fake authorization data with the real data (never telling the
39*7c478bd9Sstevel@tonic-gate    remote machine the real information).
40*7c478bd9Sstevel@tonic-gate
41*7c478bd9Sstevel@tonic-gate o  Arbitrary TCP/IP ports can be redirected through the encrypted channel
42*7c478bd9Sstevel@tonic-gate    in both directions (e.g., for e-cash transactions).
43*7c478bd9Sstevel@tonic-gate
44*7c478bd9Sstevel@tonic-gate o  No retraining needed for normal users; everything happens
45*7c478bd9Sstevel@tonic-gate    automatically, and old .rhosts files will work with strong
46*7c478bd9Sstevel@tonic-gate    authentication if administration installs host key files.
47*7c478bd9Sstevel@tonic-gate
48*7c478bd9Sstevel@tonic-gate o  Never trusts the network.  Minimal trust on the remote side of
49*7c478bd9Sstevel@tonic-gate    the connection.  Minimal trust on domain name servers.  Pure RSA
50*7c478bd9Sstevel@tonic-gate    authentication never trusts anything but the private key.
51*7c478bd9Sstevel@tonic-gate
52*7c478bd9Sstevel@tonic-gate o  Client RSA-authenticates the server machine in the beginning of
53*7c478bd9Sstevel@tonic-gate    every connection to prevent trojan horses (by routing or DNS
54*7c478bd9Sstevel@tonic-gate    spoofing) and man-in-the-middle attacks, and the server
55*7c478bd9Sstevel@tonic-gate    RSA-authenticates the client machine before accepting .rhosts or
56*7c478bd9Sstevel@tonic-gate    /etc/hosts.equiv authentication (to prevent DNS, routing, or
57*7c478bd9Sstevel@tonic-gate    IP-spoofing).
58*7c478bd9Sstevel@tonic-gate
59*7c478bd9Sstevel@tonic-gate o  Host authentication key distribution can be centrally by the
60*7c478bd9Sstevel@tonic-gate    administration, automatically when the first connection is made
61*7c478bd9Sstevel@tonic-gate    to a machine (the key obtained on the first connection will be
62*7c478bd9Sstevel@tonic-gate    recorded and used for authentication in the future), or manually
63*7c478bd9Sstevel@tonic-gate    by each user for his/her own use.  The central and per-user host
64*7c478bd9Sstevel@tonic-gate    key repositories are both used and complement each other.  Host
65*7c478bd9Sstevel@tonic-gate    keys can be generated centrally or automatically when the software
66*7c478bd9Sstevel@tonic-gate    is installed.  Host authentication keys are typically 1024 bits.
67*7c478bd9Sstevel@tonic-gate
68*7c478bd9Sstevel@tonic-gate o  Any user can create any number of user authentication RSA keys for
69*7c478bd9Sstevel@tonic-gate    his/her own use.  Each user has a file which lists the RSA public
70*7c478bd9Sstevel@tonic-gate    keys for which proof of possession of the corresponding private
71*7c478bd9Sstevel@tonic-gate    key is accepted as authentication.  User authentication keys are
72*7c478bd9Sstevel@tonic-gate    typically 1024 bits.
73*7c478bd9Sstevel@tonic-gate
74*7c478bd9Sstevel@tonic-gate o  The server program has its own server RSA key which is
75*7c478bd9Sstevel@tonic-gate    automatically regenerated every hour.  This key is never saved in
76*7c478bd9Sstevel@tonic-gate    any file.  Exchanged session keys are encrypted using both the
77*7c478bd9Sstevel@tonic-gate    server key and the server host key.  The purpose of the separate
78*7c478bd9Sstevel@tonic-gate    server key is to make it impossible to decipher a captured session by
79*7c478bd9Sstevel@tonic-gate    breaking into the server machine at a later time; one hour from
80*7c478bd9Sstevel@tonic-gate    the connection even the server machine cannot decipher the session
81*7c478bd9Sstevel@tonic-gate    key.  The key regeneration interval is configurable.  The server
82*7c478bd9Sstevel@tonic-gate    key is normally 768 bits.
83*7c478bd9Sstevel@tonic-gate
84*7c478bd9Sstevel@tonic-gate o  An authentication agent, running in the user's laptop or local
85*7c478bd9Sstevel@tonic-gate    workstation, can be used to hold the user's RSA authentication
86*7c478bd9Sstevel@tonic-gate    keys.  Ssh automatically forwards the connection to the
87*7c478bd9Sstevel@tonic-gate    authentication agent over any connections, and there is no need to
88*7c478bd9Sstevel@tonic-gate    store the RSA authentication keys on any machine in the network
89*7c478bd9Sstevel@tonic-gate    (except the user's own local machine).  The authentication
90*7c478bd9Sstevel@tonic-gate    protocols never reveal the keys; they can only be used to verify
91*7c478bd9Sstevel@tonic-gate    that the user's agent has a certain key.  Eventually the agent
92*7c478bd9Sstevel@tonic-gate    could rely on a smart card to perform all authentication
93*7c478bd9Sstevel@tonic-gate    computations.
94*7c478bd9Sstevel@tonic-gate
95*7c478bd9Sstevel@tonic-gate o  The software can be installed and used (with restricted
96*7c478bd9Sstevel@tonic-gate    functionality) even without root privileges.
97*7c478bd9Sstevel@tonic-gate
98*7c478bd9Sstevel@tonic-gate o  The client is customizable in system-wide and per-user
99*7c478bd9Sstevel@tonic-gate    configuration files.  Most aspects of the client's operation can
100*7c478bd9Sstevel@tonic-gate    be configured.  Different options can be specified on a per-host basis.
101*7c478bd9Sstevel@tonic-gate
102*7c478bd9Sstevel@tonic-gate o  Automatically executes conventional rsh (after displaying a
103*7c478bd9Sstevel@tonic-gate    warning) if the server machine is not running sshd.
104*7c478bd9Sstevel@tonic-gate
105*7c478bd9Sstevel@tonic-gate o  Optional compression of all data with gzip (including forwarded X11
106*7c478bd9Sstevel@tonic-gate    and TCP/IP port data), which may result in significant speedups on
107*7c478bd9Sstevel@tonic-gate    slow connections.
108*7c478bd9Sstevel@tonic-gate
109*7c478bd9Sstevel@tonic-gate o  Complete replacement for rlogin, rsh, and rcp.
110*7c478bd9Sstevel@tonic-gate
111*7c478bd9Sstevel@tonic-gate
112*7c478bd9Sstevel@tonic-gateWHY TO USE SECURE SHELL
113*7c478bd9Sstevel@tonic-gate
114*7c478bd9Sstevel@tonic-gateCurrently, almost all communications in computer networks are done
115*7c478bd9Sstevel@tonic-gatewithout encryption.  As a consequence, anyone who has access to any
116*7c478bd9Sstevel@tonic-gatemachine connected to the network can listen in on any communication.
117*7c478bd9Sstevel@tonic-gateThis is being done by hackers, curious administrators, employers,
118*7c478bd9Sstevel@tonic-gatecriminals, industrial spies, and governments.  Some networks leak off
119*7c478bd9Sstevel@tonic-gateenough electromagnetic radiation that data may be captured even from a
120*7c478bd9Sstevel@tonic-gatedistance.
121*7c478bd9Sstevel@tonic-gate
122*7c478bd9Sstevel@tonic-gateWhen you log in, your password goes in the network in plain
123*7c478bd9Sstevel@tonic-gatetext.  Thus, any listener can then use your account to do any evil he
124*7c478bd9Sstevel@tonic-gatelikes.  Many incidents have been encountered worldwide where crackers
125*7c478bd9Sstevel@tonic-gatehave started programs on workstations without the owners knowledge
126*7c478bd9Sstevel@tonic-gatejust to listen to the network and collect passwords.  Programs for
127*7c478bd9Sstevel@tonic-gatedoing this are available on the Internet, or can be built by a
128*7c478bd9Sstevel@tonic-gatecompetent programmer in a few hours.
129*7c478bd9Sstevel@tonic-gate
130*7c478bd9Sstevel@tonic-gateAny information that you type or is printed on your screen can be
131*7c478bd9Sstevel@tonic-gatemonitored, recorded, and analyzed.  For example, an intruder who has
132*7c478bd9Sstevel@tonic-gatepenetrated a host connected to a major network can start a program
133*7c478bd9Sstevel@tonic-gatethat listens to all data flowing in the network, and whenever it
134*7c478bd9Sstevel@tonic-gateencounters a 16-digit string, it checks if it is a valid credit card
135*7c478bd9Sstevel@tonic-gatenumber (using the check digit), and saves the number plus any
136*7c478bd9Sstevel@tonic-gatesurrounding text (to catch expiration date and holder) in a file.
137*7c478bd9Sstevel@tonic-gateWhen the intruder has collected a few thousand credit card numbers, he
138*7c478bd9Sstevel@tonic-gatemakes smallish mail-order purchases from a few thousand stores around
139*7c478bd9Sstevel@tonic-gatethe world, and disappears when the goods arrive but before anyone
140*7c478bd9Sstevel@tonic-gatesuspects anything.
141*7c478bd9Sstevel@tonic-gate
142*7c478bd9Sstevel@tonic-gateBusinesses have trade secrets, patent applications in preparation,
143*7c478bd9Sstevel@tonic-gatepricing information, subcontractor information, client data, personnel
144*7c478bd9Sstevel@tonic-gatedata, financial information, etc.  Currently, anyone with access to
145*7c478bd9Sstevel@tonic-gatethe network (any machine on the network) can listen to anything that
146*7c478bd9Sstevel@tonic-gategoes in the network, without any regard to normal access restrictions.
147*7c478bd9Sstevel@tonic-gate
148*7c478bd9Sstevel@tonic-gateMany companies are not aware that information can so easily be
149*7c478bd9Sstevel@tonic-gaterecovered from the network.  They trust that their data is safe
150*7c478bd9Sstevel@tonic-gatesince nobody is supposed to know that there is sensitive information
151*7c478bd9Sstevel@tonic-gatein the network, or because so much other data is transferred in the
152*7c478bd9Sstevel@tonic-gatenetwork.  This is not a safe policy.
153*7c478bd9Sstevel@tonic-gate
154*7c478bd9Sstevel@tonic-gateIndividual persons also have confidential information, such as
155*7c478bd9Sstevel@tonic-gatediaries, love letters, health care documents, information about their
156*7c478bd9Sstevel@tonic-gatepersonal interests and habits, professional data, job applications,
157*7c478bd9Sstevel@tonic-gatetax reports, political documents, unpublished manuscripts, etc.
158*7c478bd9Sstevel@tonic-gate
159*7c478bd9Sstevel@tonic-gateOne should also be aware that economical intelligence and industrial
160*7c478bd9Sstevel@tonic-gateespionage has recently become a major priority of the intelligence
161*7c478bd9Sstevel@tonic-gateagencies of major governments.  President Clinton recently assigned
162*7c478bd9Sstevel@tonic-gateeconomical espionage as the primary task of the CIA, and the French
163*7c478bd9Sstevel@tonic-gatehave repeatedly been publicly boasting about their achievements on
164*7c478bd9Sstevel@tonic-gatethis field.
165*7c478bd9Sstevel@tonic-gate
166*7c478bd9Sstevel@tonic-gate
167*7c478bd9Sstevel@tonic-gateThere is also another frightening aspect about the poor security of
168*7c478bd9Sstevel@tonic-gatecommunications.  Computer storage and analysis capability has
169*7c478bd9Sstevel@tonic-gateincreased so much that it is feasible for governments, major
170*7c478bd9Sstevel@tonic-gatecompanies, and criminal organizations to automatically analyze,
171*7c478bd9Sstevel@tonic-gateidentify, classify, and file information about millions of people over
172*7c478bd9Sstevel@tonic-gatethe years.  Because most of the work can be automated, the cost of
173*7c478bd9Sstevel@tonic-gatecollecting this information is getting very low.
174*7c478bd9Sstevel@tonic-gate
175*7c478bd9Sstevel@tonic-gateGovernment agencies may be able to monitor major communication
176*7c478bd9Sstevel@tonic-gatesystems, telephones, fax, computer networks, etc., and passively
177*7c478bd9Sstevel@tonic-gatecollect huge amounts of information about all people with any
178*7c478bd9Sstevel@tonic-gatesignificant position in the society.  Most of this information is not
179*7c478bd9Sstevel@tonic-gatesensitive, and many people would say there is no harm in someone
180*7c478bd9Sstevel@tonic-gategetting that information.  However, the information starts to get
181*7c478bd9Sstevel@tonic-gatesensitive when someone has enough of it.  You may not mind someone
182*7c478bd9Sstevel@tonic-gateknowing what you bought from the shop one random day, but you might
183*7c478bd9Sstevel@tonic-gatenot like someone knowing every small thing you have bought in the last
184*7c478bd9Sstevel@tonic-gateten years.
185*7c478bd9Sstevel@tonic-gate
186*7c478bd9Sstevel@tonic-gateIf the government some day starts to move into a more totalitarian
187*7c478bd9Sstevel@tonic-gatedirection (one should remember that Nazi Germany was created by
188*7c478bd9Sstevel@tonic-gatedemocratic elections), there is considerable danger of an ultimate
189*7c478bd9Sstevel@tonic-gatetotalitarian state.  With enough information (the automatically
190*7c478bd9Sstevel@tonic-gatecollected records of an individual can be manually analyzed when the
191*7c478bd9Sstevel@tonic-gateperson becomes interesting), one can form a very detailed picture of
192*7c478bd9Sstevel@tonic-gatethe individual's interests, opinions, beliefs, habits, friends,
193*7c478bd9Sstevel@tonic-gatelovers, weaknesses, etc.  This information can be used to 1) locate
194*7c478bd9Sstevel@tonic-gateany persons who might oppose the new system 2) use deception to
195*7c478bd9Sstevel@tonic-gatedisturb any organizations which might rise against the government 3)
196*7c478bd9Sstevel@tonic-gateeliminate difficult individuals without anyone understanding what
197*7c478bd9Sstevel@tonic-gatehappened.  Additionally, if the government can monitor communications
198*7c478bd9Sstevel@tonic-gatetoo effectively, it becomes too easy to locate and eliminate any
199*7c478bd9Sstevel@tonic-gatepersons distributing information contrary to the official truth.
200*7c478bd9Sstevel@tonic-gate
201*7c478bd9Sstevel@tonic-gateFighting crime and terrorism are often used as grounds for domestic
202*7c478bd9Sstevel@tonic-gatesurveillance and restricting encryption.  These are good goals, but
203*7c478bd9Sstevel@tonic-gatethere is considerable danger that the surveillance data starts to get
204*7c478bd9Sstevel@tonic-gateused for questionable purposes.  I find that it is better to tolerate
205*7c478bd9Sstevel@tonic-gatea small amount of crime in the society than to let the society become
206*7c478bd9Sstevel@tonic-gatefully controlled.  I am in favor of a fairly strong state, but the
207*7c478bd9Sstevel@tonic-gatestate must never get so strong that people become unable to spread
208*7c478bd9Sstevel@tonic-gatecontra-offical information and unable to overturn the government if it
209*7c478bd9Sstevel@tonic-gateis bad.  The danger is that when you notice that the government is
210*7c478bd9Sstevel@tonic-gatetoo powerful, it is too late.  Also, the real power may not be where
211*7c478bd9Sstevel@tonic-gatethe official government is.
212*7c478bd9Sstevel@tonic-gate
213*7c478bd9Sstevel@tonic-gateFor these reasons (privacy, protecting trade secrets, and making it
214*7c478bd9Sstevel@tonic-gatemore difficult to create a totalitarian state), I think that strong
215*7c478bd9Sstevel@tonic-gatecryptography should be integrated to the tools we use every day.
216*7c478bd9Sstevel@tonic-gateUsing it causes no harm (except for those who wish to monitor
217*7c478bd9Sstevel@tonic-gateeverything), but not using it can cause huge problems.  If the society
218*7c478bd9Sstevel@tonic-gatechanges in undesirable ways, then it will be to late to start
219*7c478bd9Sstevel@tonic-gateencrypting.
220*7c478bd9Sstevel@tonic-gate
221*7c478bd9Sstevel@tonic-gateEncryption has had a "military" or "classified" flavor to it.  There
222*7c478bd9Sstevel@tonic-gateare no longer any grounds for this.  The military can and will use its
223*7c478bd9Sstevel@tonic-gateown encryption; that is no excuse to prevent the civilians from
224*7c478bd9Sstevel@tonic-gateprotecting their privacy and secrets.  Information on strong
225*7c478bd9Sstevel@tonic-gateencryption is available in every major bookstore, scientific library,
226*7c478bd9Sstevel@tonic-gateand patent office around the world, and strong encryption software is
227*7c478bd9Sstevel@tonic-gateavailable in every country on the Internet.
228*7c478bd9Sstevel@tonic-gate
229*7c478bd9Sstevel@tonic-gateSome people would like to make it illegal to use encryption, or to
230*7c478bd9Sstevel@tonic-gateforce people to use encryption that governments can break.  This
231*7c478bd9Sstevel@tonic-gateapproach offers no protection if the government turns bad.  Also, the
232*7c478bd9Sstevel@tonic-gate"bad guys" will be using true strong encryption anyway.  Good
233*7c478bd9Sstevel@tonic-gateencryption techniques are too widely known to make them disappear.
234*7c478bd9Sstevel@tonic-gateThus, any "key escrow encryption" or other restrictions will only help
235*7c478bd9Sstevel@tonic-gatemonitor ordinary people and petty criminals.  It does not help against
236*7c478bd9Sstevel@tonic-gatepowerful criminals, terrorists, or espionage, because they will know
237*7c478bd9Sstevel@tonic-gatehow to use strong encryption anyway.  (One source for internationally
238*7c478bd9Sstevel@tonic-gateavailable encryption software is http://www.cs.hut.fi/crypto.)
239*7c478bd9Sstevel@tonic-gate
240*7c478bd9Sstevel@tonic-gate
241*7c478bd9Sstevel@tonic-gateOVERVIEW OF SECURE SHELL
242*7c478bd9Sstevel@tonic-gate
243*7c478bd9Sstevel@tonic-gateThe software consists of a number of programs.
244*7c478bd9Sstevel@tonic-gate
245*7c478bd9Sstevel@tonic-gate   sshd		Server program run on the server machine.  This
246*7c478bd9Sstevel@tonic-gate   		listens for connections from client machines, and
247*7c478bd9Sstevel@tonic-gate		whenever it receives a connection, it performs
248*7c478bd9Sstevel@tonic-gate		authentication and starts serving the client.
249*7c478bd9Sstevel@tonic-gate
250*7c478bd9Sstevel@tonic-gate   ssh		This is the client program used to log into another
251*7c478bd9Sstevel@tonic-gate		machine or to execute commands on the other machine.
252*7c478bd9Sstevel@tonic-gate		"slogin" is another name for this program.
253*7c478bd9Sstevel@tonic-gate
254*7c478bd9Sstevel@tonic-gate   scp		Securely copies files from one machine to another.
255*7c478bd9Sstevel@tonic-gate
256*7c478bd9Sstevel@tonic-gate   ssh-keygen	Used to create RSA keys (host keys and user
257*7c478bd9Sstevel@tonic-gate   		authentication keys).
258*7c478bd9Sstevel@tonic-gate
259*7c478bd9Sstevel@tonic-gate   ssh-agent	Authentication agent.  This can be used to hold RSA
260*7c478bd9Sstevel@tonic-gate   		keys for authentication.
261*7c478bd9Sstevel@tonic-gate
262*7c478bd9Sstevel@tonic-gate   ssh-add	Used to register new keys with the agent.
263*7c478bd9Sstevel@tonic-gate
264*7c478bd9Sstevel@tonic-gate   make-ssh-known-hosts
265*7c478bd9Sstevel@tonic-gate   		Used to create the /etc/ssh_known_hosts file.
266*7c478bd9Sstevel@tonic-gate
267*7c478bd9Sstevel@tonic-gate
268*7c478bd9Sstevel@tonic-gateSsh is the program users normally use.  It is started as
269*7c478bd9Sstevel@tonic-gate
270*7c478bd9Sstevel@tonic-gate  ssh host
271*7c478bd9Sstevel@tonic-gate
272*7c478bd9Sstevel@tonic-gateor
273*7c478bd9Sstevel@tonic-gate
274*7c478bd9Sstevel@tonic-gate  ssh host command
275*7c478bd9Sstevel@tonic-gate
276*7c478bd9Sstevel@tonic-gateThe first form opens a new shell on the remote machine (after
277*7c478bd9Sstevel@tonic-gateauthentication).  The latter form executes the command on the remote
278*7c478bd9Sstevel@tonic-gatemachine.
279*7c478bd9Sstevel@tonic-gate
280*7c478bd9Sstevel@tonic-gateWhen started, the ssh connects sshd on the server machine, verifies
281*7c478bd9Sstevel@tonic-gatethat the server machine really is the machine it wanted to connect,
282*7c478bd9Sstevel@tonic-gateexchanges encryption keys (in a manner which prevents an outside
283*7c478bd9Sstevel@tonic-gatelistener from getting the keys), performs authentication using .rhosts
284*7c478bd9Sstevel@tonic-gateand /etc/hosts.equiv, RSA authentication, or conventional password
285*7c478bd9Sstevel@tonic-gatebased authentication.  The server then (normally) allocates a
286*7c478bd9Sstevel@tonic-gatepseudo-terminal and starts an interactive shell or user program.
287*7c478bd9Sstevel@tonic-gate
288*7c478bd9Sstevel@tonic-gateThe TERM environment variable (describing the type of the user's
289*7c478bd9Sstevel@tonic-gateterminal) is passed from the client side to the remote side.  Also,
290*7c478bd9Sstevel@tonic-gateterminal modes will be copied from the client side to the remote side
291*7c478bd9Sstevel@tonic-gateto preserve user preferences (e.g., the erase character).
292*7c478bd9Sstevel@tonic-gate
293*7c478bd9Sstevel@tonic-gateIf the DISPLAY variable is set on the client side, the server will
294*7c478bd9Sstevel@tonic-gatecreate a dummy X server and set DISPLAY accordingly.  Any connections
295*7c478bd9Sstevel@tonic-gateto the dummy X server will be forwarded through the secure channel,
296*7c478bd9Sstevel@tonic-gateand will be made to the real X server from the client side.  An
297*7c478bd9Sstevel@tonic-gatearbitrary number of X programs can be started during the session, and
298*7c478bd9Sstevel@tonic-gatestarting them does not require anything special from the user.  (Note
299*7c478bd9Sstevel@tonic-gatethat the user must not manually set DISPLAY, because then it would
300*7c478bd9Sstevel@tonic-gateconnect directly to the real display instead of going through the
301*7c478bd9Sstevel@tonic-gateencrypted channel).  This behavior can be disabled in the
302*7c478bd9Sstevel@tonic-gateconfiguration file or by giving the -x option to the client.
303*7c478bd9Sstevel@tonic-gate
304*7c478bd9Sstevel@tonic-gateArbitrary IP ports can be forwarded over the secure channel.  The
305*7c478bd9Sstevel@tonic-gateprogram then creates a port on one side, and whenever a connection is
306*7c478bd9Sstevel@tonic-gateopened to this port, it will be passed over the secure channel, and a
307*7c478bd9Sstevel@tonic-gateconnection will be made from the other side to a specified host:port
308*7c478bd9Sstevel@tonic-gatepair.  Arbitrary IP forwarding must always be explicitly requested,
309*7c478bd9Sstevel@tonic-gateand cannot be used to forward privileged ports (unless the user is
310*7c478bd9Sstevel@tonic-gateroot).  It is possible to specify automatic forwards in a per-user
311*7c478bd9Sstevel@tonic-gateconfiguration file, for example to make electronic cash systems work
312*7c478bd9Sstevel@tonic-gatesecurely.
313*7c478bd9Sstevel@tonic-gate
314*7c478bd9Sstevel@tonic-gateIf there is an authentication agent on the client side, connection to
315*7c478bd9Sstevel@tonic-gateit will be automatically forwarded to the server side.
316*7c478bd9Sstevel@tonic-gate
317*7c478bd9Sstevel@tonic-gateFor more infomation, see the manual pages ssh(1), sshd(8), scp(1),
318*7c478bd9Sstevel@tonic-gatessh-keygen(1), ssh-agent(1), ssh-add(1), and make-ssh-known-hosts(1)
319*7c478bd9Sstevel@tonic-gateincluded in this distribution.
320*7c478bd9Sstevel@tonic-gate
321*7c478bd9Sstevel@tonic-gate
322*7c478bd9Sstevel@tonic-gateX11 CONNECTION FORWARDING
323*7c478bd9Sstevel@tonic-gate
324*7c478bd9Sstevel@tonic-gateX11 forwarding serves two purposes: it is a convenience to the user
325*7c478bd9Sstevel@tonic-gatebecause there is no need to set the DISPLAY variable, and it provides
326*7c478bd9Sstevel@tonic-gateencrypted X11 connections.  I cannot think of any other easy way to
327*7c478bd9Sstevel@tonic-gatemake X11 connections encrypted; modifying the X server, clients or
328*7c478bd9Sstevel@tonic-gatelibraries would require special work for each machine, vendor and
329*7c478bd9Sstevel@tonic-gateapplication.  Widely used IP-level encryption does not seem likely for
330*7c478bd9Sstevel@tonic-gateseveral years.  Thus what we have left is faking an X server on the
331*7c478bd9Sstevel@tonic-gatesame machine where the clients are run, and forwarding the connections
332*7c478bd9Sstevel@tonic-gateto a real X server over the secure channel.
333*7c478bd9Sstevel@tonic-gate
334*7c478bd9Sstevel@tonic-gateX11 forwarding works as follows.  The client extracts Xauthority
335*7c478bd9Sstevel@tonic-gateinformation for the server.  It then creates random authorization
336*7c478bd9Sstevel@tonic-gatedata, and sends the random data to the server.  The server allocates
337*7c478bd9Sstevel@tonic-gatean X11 display number, and stores the (fake) Xauthority data for this
338*7c478bd9Sstevel@tonic-gatedisplay.  Whenever an X11 connection is opened, the server forwards
339*7c478bd9Sstevel@tonic-gatethe connection over the secure channel to the client, and the client
340*7c478bd9Sstevel@tonic-gateparses the first packet of the X11 protocol, substitutes real
341*7c478bd9Sstevel@tonic-gateauthentication data for the fake data (if the fake data matched), and
342*7c478bd9Sstevel@tonic-gateforwards the connection to the real X server.
343*7c478bd9Sstevel@tonic-gate
344*7c478bd9Sstevel@tonic-gateIf the display does not have Xauthority data, the server will create a
345*7c478bd9Sstevel@tonic-gateunix domain socket in /tmp/.X11-unix, and use the unix domain socket
346*7c478bd9Sstevel@tonic-gateas the display.  No authentication information is forwarded in this
347*7c478bd9Sstevel@tonic-gatecase.  X11 connections are again forwarded over the secure channel.
348*7c478bd9Sstevel@tonic-gateTo the X server the connections appear to come from the client
349*7c478bd9Sstevel@tonic-gatemachine, and the server must have connections allowed from the local
350*7c478bd9Sstevel@tonic-gatemachine.  Using authentication data is always recommended because not
351*7c478bd9Sstevel@tonic-gateusing it makes the display insecure.  If XDM is used, it automatically
352*7c478bd9Sstevel@tonic-gategenerates the authentication data.
353*7c478bd9Sstevel@tonic-gate
354*7c478bd9Sstevel@tonic-gateOne should be careful not to use "xin" or "xstart" or other similar
355*7c478bd9Sstevel@tonic-gatescripts that explicitly set DISPLAY to start X sessions in a remote
356*7c478bd9Sstevel@tonic-gatemachine, because the connection will then not go over the secure
357*7c478bd9Sstevel@tonic-gatechannel.  The recommended way to start a shell in a remote machine is
358*7c478bd9Sstevel@tonic-gate
359*7c478bd9Sstevel@tonic-gate  xterm -e ssh host &
360*7c478bd9Sstevel@tonic-gate
361*7c478bd9Sstevel@tonic-gateand the recommended way to execute an X11 application in a remote
362*7c478bd9Sstevel@tonic-gatemachine is
363*7c478bd9Sstevel@tonic-gate
364*7c478bd9Sstevel@tonic-gate  ssh -n host emacs &
365*7c478bd9Sstevel@tonic-gate
366*7c478bd9Sstevel@tonic-gateIf you need to type a password/passphrase for the remote machine,
367*7c478bd9Sstevel@tonic-gate
368*7c478bd9Sstevel@tonic-gate  ssh -f host emacs
369*7c478bd9Sstevel@tonic-gate
370*7c478bd9Sstevel@tonic-gatemay be useful.
371*7c478bd9Sstevel@tonic-gate
372*7c478bd9Sstevel@tonic-gate
373*7c478bd9Sstevel@tonic-gate
374*7c478bd9Sstevel@tonic-gateRSA AUTHENTICATION
375*7c478bd9Sstevel@tonic-gate
376*7c478bd9Sstevel@tonic-gateRSA authentication is based on public key cryptograpy.  The idea is
377*7c478bd9Sstevel@tonic-gatethat there are two encryption keys, one for encryption and another for
378*7c478bd9Sstevel@tonic-gatedecryption.  It is not possible (on human timescale) to derive the
379*7c478bd9Sstevel@tonic-gatedecryption key from the encryption key.  The encryption key is called
380*7c478bd9Sstevel@tonic-gatethe public key, because it can be given to anyone and it is not
381*7c478bd9Sstevel@tonic-gatesecret.  The decryption key, on the other hand, is secret, and is
382*7c478bd9Sstevel@tonic-gatecalled the private key.
383*7c478bd9Sstevel@tonic-gate
384*7c478bd9Sstevel@tonic-gateRSA authentication is based on the impossibility of deriving the
385*7c478bd9Sstevel@tonic-gateprivate key from the public key.  The public key is stored on the
386*7c478bd9Sstevel@tonic-gateserver machine in the user's $HOME/.ssh/authorized_keys file.  The
387*7c478bd9Sstevel@tonic-gateprivate key is only kept on the user's local machine, laptop, or other
388*7c478bd9Sstevel@tonic-gatesecure storage.  Then the user tries to log in, the client tells the
389*7c478bd9Sstevel@tonic-gateserver the public key that the user wishes to use for authentication.
390*7c478bd9Sstevel@tonic-gateThe server then checks if this public key is admissible.  If so, it
391*7c478bd9Sstevel@tonic-gategenerates a 256 bit random number, encrypts it with the public key,
392*7c478bd9Sstevel@tonic-gateand sends the value to the client.  The client then decrypts the
393*7c478bd9Sstevel@tonic-gatenumber with its private key, computes a 128 bit MD5 checksum from the
394*7c478bd9Sstevel@tonic-gateresulting data, and sends the checksum back to the server.  (Only a
395*7c478bd9Sstevel@tonic-gatechecksum is sent to prevent chosen-plaintext attacks against RSA.)
396*7c478bd9Sstevel@tonic-gateThe server checks computes a checksum from the correct data,
397*7c478bd9Sstevel@tonic-gateand compares the checksums.  Authentication is accepted if the
398*7c478bd9Sstevel@tonic-gatechecksums match.  (Theoretically this indicates that the client
399*7c478bd9Sstevel@tonic-gateonly probably knows the correct key, but for all practical purposes
400*7c478bd9Sstevel@tonic-gatethere is no doubt.)
401*7c478bd9Sstevel@tonic-gate
402*7c478bd9Sstevel@tonic-gateThe RSA private key can be protected with a passphrase.  The
403*7c478bd9Sstevel@tonic-gatepassphrase can be any string; it is hashed with MD5 to produce an
404*7c478bd9Sstevel@tonic-gateencryption key for IDEA, which is used to encrypt the private part of
405*7c478bd9Sstevel@tonic-gatethe key file.  With passphrase, authorization requires access to the key
406*7c478bd9Sstevel@tonic-gatefile and the passphrase.  Without passphrase, authorization only
407*7c478bd9Sstevel@tonic-gatedepends on possession of the key file.
408*7c478bd9Sstevel@tonic-gate
409*7c478bd9Sstevel@tonic-gateRSA authentication is the most secure form of authentication supported
410*7c478bd9Sstevel@tonic-gateby this software.  It does not rely on the network, routers, domain
411*7c478bd9Sstevel@tonic-gatename servers, or the client machine.  The only thing that matters is
412*7c478bd9Sstevel@tonic-gateaccess to the private key.
413*7c478bd9Sstevel@tonic-gate
414*7c478bd9Sstevel@tonic-gateAll this, of course, depends on the security of the RSA algorithm
415*7c478bd9Sstevel@tonic-gateitself.  RSA has been widely known since about 1978, and no effective
416*7c478bd9Sstevel@tonic-gatemethods for breaking it are known if it is used properly.  Care has
417*7c478bd9Sstevel@tonic-gatebeen taken to avoid the well-known pitfalls.  Breaking RSA is widely
418*7c478bd9Sstevel@tonic-gatebelieved to be equivalent to factoring, which is a very hard
419*7c478bd9Sstevel@tonic-gatemathematical problem that has received considerable public research.
420*7c478bd9Sstevel@tonic-gateSo far, no effective methods are known for numbers bigger than about
421*7c478bd9Sstevel@tonic-gate512 bits.  However, as computer speeds and factoring methods are
422*7c478bd9Sstevel@tonic-gateincreasing, 512 bits can no longer be considered secure.  The
423*7c478bd9Sstevel@tonic-gatefactoring work is exponential, and 768 or 1024 bits are widely
424*7c478bd9Sstevel@tonic-gateconsidered to be secure in the near future.
425*7c478bd9Sstevel@tonic-gate
426*7c478bd9Sstevel@tonic-gate
427*7c478bd9Sstevel@tonic-gateRHOSTS AUTHENTICATION
428*7c478bd9Sstevel@tonic-gate
429*7c478bd9Sstevel@tonic-gateConventional .rhosts and hosts.equiv based authentication mechanisms
430*7c478bd9Sstevel@tonic-gateare fundamentally insecure due to IP, DNS (domain name server) and
431*7c478bd9Sstevel@tonic-gaterouting spoofing attacks.  Additionally this authentication method
432*7c478bd9Sstevel@tonic-gaterelies on the integrity of the client machine.  These weaknesses is
433*7c478bd9Sstevel@tonic-gatetolerable, and been known and exploited for a long time.
434*7c478bd9Sstevel@tonic-gate
435*7c478bd9Sstevel@tonic-gateSsh provides an improved version of these types of authentication,
436*7c478bd9Sstevel@tonic-gatebecause they are very convenient for the user (and allow easy
437*7c478bd9Sstevel@tonic-gatetransition from rsh and rlogin).  It permits these types of
438*7c478bd9Sstevel@tonic-gateauthentication, but additionally requires that the client host be
439*7c478bd9Sstevel@tonic-gateauthenticated using RSA.
440*7c478bd9Sstevel@tonic-gate
441*7c478bd9Sstevel@tonic-gateThe server has a list of host keys stored in /etc/ssh_known_host, and
442*7c478bd9Sstevel@tonic-gateadditionally each user has host keys in $HOME/.ssh/known_hosts.  Ssh
443*7c478bd9Sstevel@tonic-gateuses the name servers to obtain the canonical name of the client host,
444*7c478bd9Sstevel@tonic-gatelooks for its public key in its known host files, and requires the
445*7c478bd9Sstevel@tonic-gateclient to prove that it knows the private host key.  This prevents IP
446*7c478bd9Sstevel@tonic-gateand routing spoofing attacks (as long as the client machine private
447*7c478bd9Sstevel@tonic-gatehost key has not been compromized), but is still vulnerable to DNS
448*7c478bd9Sstevel@tonic-gateattacks (to a limited extent), and relies on the integrity of the
449*7c478bd9Sstevel@tonic-gateclient machine as to who is requesting to log in.  This prevents
450*7c478bd9Sstevel@tonic-gateoutsiders from attacking, but does not protect against very powerful
451*7c478bd9Sstevel@tonic-gateattackers.  If maximal security is desired, only RSA authentication
452*7c478bd9Sstevel@tonic-gateshould be used.
453*7c478bd9Sstevel@tonic-gate
454*7c478bd9Sstevel@tonic-gateIt is possible to enable conventional .rhosts and /etc/hosts.equiv
455*7c478bd9Sstevel@tonic-gateauthentication (without host authentication) at compile time by giving
456*7c478bd9Sstevel@tonic-gatethe option --with-rhosts to configure.  However, this is not
457*7c478bd9Sstevel@tonic-gaterecommended, and is not done by default.
458*7c478bd9Sstevel@tonic-gate
459*7c478bd9Sstevel@tonic-gateThese weaknesses are present in rsh and rlogin.  No improvement in
460*7c478bd9Sstevel@tonic-gatesecurity will be obtained unless rlogin and rsh are completely
461*7c478bd9Sstevel@tonic-gatedisabled (commented out in /etc/inetd.conf).  This is highly
462*7c478bd9Sstevel@tonic-gaterecommended.
463*7c478bd9Sstevel@tonic-gate
464*7c478bd9Sstevel@tonic-gate
465*7c478bd9Sstevel@tonic-gateWEAKEST LINKS IN SECURITY
466*7c478bd9Sstevel@tonic-gate
467*7c478bd9Sstevel@tonic-gateOne should understand that while this software may provide
468*7c478bd9Sstevel@tonic-gatecryptographically secure communications, it may be easy to
469*7c478bd9Sstevel@tonic-gatemonitor the communications at their endpoints.
470*7c478bd9Sstevel@tonic-gate
471*7c478bd9Sstevel@tonic-gateBasically, anyone with root access on the local machine on which you
472*7c478bd9Sstevel@tonic-gateare running the software may be able to do anything.  Anyone with root
473*7c478bd9Sstevel@tonic-gateaccess on the server machine may be able to monitor your
474*7c478bd9Sstevel@tonic-gatecommunications, and a very talented root user might even be able to
475*7c478bd9Sstevel@tonic-gatesend his/her own requests to your authentication agent.
476*7c478bd9Sstevel@tonic-gate
477*7c478bd9Sstevel@tonic-gateOne should also be aware that computers send out electromagnetic
478*7c478bd9Sstevel@tonic-gateradition that can sometimes be picked up hundreds of meters away.
479*7c478bd9Sstevel@tonic-gateYour keyboard is particularly easy to listen to.  The image on your
480*7c478bd9Sstevel@tonic-gatemonitor might also be seen on another monitor in a van parked behind
481*7c478bd9Sstevel@tonic-gateyour house.
482*7c478bd9Sstevel@tonic-gate
483*7c478bd9Sstevel@tonic-gateBeware that unwanted visitors might come to your home or office and
484*7c478bd9Sstevel@tonic-gateuse your machine while you are away.  They might also make
485*7c478bd9Sstevel@tonic-gatemodifications or install bugs in your hardware or software.
486*7c478bd9Sstevel@tonic-gate
487*7c478bd9Sstevel@tonic-gateBeware that the most effective way for someone to decrypt your data
488*7c478bd9Sstevel@tonic-gatemay be with a rubber hose.
489*7c478bd9Sstevel@tonic-gate
490*7c478bd9Sstevel@tonic-gate
491*7c478bd9Sstevel@tonic-gateLEGAL ISSUES
492*7c478bd9Sstevel@tonic-gate
493*7c478bd9Sstevel@tonic-gateAs far as I am concerned, anyone is permitted to use this software
494*7c478bd9Sstevel@tonic-gatefreely.  However, see the file COPYING for detailed copying,
495*7c478bd9Sstevel@tonic-gatelicensing, and distribution information.
496*7c478bd9Sstevel@tonic-gate
497*7c478bd9Sstevel@tonic-gateIn some countries, particularly France, Russia, Iraq, and Pakistan,
498*7c478bd9Sstevel@tonic-gateit may be illegal to use any encryption at all without a special
499*7c478bd9Sstevel@tonic-gatepermit, and the rumor has it that you cannot get a permit for any
500*7c478bd9Sstevel@tonic-gatestrong encryption.
501*7c478bd9Sstevel@tonic-gate
502*7c478bd9Sstevel@tonic-gateThis software may be freely imported into the United States; however,
503*7c478bd9Sstevel@tonic-gatethe United States Government may consider re-exporting it a criminal
504*7c478bd9Sstevel@tonic-gateoffence.
505*7c478bd9Sstevel@tonic-gate
506*7c478bd9Sstevel@tonic-gateNote that any information and cryptographic algorithms used in this
507*7c478bd9Sstevel@tonic-gatesoftware are publicly available on the Internet and at any major
508*7c478bd9Sstevel@tonic-gatebookstore, scientific library, or patent office worldwide.
509*7c478bd9Sstevel@tonic-gate
510*7c478bd9Sstevel@tonic-gateTHERE IS NO WARRANTY FOR THIS PROGRAM.  Please consult the file
511*7c478bd9Sstevel@tonic-gateCOPYING for more information.
512*7c478bd9Sstevel@tonic-gate
513*7c478bd9Sstevel@tonic-gate
514*7c478bd9Sstevel@tonic-gateMAILING LISTS AND OTHER INFORMATION
515*7c478bd9Sstevel@tonic-gate
516*7c478bd9Sstevel@tonic-gateThere is a mailing list for ossh.  It is ossh@sics.se.  If you would
517*7c478bd9Sstevel@tonic-gatelike to join, send a message to majordomo@sics.se with "subscribe
518*7c478bd9Sstevel@tonic-gatessh" in body.
519*7c478bd9Sstevel@tonic-gate
520*7c478bd9Sstevel@tonic-gateThe WWW home page for ssh is http://www.cs.hut.fi/ssh.  It contains an
521*7c478bd9Sstevel@tonic-gatearchive of the mailing list, and detailed information about new
522*7c478bd9Sstevel@tonic-gatereleases, mailing lists, and other relevant issues.
523*7c478bd9Sstevel@tonic-gate
524*7c478bd9Sstevel@tonic-gateBug reports should be sent to ossh-bugs@sics.se.
525*7c478bd9Sstevel@tonic-gate
526*7c478bd9Sstevel@tonic-gate
527*7c478bd9Sstevel@tonic-gateABOUT THE AUTHOR
528*7c478bd9Sstevel@tonic-gate
529*7c478bd9Sstevel@tonic-gateThis software was written by Tatu Ylonen <ylo@cs.hut.fi>.  I work as a
530*7c478bd9Sstevel@tonic-gateresearcher at Helsinki University of Technology, Finland.  For more
531*7c478bd9Sstevel@tonic-gateinformation, see http://www.cs.hut.fi/~ylo/.  My PGP public key is
532*7c478bd9Sstevel@tonic-gateavailable via finger from ylo@cs.hut.fi and from the key servers.  I
533*7c478bd9Sstevel@tonic-gateprefer PGP encrypted mail.
534*7c478bd9Sstevel@tonic-gate
535*7c478bd9Sstevel@tonic-gateThe author can be contacted via ordinary mail at
536*7c478bd9Sstevel@tonic-gate  Tatu Ylonen
537*7c478bd9Sstevel@tonic-gate  Helsinki University of Technology
538*7c478bd9Sstevel@tonic-gate  Otakaari 1
539*7c478bd9Sstevel@tonic-gate  FIN-02150 ESPOO
540*7c478bd9Sstevel@tonic-gate  Finland
541*7c478bd9Sstevel@tonic-gate
542*7c478bd9Sstevel@tonic-gate  Fax. +358-0-4513293
543*7c478bd9Sstevel@tonic-gate
544*7c478bd9Sstevel@tonic-gate
545*7c478bd9Sstevel@tonic-gateACKNOWLEDGEMENTS
546*7c478bd9Sstevel@tonic-gate
547*7c478bd9Sstevel@tonic-gateI thank Tero Kivinen, Timo Rinne, Janne Snabb, and Heikki Suonsivu for
548*7c478bd9Sstevel@tonic-gatetheir help and comments in the design, implementation and porting of
549*7c478bd9Sstevel@tonic-gatethis software.  I also thank numerous contributors, including but not
550*7c478bd9Sstevel@tonic-gatelimited to Walker Aumann, Jurgen Botz, Hans-Werner Braun, Stephane
551*7c478bd9Sstevel@tonic-gateBortzmeyer, Adrian Colley, Michael Cooper, David Dombek, Jerome
552*7c478bd9Sstevel@tonic-gateEtienne, Bill Fithen, Mark Fullmer, Bert Gijsbers, Andreas Gustafsson,
553*7c478bd9Sstevel@tonic-gateMichael Henits, Steve Johnson, Thomas Koenig, Felix Leitner, Gunnar
554*7c478bd9Sstevel@tonic-gateLindberg, Andrew Macpherson, Marc Martinec, Paul Mauvais, Donald
555*7c478bd9Sstevel@tonic-gateMcKillican, Leon Mlakar, Robert Muchsel, Mark Treacy, Bryan
556*7c478bd9Sstevel@tonic-gateO'Sullivan, Mikael Suokas, Ollivier Robert, Jakob Schlyter, Tomasz
557*7c478bd9Sstevel@tonic-gateSurmacz, Alvar Vinacua, Petri Virkkula, Michael Warfield, and
558*7c478bd9Sstevel@tonic-gateCristophe Wolfhugel.
559*7c478bd9Sstevel@tonic-gate
560*7c478bd9Sstevel@tonic-gateThanks also go to Philip Zimmermann, whose PGP software and the
561*7c478bd9Sstevel@tonic-gateassociated legal battle provided inspiration, motivation, and many
562*7c478bd9Sstevel@tonic-gateuseful techniques, and to Bruce Schneier whose book Applied
563*7c478bd9Sstevel@tonic-gateCryptography has done a great service in widely distributing knowledge
564*7c478bd9Sstevel@tonic-gateabout cryptographic methods.
565*7c478bd9Sstevel@tonic-gate
566*7c478bd9Sstevel@tonic-gate
567*7c478bd9Sstevel@tonic-gateCopyright (c) 1995 Tatu Ylonen, Espoo, Finland.
568