tor-doc.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  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="tor-doc.css">
  8. </head>
  9. <body>
  10. <h1><a href="http://tor.freehaven.net/">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, 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>
  47. <p>Companies need Tor for business security:
  48. <ul>
  49. <li>Competitive analysis: browse the competition's website safely.
  50. <li>Protecting collaborations of sensitive business units or partners.
  51. <li>Protecting procurement suppliers or patterns.
  52. <li>Putting the "P" back in "VPN": traditional VPNs reveal the exact
  53. amount and frequency of communication. Which locations have employees
  54. working late? Which locations have employees consulting job-hunting
  55. websites? Which research groups are communicating with your company's
  56. patent lawyers?
  57. </ul>
  58. <p>Governments need Tor for traffic-analysis-resistant communication:
  59. <ul>
  60. <li>Open source intelligence gathering (hiding individual analysts is
  61. not enough -- the organization itself may be sensitive).
  62. <li>Defense in depth on open <em>and classified</em> networks -- networks
  63. with a million users (even if they're all cleared) can't be made safe just
  64. by hardening them to external threat.
  65. <li>Dynamic and semi-trusted international coalitions: the network can
  66. be shared without revealing the existence or amount of communication
  67. between all parties.
  68. <li>Networks partially under known hostile control: to block
  69. communications, the enemy must take down the whole network.
  70. <li>Politically sensitive negotiations.
  71. <li>Road warriors.
  72. <li>Protecting procurement patterns.
  73. <li>Anonymous tips.
  74. </ul>
  75. <p>Law enforcement needs Tor for safety:
  76. <ul>
  77. <li>Allowing anonymous tips or crime reporting
  78. <li>Allowing agents to observe websites without notifying them that
  79. they're being observed (or, more broadly, without having it be an
  80. official visit from law enforcement).
  81. <li>Surveillance and honeypots (sting operations)
  82. </ul>
  83. <p>Does the idea of sharing the Tor network with
  84. all of these groups bother you? It shouldn't -- <a
  85. href="http://freehaven.net/doc/fc03/econymics.pdf">you need them for
  86. your security</a>.</p>
  87. <a name="client-or-server"></a>
  88. <h2>Should I run a client or a server?</h2>
  89. <p>You can run Tor in either client mode or server mode. By default,
  90. everybody is a <i>client</i>. This means you don't relay traffic for
  91. anybody but yourself.</p>
  92. <p>If your computer doesn't have a routable IP address or you're using
  93. a modem, you should stay a client. Otherwise, please consider being
  94. a server, to help out the network. (Currently each server uses 20-150
  95. gigabytes of traffic per month, depending on its capacity and its rate
  96. limiting configuration.)</p>
  97. <p>Note that you can be a server without allowing users to make
  98. connections from your computer to the outside world. This is called being
  99. a middleman server.</p>
  100. <p> Benefits of running a server include:
  101. <ul>
  102. <li>Clients are generally limited to 100KB/s (and in practice, sometimes
  103. much less), whereas servers can inject or receive as much traffic as
  104. they want.
  105. <li>You may get stronger anonymity, since your destination can't know
  106. whether connections relayed through your computer originated at your
  107. computer or not.
  108. <li>You can also get stronger anonymity by configuring your Tor clients
  109. to use your Tor server for entry or for exit.
  110. <li>You're helping me with development and scalability testing.
  111. <li>You're helping your fellow Internet users by providing a larger
  112. network. Also, having servers in many different pieces of the Internet
  113. gives users more robustness against curious telcos and brute force
  114. attacks.
  115. </ul>
  116. <p>You can read more about setting up Tor as a
  117. server <a href="#server">below</a>.</p>
  118. <a name="installing"></a>
  119. <h2>Installing Tor</h2>
  120. <p>You can get the latest releases <a
  121. href="http://tor.freehaven.net/dist/">here</a>.</p>
  122. <p>If you got Tor from a tarball, unpack it: <tt>tar xzf
  123. tor-0.0.9.tar.gz; cd tor-0.0.9</tt>. Run <tt>./configure</tt>, then
  124. <tt>make</tt>, and then <tt>make install</tt> (as root if necessary). Then
  125. you can launch tor from the command-line by running <tt>tor</tt>.</p>
  126. <p>If you got Tor from the Win32 .exe file, you
  127. can just click-click it (you may need to install <a
  128. href="http://www.slproweb.com/products/Win32OpenSSL.html">OpenSSL
  129. 0.9.7</a> first, if you get an error about missing
  130. libeay32.dll.) You might also want to run Tor in a dos window,
  131. so you can see its logs, and see its error messages if it
  132. crashes. If you don't want the default configuration, fetch the <a
  133. href="http://tor.freehaven.net/cvs/tor/src/config/torrc.sample.in">torrc</a>, edit it,
  134. and use <tt>tor.exe -f torrc</tt>.</p>
  135. <p>Otherwise, if you got it prepackaged (e.g. in the <a
  136. href="http://packages.debian.org/tor">Debian package</a> or <a
  137. href="http://packages.gentoo.org/packages/?category=net-misc;name=tor">Gentoo
  138. package</a>), these steps are already done for you, and you may
  139. even already have Tor started in the background (logging to
  140. /var/log/something).</p>
  141. <p>In any case, see the next section for what to <i>do</i> with it now that
  142. you've got it running.</p>
  143. <a name="client"></a>
  144. <h2>Configuring a client</h2>
  145. <p>Tor comes configured as a client by default. It uses a built-in
  146. default configuration file, and most people won't need to change any of
  147. the settings.</p>
  148. <p>The only setting you might need to change is "SocksBindAddress".
  149. By default, your Tor client only listens for applications that connect
  150. from localhost. Connections from other computers are refused. If you
  151. want to torify applications on different computers than the Tor client,
  152. you should copy torrc.sample to torrc (it's installed by default
  153. to /usr/local/etc/tor/), change the SocksBindAddress line to
  154. 0.0.0.0, and then hup or restart Tor.</p>
  155. <p>To test if it's working, point your browser
  156. to socks4 or socks5 proxy at localhost port 9050. In
  157. Mozilla, this is in edit|preferences|advanced|proxies. Go to <a
  158. href="http://www.junkbusters.com/cgi-bin/privacy">http://www.junkbusters.com/cgi-bin/privacy</a>
  159. and see what IP it says you're coming from. (If you have a personal
  160. firewall, be sure to allow local connections to port 9050. If your
  161. firewall blocks outgoing connections, punch a hole so it can connect to
  162. TCP *:9001-9004 and *:9030-9033. If you're using Safari as your browser,
  163. keep in mind that OS X before 10.3 claims to support socks but does
  164. not.)</p>
  165. <p>Once you've tested that it works, you should install <a
  166. href="http://www.privoxy.org/">privoxy</a>, which is a filtering web
  167. proxy that integrates well with Tor. Add the line <br>
  168. <tt>forward-socks4a / localhost:9050 .</tt><br>
  169. (don't forget the dot) to its config file (you can just add it to the
  170. top). Then change your mozilla to http proxy at localhost port 8118
  171. (and no socks proxy). You should also set your SSL proxy to the same
  172. thing, to hide your https traffic. Using privoxy is necessary because
  173. <a href="http://tor.freehaven.net/cvs/tor/doc/CLIENTS">Mozilla leaks your
  174. DNS requests when it uses a socks proxy directly</a>. Privoxy also gives
  175. you good html scrubbing.</p>
  176. <p>You might want to use Tor with an application that doesn't
  177. support socks directly. In this case, you should look at
  178. using <a href="http://tsocks.sourceforge.net/">tsocks</a>
  179. to dynamically replace the system calls in your program to
  180. route through Tor. If you want to use socks4a, consider using <a
  181. href="http://www.dest-unreach.org/socat/">socat</a> (specific instructions
  182. are on <a href="http://6sxoyfb3h2nvok2d.onion/tor/SocatHelp">this hidden
  183. service url</a>).</p>
  184. <p>(Windows doesn't have tsocks; instead, you can try
  185. <a
  186. href="http://www.socks.permeo.com/Download/SocksCapDownload/index.asp">SocksCap</a>
  187. or the <a href="http://www.hummingbird.com/products/nc/socks/index.html?cks=y">Hummingbird</a>
  188. SOCKS client.)</p>
  189. <a name="server"></a>
  190. <h2>Configuring a server</h2>
  191. <p>We're looking for people with reasonably reliable Internet connections,
  192. that have at least 20 kilobytes/s each way. If you have more bandwidth
  193. to offer, that's even better.</p>
  194. <p>To set up a Tor server, do the following steps after installing Tor.
  195. (These instructions are Unix-centric; if you're excited about working
  196. with us to get a Tor server working on Windows, let us know and we'll
  197. work with you to fix whatever bugs come up.)
  198. </p>
  199. <ul>
  200. <li>1. Copy torrc.sample to torrc (in the default configuration this
  201. means copy /usr/local/etc/tor/torrc.sample to /usr/local/etc/tor/torrc),
  202. and edit the bottom part. Create the DataDirectory, and make sure it's
  203. owned by the uid/gid that will be running tor. Fix your system clock so
  204. it's not too far off. Make sure name resolution works.
  205. <!--Make sure each
  206. process can get to 1024 file descriptors (this should be already done
  207. for everybody but some BSD folks). -->
  208. <li>2. Run tor to generate keys and then exit: <tt>tor
  209. --list-fingerprint</tt>. Send mail to tor-ops@freehaven.net including
  210. a) this key fingerprint, b) who you are, so we know whom to contact if
  211. there's any problem, and c) what kind of connectivity the new server
  212. will have. If possible, PGP sign your mail.
  213. <li>3. If you are using a firewall, open a hole in your firewall so
  214. incoming connections can reach the ports you configured (i.e. ORPort,
  215. plus DirPort if you enabled it). Make sure outgoing connections can reach
  216. at least ports 80, 443, and 9001-9033 (to get to other onion routers),
  217. plus any other addresses or ports your exit policy allows.
  218. <li>4. Start your server: <tt>tor</tt>. If it logs any warnings,
  219. address them.
  220. </ul>
  221. Optionally, we recommend the following steps as well:
  222. <ul>
  223. <li>1. Make a separate user to run the server. If you
  224. installed the deb or the rpm, this is already done. Otherwise,
  225. you can do it by hand. (The Tor server doesn't need to be run as
  226. root, so it's good practice to not run it as root. Running as a
  227. 'tor' user avoids issues with identd and other services that
  228. detect user name. If you're the paranoid sort, feel free to <a
  229. href="http://wiki.noreply.org/wiki/TheOnionRouter/TorInChroot">put Tor
  230. into a chroot jail</a>.)
  231. <li>2. Decide what exit policy you want. By default your server allows
  232. access to many popular services, but we restrict some (such as port 25)
  233. due to abuse potential. You might want an exit policy that is either
  234. less restrictive or more restrictive; edit your torrc appropriately.
  235. If you choose a particularly open exit policy, you might want to make
  236. sure your upstream or ISP is ok with that choice.
  237. <li>3. You may find the initscripts in contrib/tor.sh or
  238. contrib/torctl useful if you want to set up Tor to start at boot. Let
  239. us know which script you find more useful.
  240. <li>4. Consider setting your hostname to 'anonymous' or
  241. 'proxy' or 'tor-proxy' if you can, so when other people see the address
  242. in their web logs or whatever, they will more quickly understand what's
  243. going on.
  244. <li>5. If you're not running anything else on port 80 or port
  245. 443, please consider setting up port-forwarding and advertising these
  246. low-numbered ports as your Tor server. This will help allow users behind
  247. particularly restrictive firewalls to access the Tor network. See section
  248. 4 of <a href="http://wiki.noreply.org/wiki/TheOnionRouter_2fTorFAQ">the
  249. FAQ</a> for details of how to set this up.
  250. </ul>
  251. <p>You can click <a href="http://moria.seul.org:9031/">here</a> or <a
  252. href="http://62.116.124.106:9030/">here</a> and look at the router-status
  253. line to see if your server is part of the network. It will be listed by
  254. nickname once we have added your server to the list of known servers;
  255. otherwise it is listed only by its fingerprint.</p>
  256. <a name="hidden-service"></a>
  257. <h2>Configuring a hidden service</h2>
  258. <p>Tor allows clients and servers to offer <em>hidden services</em>. That
  259. is, you can offer an apache, sshd, etc, without revealing your IP to its
  260. users. This works via Tor's rendezvous point design: both sides build
  261. a Tor circuit out, and they meet in the middle.</p>
  262. <p>If you're using Tor and <a href="http://www.privoxy.org/">Privoxy</a>,
  263. you can <a href="http://6sxoyfb3h2nvok2d.onion/">go to the hidden wiki</a>
  264. to see hidden services in action.</p>
  265. <p>To set up a hidden service, copy torrc.sample to torrc (by default it's
  266. in /usr/local/etc/tor/), and edit the middle part. Then run Tor. It will
  267. create each HiddenServiceDir you have configured, and it will create a
  268. 'hostname' file which specifies the url (xyz.onion) for that service. You
  269. can tell people the url, and they can connect to it via their Tor client,
  270. assuming they're using a proxy (such as Privoxy) that speaks socks4a.</p>
  271. <a name="own-network"></a>
  272. <h2>Setting up your own network</h2>
  273. <p>
  274. If you want to experiment locally with your own network, or you're cut
  275. off from the Internet and want to be able to mess with Tor still, then
  276. you may want to set up your own separate Tor network.
  277. <p>
  278. To set up your own Tor network, you need to run your own directory
  279. servers, and you need to configure each client and server so it knows
  280. about your directory servers rather than the default ones.
  281. <ul>
  282. <li>1: Grab the latest release. Use at least 0.0.9rc6.
  283. <li>2: For each directory server you want,
  284. <ul>
  285. <li>2a: Set it up as a server (see <a href="#server">"setting up a
  286. server"</a> above), with a least ORPort, DirPort, DataDirectory, and Nickname
  287. defined. Set "AuthoritativeDirectory 1".
  288. <li>2b: Set "RecommendedVersions" to a comma-separated list of acceptable
  289. versions of the code for clients and servers to be running.
  290. <li>2c: Run it: <tt>tor --list-fingerprint</tt> if your torrc is in
  291. the default place, or <tt>tor -f torrc --list-fingerprint</tt> to
  292. specify one. This will generate your keys and output a fingerprint
  293. line.
  294. </ul>
  295. <li>3: Now you need to teach clients and servers to use the new
  296. dirservers. For each fingerprint, add a line like<br>
  297. <tt>DirServer 18.244.0.114:80 719B E45D E224 B607 C537 07D0 E214 3E2D 423E 74CF</tt><br>
  298. to the torrc of each client and server who will be using your network.
  299. <li>4: Create a file called approved-routers in the DataDirectory
  300. of each directory server. Collect the 'fingerprint' lines from
  301. each server (including directory servers), and include them (one per
  302. line) in each approved-routers file. You can hup the tor process for
  303. each directory server to reload the approved-routers file (so you don't
  304. have to restart the process).
  305. </ul>
  306. <!--<h2>Other doc resources</h2>
  307. <ul>
  308. <li>Design paper
  309. <li>Spec and rend-spec
  310. <li>others
  311. </ul> -->
  312. </body>
  313. </html>