tor-doc.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <html>
  2. <head>
  3. <title>Tor: an anonymizing overlay network for TCP</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="http://freehaven.net/tor/minion.css">
  8. </head>
  9. <body>
  10. <h1><a href="http://freehaven.net/tor/">Tor</a> documentation</h1>
  11. <p>The simple version: Tor provides a distributed network of servers
  12. ("onion routers"). Users bounce their TCP streams (web traffic, FTP, SSH,
  13. etc.) around the routers. This makes it hard for recipients, observers, and
  14. even the onion routers themselves to track the source of the stream.</p>
  15. <p>The complex version: Onion Routing is a connection-oriented anonymizing
  16. communication service. Users choose a source-routed path through a set of
  17. nodes, and negotiate a "virtual circuit" through the network, in which
  18. each node knows its predecessor and successor, but no others. Traffic
  19. flowing down the circuit is unwrapped by a symmetric key at each node,
  20. which reveals the downstream node.</p>
  21. <a name="why"></a>
  22. <h2>Why should I use Tor?</h2>
  23. <p>Individuals need Tor for privacy:
  24. <ul>
  25. <li>Privacy in web browsing -- both from the remote website (so it can't
  26. track and sell your behavior), and similarly from your local ISP.
  27. <li>Safety in web browsing: if your local government doesn't approve
  28. of its citizens visiting certain websites, they may monitor the sites
  29. and put readers on a list of suspicious persons.
  30. <li>Circumvention of local censorship: connect to resources (news
  31. sites, instant messaging, etc) that are restricted from your
  32. ISP/school/company/government.
  33. <li>Socially sensitive communication: chat rooms and web forums for
  34. rape and abuse survivors, or people with illnesses.
  35. </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 and reading, e.g. of news sites
  40. not permitted in some countries.
  41. <li>Allowing their agents to check back with their home website while
  42. they're in a foreign country, without notifying everybody nearby that
  43. they're working with that organization.
  44. </ul>
  45. <p>Companies need Tor for business security:
  46. <ul>
  47. <li>Competitive analysis: browse the competition's website safely.
  48. <li>Protecting collaborations of sensitive business units or partners.
  49. <li>Protecting procurement suppliers or patterns.
  50. <li>Putting the "P" back in "VPN": traditional VPNs reveal the exact
  51. amount and frequency of communication. Which locations have employees
  52. working late? Which locations have employees consulting job-hunting
  53. websites? Which research groups are communicating with your company's
  54. patent lawyers?
  55. </ul>
  56. <p>Governments need Tor for traffic-analysis-resistant communication:
  57. <ul>
  58. <li>Open source intelligence gathering (hiding individual analysts is
  59. not enough -- the organization itself may be sensitive).
  60. <li>Defense in depth on open <em>and classified</em> networks -- networks
  61. with a million users (even if they're all cleared) can't be made safe just
  62. by hardening them to external threat.
  63. <li>Dynamic and semi-trusted international coalitions: the network can
  64. be shared without revealing the existence or amount of communication
  65. between all parties.
  66. <li>Networks partially under known hostile control: to block
  67. communications, the enemy must take down the whole network.
  68. <li>Politically sensitive negotations.
  69. <li>Road warriors.
  70. <li>Protecting procurement patterns.
  71. <li>Anonymous tips.
  72. </ul>
  73. <p>Law enforcement needs Tor for safety:
  74. <ul>
  75. <li>Allowing anonymous tips or crime reporting
  76. <li>Allowing agents to observe websites without notifying them that
  77. they're being observed (or, more broadly, without having it be an
  78. official visit from law enforcement).
  79. <li>Surveillance and honeypots (sting operations)
  80. </ul>
  81. <p>Does the idea of sharing the Tor network with
  82. all of these groups bother you? It shouldn't -- <a
  83. href="http://freehaven.net/doc/fc03/econymics.pdf">you need them for
  84. your security</a>.</p>
  85. <a name="client-or-server"></a>
  86. <h2>Should I run a client or a server?</h2>
  87. <p>You can run Tor in either client mode or server mode. By default,
  88. everybody is a <i>client</i>. This means you don't relay traffic for
  89. anybody but yourself.</p>
  90. <p>If you have less than 768kbit in both directions, you should stay
  91. a client. Otherwise, please consider being a server, to help out the
  92. network. (Currently each server uses 20-30 gigabytes of traffic
  93. per month; but that may go up.)</p>
  94. <p>Note that you can be a server without allowing users to make
  95. connections from your computer to the outside world. This is called being
  96. a middleman server.</p>
  97. <p> Benefits of running a server include:
  98. <ul>
  99. <li>Clients are generally limited to 100KB/s, whereas servers can inject
  100. or receive as much traffic as they want.
  101. <li>You may get stronger anonymity, since your destination can't know
  102. whether connections relayed through your computer originated at your
  103. computer or not.
  104. <li>You can also get stronger anonymity by configuring your Tor clients
  105. to use your Tor server for entry or for exit.
  106. <li>You're helping me with development and scalability testing.
  107. <li>You're helping your fellow Internet users by providing a larger
  108. network. Also, having servers in many different pieces of the Internet
  109. gives users more robustness against curious telcos and brute force
  110. attacks.
  111. </ul>
  112. <p>You can read more about setting up Tor as a
  113. server <a href="#server">below</a>.</p>
  114. <a name="installing"></a>
  115. <h2>Installing Tor</h2>
  116. <p>You can get the latest releases <a
  117. href="http://freehaven.net/tor/dist/">here</a>.</p>
  118. <p>If you got Tor from a tarball, unpack it: <tt>tar xzf
  119. tor-0.0.7.tar.gz; cd tor-0.0.7</tt>. Run <tt>./configure</tt>, then
  120. <tt>make</tt>, and then <tt>make install</tt> (as root if necessary). Then
  121. you can launch tor from the command-line by running <tt>tor</tt>.</p>
  122. <p>If you got Tor from the Win32 .exe file, you
  123. can just click-click it (you may need to install <a
  124. href="http://www.slproweb.com/products/Win32OpenSSL.html">OpenSSL
  125. 0.9.7</a> first, if you get an error about missing
  126. libeay32.dll.) You might also want to run Tor in a dos window,
  127. so you can see its logs, and see its error messages if it
  128. crashes. If you don't want the default configuration, fetch the <a
  129. href="http://freehaven.net/tor/doc/torrc.sample">torrc</a>, edit it,
  130. and use <tt>tor.exe -f torrc</tt>.</p>
  131. <p>Otherwise, if you got it prepackaged (e.g. in the <a
  132. href="http://packages.debian.org/tor">Debian package</a> or <a
  133. href="http://packages.gentoo.org/packages/?category=net-misc;name=tor">Gentoo
  134. package</a>), these steps are already done for you, and you may
  135. even already have Tor started in the background (logging to
  136. /var/log/something).</p>
  137. <p>In any case, see the next section for what to <i>do</i> with it now that
  138. you've got it running.</p>
  139. <a name="client"></a>
  140. <h2>Configuring a client</h2>
  141. <p>Tor comes configured as a client by default. It uses a built-in
  142. default configuration file, and most people won't need to change any of
  143. the settings.</p>
  144. <p>The only setting you might need to change is "SocksAddress".
  145. By default, your Tor client only listens for applications that connect
  146. from localhost. Connections from other computers are refused. If you
  147. want to torify applications on different computers than the Tor client,
  148. you should copy torrc.sample to torrc (it's installed by default
  149. to /usr/local/etc/tor/), change the SocksAddress line to
  150. 0.0.0.0, and then restart Tor.</p>
  151. <p>To test if it's working, point your browser
  152. to socks4 or socks5 proxy at localhost port 9050. In
  153. Mozilla, this is in edit|preferences|advanced|proxies. Go to <a
  154. href="http://www.junkbusters.com/cgi-bin/privacy">http://www.junkbusters.com/cgi-bin/privacy</a>
  155. and see what IP it says you're coming from. (If you have a personal
  156. firewall, be sure to allow local connections to port 9050. If your
  157. firewall blocks outgoing connections, punch a hole so it can connect to
  158. TCP *:9001-9004 and *:9030-9033. If you're using Safari as your browser,
  159. keep in mind that OS X before 10.3 claims to support socks but does
  160. not.)</p>
  161. <p>Once you've tested that it works, you should install <a
  162. href="http://www.privoxy.org/">privoxy</a>, which is a filtering web
  163. proxy that integrates well with Tor. Add the line <br>
  164. <tt>forward-socks4a / localhost:9050 .</tt><br>
  165. (don't forget the dot) to its
  166. config file. Then change your mozilla to http proxy at localhost port 8118
  167. (and no socks proxy). This step will give you good html scrubbing as well.
  168. (See <a href="http://freehaven.net/tor/cvs/doc/CLIENTS">this explanation</a>
  169. for why direct socks gives you less anonymity.)</p>
  170. <p>You might want to use Tor with an application that doesn't
  171. support socks directly. In this case, you should look at
  172. using <a href="http://tsocks.sourceforge.net/">tsocks</a>
  173. to dynamically replace the system calls in your program to
  174. route through Tor. If you want to use socks4a, consider using <a
  175. href="http://www.dest-unreach.org/socat/">socat</a> (specific instructions
  176. are on <a href="http://6sxoyfb3h2nvok2d.onion/tor/SocatHelp">this hidden
  177. service url</a>).</p>
  178. <a name="server"></a>
  179. <h2>Configuring a server</h2>
  180. <p>We're looking for people with reasonably reliable Internet connections,
  181. that have at least 768kbit each way. Currently we don't use all of that,
  182. but we want it available for burst traffic.</p>
  183. <p>The Tor server doesn't need to be run as root, and doesn't
  184. need any special system permissions or kernel mods. If you're
  185. the paranoid sort, feel free to put it into a chroot jail (<a
  186. href="http://archives.seul.org/or/dev/Jun-2004/msg00001.html">some
  187. hints</a>), etc.</p>
  188. <p>First, copy torrc.sample to torrc (by default it's in
  189. /usr/local/etc/tor/), and edit the middle part. Create the DataDirectory,
  190. and make sure it's owned by whoever will be running tor. Fix your system
  191. clock so it's not too far off. Make sure name resolution works. Open a
  192. hole in your firewall so outsiders can connect to your ORPort.</p>
  193. <p>Then run tor to generate keys: <tt>tor</tt>. One of the files generated
  194. in your DataDirectory is your 'fingerprint' file. Mail it to
  195. tor-ops@freehaven.net.</p>
  196. <p>In that mail, be sure to tell us who you are, so we know whom to contact
  197. if there's any problem. Also describe what kind of connectivity the new
  198. server will have. If possible, PGP sign your mail.</p>
  199. <p>NOTE: You won't be able to use tor as a client or server
  200. in this configuration until you've been added to the directory
  201. and can authenticate to the other nodes.</p>
  202. <p>Once your fingerprint has been approved, you can click <a
  203. href="http://moria.seul.org:9031/">here</a> or <a
  204. href="http://62.116.124.106:9030/">here</a> and look at the
  205. running-routers line to see if your server is part of the network.</p>
  206. <a name="hidden-service"></a>
  207. <h2>Configuring a hidden service</h2>
  208. <p>Tor allows clients and servers to offer <em>hidden services</em>. That
  209. is, you can offer an apache, sshd, etc, without revealing your IP to its
  210. users. This works via Tor's rendezvous point design: both sides build
  211. a Tor circuit out, and they meet in the middle.</p>
  212. <p>If you're using Tor and <a href="http://www.privoxy.org/">Privoxy</a>,
  213. you can <a href="http://6sxoyfb3h2nvok2d.onion/">go to the hidden wiki</a>
  214. to see hidden services in action.</p>
  215. <p>To set up a hidden service, copy torrc.sample to torrc (by default it's
  216. in /usr/local/etc/tor/), and edit the bottom part. Then run Tor. It will
  217. create each HiddenServiceDir you have configured, and it will create a
  218. 'hostname' file which specifies the url (xyz.onion) for that service. You
  219. can tell people the url, and they can connect to it via their Tor client,
  220. assuming they're using a proxy (such as Privoxy) that speaks socks4a.</p>
  221. <a name="own-network"></a>
  222. <h2>Setting up your own network</h2>
  223. <p>
  224. If you want to experiment locally with your own network, or you're cut
  225. off from the Internet and want to be able to mess with Tor still, then
  226. you may want to set up your own separate Tor network.
  227. <p>
  228. To set up your own Tor network, you need to run your own directory
  229. servers, and you need to change the tarball so it points to your directory
  230. servers rather than the default ones.
  231. <ul>
  232. <li>1: Grab the latest release.
  233. <li>2: For each directory server you want,
  234. <ul>
  235. <li>2a: Set it up as a server (see <a href="#server">"setting up a
  236. server"</a> above), with a least ORPort, DataDirectory, and Nickname
  237. defined.
  238. <li>2b: Set "DirPort" to the intended port for serving directories.
  239. <li>2c: Set "RecommendedVersions" to a comma-separated list of acceptable
  240. versions of the code for clients and servers to be running (see step
  241. 4c below).
  242. <!-- <li>2d: Create a file called approved-routers in your DataDirectory:
  243. <tt>touch approved-routers</tt>. It will be empty for now. We'll fill it in
  244. step 5. -->
  245. <li>2d: Create an empty dirservers file (<tt>touch dirservers</tt>). Point
  246. RouterFile at it in your torrc.
  247. <li>2e: Run it: <tt>tor -f torrc</tt>. This will generate your keys and a
  248. router.desc (router descriptor) file. It will then exit with a complaint
  249. that it can't open the fingerprint file; that's fine.
  250. </ul>
  251. <li>3: Create the new dirservers file. You do this by concatenating the
  252. "router.desc" files from each dirserver's DataDirectory: <tt>cat router1.desc
  253. router2.desc ... &gt; dirservers</tt>
  254. <li>4: Now you need to teach clients and servers to use the new
  255. dirservers file. First, check out the tor cvs repository (instructions <a
  256. href="http://freehaven.net/tor/">here</a> -- be sure to check out the
  257. tag that matches the version of the code you intend to use; and note that
  258. the latest cvs version may not compile or work right). Then:
  259. <ul>
  260. <li>4a: Edit src/or/config.c and change the default_dirservers_string array
  261. so that it reflects the contents of the new dirservers file instead
  262. of the old one. Be sure to get the quotes and newlines and semicolons
  263. right. (This step sucks. Please suggest a better way to handle this
  264. step. ;)
  265. <li>4b: Replace the dirservers file in your sandbox (in src/config/)
  266. with the one from step 3.
  267. <li>4c: edit configure.in, change the AM_INIT_AUTOMAKE(tor, 0.0.6)
  268. line so that it specifies a version that is specific to you, such as
  269. 0.0.6-arma. This will help you keep from being confused later. Be sure
  270. to update the RecommendedVersions lines to include this version.
  271. <li>4d: run <tt>./autogen.sh</tt> (you'll need a new enough set of auto* tools),
  272. then <tt>make dist</tt>.
  273. </ul>
  274. <li>5: Create a file called approved-routers in the DataDirectory
  275. of each directory server. Collect the 'fingerprint' lines from the
  276. DataDirectory of each server (including directory servers), and include
  277. them (one per line) in each approved-routers file. You can hup the tor
  278. process for each directory server to reload the approved-routers file
  279. (so you don't have to restart the process).
  280. </ul>
  281. <h2>Other doc resources</h2>
  282. <ul>
  283. <li>Design paper
  284. <li>Spec and rend-spec
  285. <li>others
  286. </ul>
  287. </body>
  288. </html>