tor-doc.html 20 KB

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