71e9be637653a0c11619efbd3de55fba6b1311b6
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

1) ## translation metadata
2) # Revision: $Revision$
3) 
Roger Dingledine similar patch on the docs/e...

Roger Dingledine authored 18 years ago

4) #include "head.wmi" TITLE="Hidden Service Configuration Instructions"
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

5) 
6) <div class="center">
7) 
8) <div class="main-column">
9) 
10) <h1>Configuring Hidden Services for <a href="<page index>">Tor</a></h1>
11) <hr />
12) 
13) <p>Tor allows clients and servers to offer hidden services. That is,
14) you can offer a web server, SSH server, etc., without revealing your
Roger Dingledine Get rid of the dangerous in...

Roger Dingledine authored 17 years ago

15) IP address to its users. In fact, because you don't use any public address,
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

16) you can run a hidden service from behind your firewall.
17) </p>
18) 
19) <p>If you have Tor and Privoxy installed, you can see hidden services
20) in action by visiting <a href="http://6sxoyfb3h2nvok2d.onion/">the
21) hidden wiki</a>.
22) </p>
23) 
24) <p>This howto describes the steps for setting up your own hidden service
25) website.
26) </p>
27) 
28) <hr />
29) <a id="zero"></a>
30) <h2><a class="anchor" href="#zero">Step Zero: Get Tor and Privoxy working</a></h2>
31) <br />
32) 
33) <p>Before you start, you need to make sure 1) Tor is up and running,
34) 2) Privoxy is up and running, 3) Privoxy is configured to point
35) to Tor, and 4) You actually set it up correctly.</p>
36) 
37) <p>Windows users should follow the <a
38) href="<page docs/tor-doc-win32>">Windows
39) howto</a>, OS X users should follow the <a
40) href="<page docs/tor-doc-osx>">OS
41) X howto</a>, and Linux/BSD/Unix users should follow the <a
42) href="<page docs/tor-doc-unix>">Unix howto</a>.
43) </p>
44) 
45) <p>Once you've got Tor and Privoxy installed and configured,
46) you can see hidden services in action by following this link to <a
47) href="http://6sxoyfb3h2nvok2d.onion/">the hidden wiki</a>.
48) It will typically take 10-60 seconds to load
49) (or to decide that it is currently unreachable). If it fails
50) immediately and your browser pops up an alert saying that
51) "www.6sxoyfb3h2nvok2d.onion could not be found, please check the name and
52) try again" then you haven't configured Tor and Privoxy correctly; see <a
Roger Dingledine Get rid of the dangerous in...

Roger Dingledine authored 17 years ago

53) href="http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#ItDoesntWork">the
54) it-doesn't-work FAQ entry</a> for some help.
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

55) </p>
56) 
57) <hr />
58) <a id="one"></a>
Roger Dingledine Get rid of the dangerous in...

Roger Dingledine authored 17 years ago

59) <h2><a class="anchor" href="#one">Step One: Install a web server locally</a></h2>
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

60) <br />
61) 
Roger Dingledine Get rid of the dangerous in...

Roger Dingledine authored 17 years ago

