update other links from CLIENTS, too. good idea thomas.
[tor.git] / doc / tor-doc.html
blob404451bf8ce0b135dbedbb3417490e8ac50470a0
1 <html>
2 <head>
3 <title>Tor Documentation</title>
4 <meta name="Author" content="Roger Dingledine">
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <meta http-equiv="Content-Style-Type" content="text/css">
7 <link rel="stylesheet" type="text/css" href="tor-doc.css">
8 </head>
10 <body>
12 <h1><a href="http://tor.eff.org/">Tor</a> documentation</h1>
14 <p>Tor provides a distributed network of servers ("onion routers"). Users
15 bounce their communications (web requests, IM, IRC, SSH, etc.) around
16 the routers. This makes it hard for recipients, observers, and even the
17 onion routers themselves to track the source of the stream.</p>
19 <a name="why"></a>
20 <h2>Why should I use Tor?</h2>
22 <p>Individuals need Tor for privacy:
23 <ul>
24 <li>Privacy in web browsing -- both from the remote website (so it can't
25 track and sell your behavior), and similarly from your local ISP.
26 <li>Safety in web browsing: if your local government doesn't approve
27 of its citizens visiting certain websites, they may monitor the sites
28 and put readers on a list of suspicious persons.
29 <li>Circumvention of local censorship: connect to resources (news
30 sites, instant messaging, etc.) that are restricted from your
31 ISP/school/company/government.
32 <li>Socially sensitive communication: chat rooms and web forums for
33 rape and abuse survivors, or people with illnesses.
34 </ul>
36 <p>Journalists and NGOs need Tor for safety:
37 <ul>
38 <li>Allowing dissidents and whistleblowers to communicate more safely.
39 <li>Censorship-resistant publication, such as making available your
40 home-made movie anonymously via a Tor <a href="#hidden-service">hidden
41 service</a>; and reading, e.g. of news sites not permitted in some
42 countries.
43 <li>Allowing your workers to check back with your home website while
44 they're in a foreign country, without notifying everybody nearby that
45 they're working with your organization.
46 </ul>
48 <p>Companies need Tor for business security:
49 <ul>
50 <li>Competitive analysis: browse the competition's website safely.
51 <li>Protecting collaborations of sensitive business units or partners.
52 <li>Protecting procurement suppliers or patterns.
53 <li>Putting the "P" back in "VPN": traditional VPNs reveal the exact
54 amount and frequency of communication. Which locations have employees
55 working late? Which locations have employees consulting job-hunting
56 websites? Which research groups are communicating with your company's
57 patent lawyers?
58 </ul>
60 <p>Governments need Tor for traffic-analysis-resistant communication:
61 <ul>
62 <li>Open source intelligence gathering (hiding individual analysts is
63 not enough -- the organization itself may be sensitive).
64 <li>Defense in depth on open <em>and classified</em> networks -- networks
65 with a million users (even if they're all cleared) can't be made safe just
66 by hardening them to external threat.
67 <li>Dynamic and semi-trusted international coalitions: the network can
68 be shared without revealing the existence or amount of communication
69 between all parties.
70 <li>Networks partially under known hostile control: to block
71 communications, the enemy must take down the whole network.
72 <li>Politically sensitive negotiations.
73 <li>Road warriors.
74 <li>Protecting procurement patterns.
75 <li>Anonymous tips.
76 </ul>
78 <p>Law enforcement needs Tor for safety:
79 <ul>
80 <li>Allowing anonymous tips or crime reporting
81 <li>Allowing agents to observe websites without notifying them that
82 they're being observed (or, more broadly, without having it be an
83 official visit from law enforcement).
84 <li>Surveillance and honeypots (sting operations)
85 </ul>
87 <p>Does the idea of sharing the Tor network with
88 all of these groups bother you? It shouldn't -- <a
89 href="http://freehaven.net/doc/fc03/econymics.pdf">you need them for
90 your security</a>.</p>
92 <a name="client-or-server"></a>
93 <h2>Should I run a client or a server?</h2>
95 <p>You can run Tor in either client mode or server mode. By default,
96 everybody is a <i>client</i>. This means you don't relay traffic for
97 anybody but yourself.</p>
99 <p>If your computer doesn't have a routable IP address or you're using
100 a modem, you should stay a client. Otherwise, please consider being
101 a server, to help out the network. (Currently each server uses 20-500
102 gigabytes of traffic per month, depending on its capacity and its rate
103 limiting configuration.)</p>
105 <p>Note that you can be a server without allowing users to make
106 connections from your computer to the outside world. This is called being
107 a middleman server.</p>
109 <p> Benefits of running a server include:
110 <ul>
111 <li>You may get stronger anonymity, since your destination can't know
112 whether connections relayed through your computer originated at your
113 computer or not.
114 <li>You can also get stronger anonymity by configuring your Tor clients
115 to use your Tor server for entry or for exit.
116 <li>You're helping the Tor staff with development and scalability testing.
117 <li>You're helping your fellow Internet users by providing a larger
118 network. Also, having servers in many different pieces of the Internet
119 gives users more robustness against curious telcos and brute force
120 attacks.
121 </ul>
123 <p>Other things to note:
124 <ul>
125 <li>Tor has built-in support for rate limiting; see BandwidthRate
126 and BandwidthBurst config options. Further, if you have
127 lots of capacity but don't want to spend that many bytes per
128 month, check out the Accounting and Hibernation features. See <a
129 href="http://wiki.noreply.org/wiki/TheOnionRouter/TorFAQ">the FAQ</a>
130 for details.</li>
131 <li>It's fine if the server goes offline sometimes. The directories
132 notice this quickly and stop advertising the server. Just try to make
133 sure it's not too often, since connections using the server when it
134 disconnects will break.</li>
135 <li>We can handle servers with dynamic IPs just fine, as long as the
136 server itself knows its IP. Have a look at this
137 <a href="http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#DynamicIP">
138 entry in the FAQ</a>.</li>
139 <li>If your server is behind a NAT and it doesn't
140 know its public IP (e.g. it has an IP of 192.168.x.y), you need to set
141 up port forwarding. Forwarding TCP connections is system dependent but
142 <a href="http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#ServerForFirewalledClients">
143 this entry</a> offers some examples on how to do this.</li>
144 <li>Your server will passively estimate and advertise its recent
145 bandwidth capacity.
146 Clients choose paths weighted by this capacity, so high-bandwidth
147 servers will attract more paths than low-bandwidth ones. That's why
148 having even low-bandwidth servers is useful too.</li>
149 </ul>
150 </p>
152 <p>You can read more about setting up Tor as a
153 server <a href="#server">below</a>.</p>
155 <a name="installing"></a>
156 <h2>Installing Tor</h2>
158 <p>We have installers for Windows, Mac OS X 10.3, and Red Hat. We
159 have contributed packages for Debian, Gentoo, and *BSD. See <a href="http://tor.eff.org/download.html">the download page</a> for pointers and details.
161 <p>If you got Tor from a tarball, unpack it: <tt>tar xzf
162 tor-0.0.9.9.tar.gz; cd tor-0.0.9.9</tt>. Run <tt>./configure</tt>, then
163 <tt>make</tt>, and then <tt>make install</tt> (as root if necessary). Then
164 you can launch tor from the command-line by running <tt>tor</tt>.
165 Otherwise, if you got it prepackaged, these steps are already done
166 for you, and you may even already have Tor started in the background
167 (logging to /var/log/something).</p>
169 <p>In any case, see the <a href="#client">next section</a> for what to
170 <i>do</i> with it now that you've got it running.</p>
172 <a name="client"></a>
173 <h2>Configuring a client</h2>
175 <p>Tor comes configured as a client by default. It uses a built-in
176 default configuration file, and most people won't need to change any of
177 the settings.</p>
180 After installing Tor, you should install <a
181 href="http://www.privoxy.org/">privoxy</a>, which is a filtering web
182 proxy that integrates well with Tor. (If you installed the Win32 or OS
183 X package, see those instructions instead.)
184 To configure privoxy to use Tor, add the line <br>
185 <tt>forward-socks4a / localhost:9050 .</tt><br>
186 (don't forget the dot) to privoxy's config file (you can just add it to the
187 top). Then change your browser to http proxy at localhost port 8118.
188 (In Mozilla, this is in Edit|Preferences|Advanced|Proxies.)
189 You should also set your SSL proxy to the same
190 thing, to hide your SSL traffic. Using privoxy is <b>necessary</b> because
192 href="http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#SOCKSAndDNS">most
193 browsers leak your
194 DNS requests when they use a SOCKS proxy directly</a>. Privoxy also gives
195 you good html scrubbing.</p>
197 <p>To test if it's working, you need to know your normal IP address so you can
198 verify that the address really changes when running Tor.
199 If you are using Linux or OS X your local IP address is shown by the <tt>ifconfig</tt>
200 command. Under Windows go to the Start menu, click Run and enter <tt>cmd</tt>.
201 At the command prompt, enter <tt>ipconfig</tt>. If you are behind a NAT/Firewall
202 you can use one of the sites listed below to check which IP you are using.
203 When that is done, start Tor and Privoxy and visit any of the sites again.
204 If everything works, your IP address should have changed.
205 </p>
208 <!--<a href="http://peertech.org/privacy-knoppix/">peertech</a>, -->
209 <a href="http://www.showmyip.com/">showmyip.com</a> and
210 <a href="http://ipid.shat.net">ipid.shat.net</a>
211 are sites that show your current IP so you can see
212 what address and country you're coming from.
213 </p>
216 If you have a personal firewall that limits your computer's ability
217 to connect to itself, be sure to allow connections from your local
218 applications to
219 local port 8118 and port 9050. If your firewall blocks outgoing connections,
220 punch a hole so it can connect to at least TCP ports 80, 443, and 9001-9033.
221 <!--If you're
222 using Safari as your browser, keep in mind that OS X before 10.3 claims
223 to support SOCKS but does not. -->
224 For more troubleshooting suggestions, see <a
225 href="http://wiki.noreply.org/wiki/TheOnionRouter/TorFAQ">the FAQ</a>.
226 </p>
228 <p>To Torify an application that supports http, just point it at Privoxy
229 (that is, localhost port 8118). To use SOCKS directly (for example, for
230 instant messaging, Jabber, IRC, etc.), point your application directly at
231 Tor (localhost port 9050). For applications that support neither SOCKS
232 nor http, you should look at
233 using <a href="http://tsocks.sourceforge.net/">tsocks</a>
234 to dynamically replace the system calls in your program to
235 route through Tor. If you want to use SOCKS 4A, consider using <a
236 href="http://www.dest-unreach.org/socat/">socat</a> (specific instructions
237 are on <a href="http://6sxoyfb3h2nvok2d.onion/tor/SocatHelp">this hidden
238 service url</a>).</p>
240 <p>(Windows doesn't have tsocks; see the bottom of the
241 <a href="tor-doc-win32.html">Win32 instructions</a> for alternatives.)
242 </p>
244 <a name="server"></a>
245 <h2>Configuring a server</h2>
247 <p>We're looking for people with reasonably reliable Internet connections,
248 that have at least 20 kilobytes/s each way. If you frequently have a
249 lot of packet loss or really high latency, we can't handle your server
250 yet. Otherwise, please help out!
251 </p>
254 To read more about whether you should be a server, check out <a
255 href="#client-or-server">the section above</a>.
256 </p>
258 <p>To set up a Tor server, do the following steps after installing Tor.
259 (These instructions are Unix-centric; but Tor 0.0.9.5 and later is running
260 as a server on Windows now as well.)
261 </p>
263 <ul>
264 <li>0. Verify that your clock is set correctly. If possible, synchronize
265 your clock with public time servers.</li>
266 <li>1. Edit the bottom part of your torrc (if you installed from source,
267 you will need to copy torrc.sample to torrc first. Look for them in
268 /usr/local/etc/tor/ on Unix). If you installed a package, you should look
269 for torrc:
270 <ul><li>in <tt>/etc/torrc</tt> or <tt>/etc/tor/torrc</tt> on Unix.</li>
271 <li>in <tt>/Library/Tor/torrc</tt> on Macintosh OS X.</li>
272 <li>in <tt>\Application Data\tor\torrc</tt> or in
273 <tt>\Application Data\</tt><i>username</i><tt>\tor\torrc</tt>
274 on Windows.</li>
275 </ul>
276 Make sure to define at least Nickname and ORPort.
277 Create the DataDirectory if necessary, and make
278 sure it's owned by the user that will be running tor.
279 Make sure name resolution works.
280 <li>2. If you are using a firewall, open a hole in your firewall so
281 incoming connections can reach the ports you configured (i.e. ORPort,
282 plus DirPort if you enabled it). Make sure you allow outgoing connections,
283 to get to other onion routers plus any other addresses or ports your
284 exit policy allows.
285 <li>3. Start your server: if you installed from source you can just
286 run <tt>tor</tt>, whereas packages typically launch Tor from their
287 initscripts or startup scripts. If it logs any warnings, address them. (By
288 default Tor logs to stdout, but some packages log to <tt>/var/log/tor/</tt>
289 instead. You can edit your torrc to configure log locations.)
290 <li>4. <b>Register your server.</b> Send mail to <a
291 href="mailto:tor-ops@freehaven.net">tor-ops@freehaven.net</a> with the
292 following information:
293 <ul>
294 <li>Your server's nickname.</li>
295 <li>The fingerprint for your server's key (the contents of the
296 "fingerprint" file in your DataDirectory -- look in /usr/local/var/lib/tor
297 or /var/lib/tor on many platforms).</li>
298 <li>Who you are, so we know whom to contact if a problem arises,
299 and</li>
300 <li>What kind of connectivity the new server will have.</li>
301 </ul>
302 If possible, sign your mail using PGP.<br />
303 Registering your server improves the anonymity of the network quite a bit.
304 If you don't register your server default users will only use you for the
305 middle hop of their circuits.
306 If you are running a registered middleman server, clients will be willing to
307 choose your node as an entry node as well as a middleman.
308 <li>5. Subscribe to the <a href="http://archives.seul.org/or/announce/">or-announce</a>
309 mailing list. It is very low volume, and it will keep you informed
310 of new stable releases. You might also consider subscribing to <a
311 href="http://archives.seul.org/or/talk/">or-talk</a> (higher volume),
312 where new development releases are announced.</li>
313 </ul>
314 </p>
316 <p>Here's where Tor puts its files on many common platforms:</p>
317 <table borderwidth="3 px">
318 <tr><th></th><th>Unix</th><th>Windows</th><th>Mac OS X</th></tr>
319 <tr><th>Configuration</th>
320 <td><tt>/etc/torrc</tt> <br />or <tt>/usr/local/etc/torrc</tt></td>
321 <td><tt>\Application&nbsp;Data\</tt><i>username</i><tt>\tor\torrc</tt> <br />or
322 <tt>\Application&nbsp;Data\tor\torrc</tt></td>
323 <td><tt>/Library/Tor/torrc</tt></td></tr>
324 <tr><th>Fingerprint</th>
325 <td><tt>/var/lib/tor/fingerprint</tt>
326 or <tt>/usr/local/var/lib/tor/fingerprint</tt></td>
327 <td><tt>\Application&nbsp;Data\</tt><i>username</i><tt>\tor\fingerprint</tt>
328 or <tt>\Application&nbsp;Data\tor\fingerprint</tt></td>
329 <td><tt>/Library/Tor/var/lib/tor/fingerprint</tt></td></tr>
330 <tr><th>Logs</th>
331 <td><tt>/var/log/tor</tt>
332 or <tt>/usr/local/var/log/tor</tt></td>
333 <td><tt>\Application&nbsp;Data\</tt><i>username</i><tt>\tor\log</tt>
334 or <tt>\Application&nbsp;Data\tor\log</tt></td>
335 <td><tt>/var/log/tor</tt></td></tr>
336 </table>
340 Optionally, we recommend the following steps as well:
341 </p>
343 <ul>
344 <li>6 (Unix only). Make a separate user to run the server. If you
345 installed the deb or the rpm, this is already done. Otherwise,
346 you can do it by hand. (The Tor server doesn't need to be run as
347 root, so it's good practice to not run it as root. Running as a
348 'tor' user avoids issues with identd and other services that
349 detect user name. If you're the paranoid sort, feel free to <a
350 href="http://wiki.noreply.org/wiki/TheOnionRouter/TorInChroot">put Tor
351 into a chroot jail</a>.)
352 <li>7. Decide what exit policy you want. By default your server allows
353 access to many popular services, but we restrict some (such as port 25)
354 due to abuse potential. You might want an exit policy that is
355 less restrictive or more restrictive; edit your torrc appropriately.
356 If you choose a particularly open exit policy, you might want to make
357 sure your upstream or ISP is ok with that choice.
358 <li>8. If you installed from source, you may find the initscripts in
359 contrib/tor.sh or contrib/torctl useful if you want to set up Tor to
360 start at boot.
361 <li>9. Consider setting your hostname to 'anonymous' or
362 'proxy' or 'tor-proxy' if you can, so when other people see the address
363 in their web logs or whatever, they will more quickly understand what's
364 going on.
365 <li>10. If you're not running anything else on port 80 or port 443,
366 please consider setting up port-forwarding and advertising these
367 low-numbered ports as your Tor server. This will help allow users behind
368 particularly restrictive firewalls to access the Tor network. Win32
369 servers can simply set their ORPort and DirPort directly. Other servers
370 need to rig some sort of port forwarding; see <a
371 href="http://wiki.noreply.org/wiki/TheOnionRouter/TorFAQ#ServerForFirewalledClients">the
372 FAQ</a> for details of how to set this up.
373 </ul>
375 <p>You can click <a href="http://moria.seul.org:9031/">here</a> or <a
376 href="http://62.116.124.106:9030/">here</a> and look at the router-status
377 line to see if your server is part of the network. It will be listed by
378 nickname once we have added your server to the list of known servers;
379 otherwise it is listed only by its fingerprint.</p>
381 <a name="hidden-service"></a>
382 <h2>Configuring a hidden service</h2>
384 <p>Tor allows clients and servers to offer hidden services. That is,
385 you can offer a web server, SSH server, etc., without revealing your IP to its
386 users. You can even have your application listen on localhost only, yet
387 remote Tor connections can access it. This works via Tor's rendezvous
388 point design: both sides build a Tor circuit out, and they meet in
389 the middle.</p>
391 <p>If you're using Tor and <a href="http://www.privoxy.org/">Privoxy</a>,
392 you can <a href="http://6sxoyfb3h2nvok2d.onion/">go to the hidden wiki</a>
393 to see hidden services in action.</p>
395 <p>To set up a hidden service, copy torrc.sample to torrc (by default it's
396 in /usr/local/etc/tor/), and edit the middle part. Then run Tor. It will
397 create each HiddenServiceDir you have configured, and it will create a
398 'hostname' file which specifies the url (xyz.onion) for that service. You
399 can tell people the url, and they can connect to it via their Tor client,
400 assuming they're using a proxy (such as Privoxy) that speaks SOCKS 4A.</p>
402 <p>Let's consider an example.
403 Assume you want to set up a hidden service to allow people to access your
404 Apache web server through Tor. By doing this, they can access your server
405 but won't know who they are connecting to. You want clients to use the
406 standard port 80 when accessing your server. However, if your Apache
407 server is actually running on port 8080 locally, client connections need
408 to be redirected.</p>
410 <p><b>HiddenServiceDir</b> is a directory where Tor will store information
411 about that hidden service. In particular, Tor will create a file here named
412 <i>hostname</i> which will tell you the onion URL. You don't need to add any
413 files to this directory.</p>
415 <p><b>HiddenServicePort</b> is where you specify a virtual port and where
416 to redirect connections to this virtual port. For instance, you tell
417 Tor there's a virtual port 80 and then redirect traffic to your local
418 webserver at 127.0.0.1:8080.</p>
420 <p>Example lines from a torrc file</p>
422 <pre>
423 HiddenServiceDir /usr/local/etc/tor/hidden_service/
424 HiddenServicePort 80 127.0.0.1:8080
425 </pre>
427 <p>This tells Tor to store its files in <tt>/usr/local/etc/tor/hidden_service/</tt>
428 and allow people to connect to your onion address on port 80. It
429 will then redirect requests to your localhost webserver on port 8080.
430 </p>
432 <p>To let people access your hidden service, look at the file
433 <tt>/usr/local/etc/tor/hidden_service/hostname</tt> which will tell you what the
434 hostname is (such as xyz.onion). Then, as long as they have Tor and Privoxy
435 configured, they can access your webserver with a web browser by connecting
436 to http://xyz.onion/</p>
438 <p>You can have multiple tor hidden services by repeating Dir and Ports:</p>
440 <pre>
441 HiddenServiceDir /usr/local/etc/tor/hidden_service/
442 HiddenServicePort 80 127.0.0.1:8080
444 HiddenServiceDir /usr/local/etc/tor/other_hidden_service/
445 HiddenServicePort 6667 127.0.0.1:6667
446 HiddenServicePort 22 127.0.0.1:22
447 </pre>
449 <p>The above example will allow people to connect to the hostname in
450 <tt>/usr/local/etc/tor/hidden_service/hostname</tt> for an HTTP server and
451 to a different hostname in
452 <tt>/usr/local/etc/tor/other_hidden_service/hostname</tt> for an IRC and
453 SSH server. To an end user, this appears to be two separate hosts with
454 one running an HTTP server and another running an IRC/SSH server.</p>
456 <a name="own-network"></a>
457 <h2>Setting up your own network</h2>
460 If you want to experiment locally with your own network, or you're cut
461 off from the Internet and want to be able to mess with Tor still, then
462 you may want to set up your own separate Tor network.
465 To set up your own Tor network, you need to run your own directory
466 servers, and you need to configure each client and server so it knows
467 about your directory servers rather than the default ones.
469 <ul>
470 <li>1: Grab the latest release. Use at least 0.0.9.5.
471 <li>2: For each directory server you want,
472 <ul>
473 <li>2a: Set it up as a server (see <a href="#server">"setting up a
474 server"</a> above), with a least ORPort, DirPort, DataDirectory, and Nickname
475 defined. Set "AuthoritativeDirectory 1".
476 <li>2b: Set "RecommendedVersions" to a comma-separated list of acceptable
477 versions of the code for clients and servers to be running.
478 <li>2c: Run it: <tt>tor --list-fingerprint</tt> if your torrc is in
479 the default place, or <tt>tor -f torrc --list-fingerprint</tt> to
480 specify one. This will generate your keys and output a fingerprint
481 line.
482 </ul>
483 <li>3: Now you need to teach clients and servers to use the new
484 dirservers. For each fingerprint, add a line like<br>
485 <tt>DirServer 18.244.0.114:80 719B E45D E224 B607 C537 07D0 E214 3E2D 423E 74CF</tt><br>
486 to the torrc of each client and server who will be using your network.
487 <li>4: Create a file called approved-routers in the DataDirectory
488 of each directory server. Collect the 'fingerprint' lines from
489 each server (including directory servers), and include them (one per
490 line) in each approved-routers file. You can hup the tor process for
491 each directory server to reload the approved-routers file (so you don't
492 have to restart the process).
493 </ul>
495 <!--<h2>Other doc resources</h2>
497 <ul>
498 <li>Design paper
499 <li>Spec and rend-spec
500 <li>others
501 </ul> -->
503 </body>
504 </html>