tor-doc.html 19 KB

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