62) <p>First, you need to set up a web server locally. Setting up a web
63) server can be tricky,
64) so we're just going to go over a few basics here. If you get stuck
65) or want to do more, find a friend who can help you. We recommend you
66) install a new separate web server for your hidden service, since even
67) if you already have one installed, you may be using it (or want to use
68) it later) for an actual website.
69) </p>
70) 
71) <p>If you're on Unix or OS X and you're comfortable with
72) the command-line, by far the best way to go is to install <a
73) href="http://www.acme.com/software/thttpd/">thttpd</a>. Just grab the
74) latest tarball, untar it (it will create its own directory), and run
75) ./configure &amp;&amp; make. Then mkdir hidserv, cd hidserv, and run
76) "../thttpd -p 5222 -h localhost". It will give you back your prompt,
77) and now you're running a webserver on port 5222. You can put files to
78) serve in the hidserv directory.
79) </p>
80) 
81) <p>If you're on Windows, you might pick <a
82) href="http://savant.sourceforge.net/">Savant</a> or <a
83) href="http://httpd.apache.org/">Apache</a>, and be sure to configure it
84) to bind only to localhost. You should also figure out what port you're
85) listening on, because you'll use it below.
86) </p>
87) 
88) <p>(The reason we bind the web server only to localhost is to make
89) sure it isn't publically accessible. If people could get to it directly,
90) they could confirm that your computer is the one offering the hidden
91) service.)
92) </p>
93) 
94) <p>Once you've got your web server set up, make sure it works: open your
95) browser and go to <a
96) href="http://localhost:5222/">http://localhost:5222/</a>, where 5222 is
97) the port that you picked above. Then try putting a file in the main html
98) directory, and make sure it shows up when you access the site.
99) </p>
100) 
101) <hr />
102) <a id="two"></a>
103) <h2><a class="anchor" href="#two">Step Two: Configure your hidden service</a></h2>
104) <br />
105) 
106) <p>Next, you need to configure your hidden service to point to your
107) local web server.
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

108) </p>
109) 
110) <p>First, open your torrc file in your favorite text editor. (See <a
Roger Dingledine Get rid of the dangerous in...

Roger Dingledine authored 17 years ago

111) href="http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#torrc">the
112) torrc FAQ entry</a> to learn what this means.) Go to the middle section and
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

113) look for the line</p>
114) 
115) <pre>
Roger Dingledine and resolve the other use-o...

Roger Dingledine authored 18 years ago

116) \############### This section is just for location-hidden services ###
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

117) </pre>
118) 
119) <p>
120) This section of the file consists of groups of lines, each representing
121) one hidden service. Right now they are all commented out (the lines
122) start with #), so hidden services are disabled. Each group of lines
123) consists of one HiddenServiceDir line, and one or more HiddenServicePort
124) lines:</p>
125) <ul>
126) <li><b>HiddenServiceDir</b> is a directory where Tor will store information
127) about that hidden service.  In particular, Tor will create a file here named
128) <i>hostname</i> which will tell you the onion URL.  You don't need to add any
129) files to this directory.</li>
130) <li><b>HiddenServicePort</b> lets you specify a virtual port (that is, what
131) port people accessing the hidden service will think they're using) and an
132) IP address and port for redirecting connections to this virtual port.</li>
133) </ul>
134) 
Roger Dingledine Get rid of the dangerous in...

Roger Dingledine authored 17 years ago

135) <p>Add the following lines to your torrc:
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

136) </p>
137) 
138) <pre>
139) HiddenServiceDir /Library/Tor/var/lib/tor/hidden_service/
Roger Dingledine Get rid of the dangerous in...

Roger Dingledine authored 17 years ago

140) HiddenServicePort 80 127.0.0.1:5222
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

141) </pre>
142) 
143) <p>You're going to want to change the HiddenServiceDir line, so it points
144) to an actual directory that is readable/writeable by the user that will
145) be running Tor. The above line should work if you're using the OS X Tor
146) package. On Unix, try "/home/username/hidserv/" and fill in your own
147) username in place of "username". On Windows you might pick:</p>
148) <pre>
Roger Dingledine repair the tor hidden servi...

Roger Dingledine authored 18 years ago

149) HiddenServiceDir C:\Documents and Settings\username\Application Data\hidden_service\\
Roger Dingledine Get rid of the dangerous in...

Roger Dingledine authored 17 years ago

150) HiddenServicePort 80 127.0.0.1:5222
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

151) </pre>
152) 
153) <p>Now save the torrc, shut down
Roger Dingledine Get rid of the dangerous in...

Roger Dingledine authored 17 years ago

154) your Tor, and then start it again.
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

155) </p>
156) 
157) <p>If Tor starts up again, great. Otherwise, something is wrong. Look
158) at your torrc for obvious mistakes like typos. Then double-check
159) that the directory you picked is writeable by you. If it's still
160) not working, you should look at the Tor logs for hints. (See <a
Roger Dingledine Get rid of the dangerous in...

Roger Dingledine authored 17 years ago

161) href="http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#Logs">the
162) logging FAQ entry</a> if you don't know how to enable or find your
163) log file.)
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

164) </p>
165) 
166) <p>When Tor starts, it will automatically create the HiddenServiceDir
167) that you specified (if necessary), and it will create two files there.
168) First, it will generate a new
169) public/private keypair for your hidden service, and write it into a
170) file called "private_key". Don't share this key with others -- if you
171) do they will be able to impersonate your hidden service.
172) </p>
173) 
174) <p>The other file it will create is called "hostname". This contains
175) a short summary of your public key -- it will look something like
176) <tt>6sxoyfb3h2nvok2d.onion</tt>. This is the public name for your service,
177) and you can tell it to people, publish it on websites, put it on business
178) cards, etc. (If Tor runs as a different user than you, for example on
179) OS X, Debian, or Red Hat, then you may need to become root to be able
180) to view these files.)
181) </p>
182) 
183) <p>Now that you've restarted Tor, it is busy picking introduction points
184) in the Tor network, and generating what's called a "hidden service
185) descriptor", which is a signed list of introduction points along with
186) the service's full public key. It anonymously publishes this descriptor
187) to the directory servers, and other people anonymously fetch it from the
188) directory servers when they're trying to access your service.
189) </p>
190) 
191) <p>Try it now: paste the contents of the hostname file into your web
Roger Dingledine Get rid of the dangerous in...

Roger Dingledine authored 17 years ago

192) browser. If it works, you'll get the html page you set up in step one.
193) If it doesn't work, look in your logs for some hints, and keep playing
194) with it until it works.
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

195) </p>
196) 
197) <hr />
198) <a id="three"></a>
Roger Dingledine Get rid of the dangerous in...

Roger Dingledine authored 17 years ago

199) <h2><a class="anchor" href="#three">Step Three: More advanced tips</a></h2>
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

200) <br />
201) 
202) <p>If you plan to keep your service available for a long time, you might
203) want to make a backup copy of the private_key file somewhere.
204) </p>
205) 
206) <p>We avoided recommending Apache above, a) because many people might
207) already be running it for a public web server on their computer, and b)
208) because it's big
209) and has lots of places where it might reveal your IP address or other
210) identifying information, for example in 404 pages. For people who need
211) more functionality, though, Apache may be the right answer. Can
212) somebody make us a checklist of ways to lock down your Apache when you're
Roger Dingledine recommend savant as a webse...

Roger Dingledine authored 17 years ago

213) using it as a hidden service? Savant probably has these problems too.
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

214) </p>
215) 
216) <p>If you want to forward multiple virtual ports for a single hidden
217) service, just add more HiddenServicePort lines.
218) If you want to run multiple hidden services from the same Tor
219) client, just add another HiddenServiceDir line. All the following
220) HiddenServicePort lines refer to this HiddenServiceDir line, until
221) you add another HiddenServiceDir line:
222) </p>
223) 
224) <pre>
225) HiddenServiceDir /usr/local/etc/tor/hidden_service/
226) HiddenServicePort 80 127.0.0.1:8080
227) 
228) HiddenServiceDir /usr/local/etc/tor/other_hidden_service/
229) HiddenServicePort 6667 127.0.0.1:6667
230) HiddenServicePort 22 127.0.0.1:22
231) </pre>
232) 
233) <p>There are some anonymity issues you should keep in mind too:
234) </p>
235) <ul>
236) <li>As mentioned above, be careful of letting your web server reveal
237) identifying information about you, your computer, or your location.
238) For example, readers can probably determine whether it's thttpd or
239) Apache, and learn something about your operating system.</li>
240) <li>If your computer isn't online all the time, your hidden service
241) won't be either. This leaks information to an observant adversary.</li>
242) <!-- increased risks over time -->
243) </ul>
244) 
245) <hr />
246) 
247) <p>If you have suggestions for improving this document, please <a
Roger Dingledine add a step to tor-doc-serve...

Roger Dingledine authored 18 years ago

248) href="<page contact>">send them to us</a>. Thanks!</p>