31632992896094dda6b0df2fc23cf4f15668984c
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) 
Jens Kubieziel - HTML-ized the document a...

Jens Kubieziel authored 17 years ago

33) <p>Before you start, you need to make sure:</p>
34) <ol>
35) <li>Tor is up and running,</li>
36) <li>Privoxy is up and running,</li>
37) <li>Privoxy is configured to point to Tor and</lI>
38) <li>You actually set it up correctly.</li>
39) </ol>
40) 
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

41) 
42) <p>Windows users should follow the <a
43) href="<page docs/tor-doc-win32>">Windows
44) howto</a>, OS X users should follow the <a
45) href="<page docs/tor-doc-osx>">OS
46) X howto</a>, and Linux/BSD/Unix users should follow the <a
47) href="<page docs/tor-doc-unix>">Unix howto</a>.
48) </p>
49) 
50) <p>Once you've got Tor and Privoxy installed and configured,
51) you can see hidden services in action by following this link to <a
52) href="http://6sxoyfb3h2nvok2d.onion/">the hidden wiki</a>.
53) It will typically take 10-60 seconds to load
54) (or to decide that it is currently unreachable). If it fails
55) immediately and your browser pops up an alert saying that
56) "www.6sxoyfb3h2nvok2d.onion could not be found, please check the name and
57) 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

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

Roger Dingledine authored 18 years ago

60) </p>
61) 
62) <hr />
63) <a id="one"></a>
Roger Dingledine Get rid of the dangerous in...

Roger Dingledine authored 17 years ago

64) <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

65) <br />
66) 
Roger Dingledine Get rid of the dangerous in...

Roger Dingledine authored 17 years ago

67) <p>First, you need to set up a web server locally. Setting up a web
68) server can be tricky,
69) so we're just going to go over a few basics here. If you get stuck
70) or want to do more, find a friend who can help you. We recommend you
71) install a new separate web server for your hidden service, since even
72) if you already have one installed, you may be using it (or want to use
73) it later) for an actual website.
74) </p>
75) 
76) <p>If you're on Unix or OS X and you're comfortable with
77) the command-line, by far the best way to go is to install <a
78) href="http://www.acme.com/software/thttpd/">thttpd</a>. Just grab the
79) latest tarball, untar it (it will create its own directory), and run
Jens Kubieziel - HTML-ized the document a...

Jens Kubieziel authored 17 years ago

80) <kbd>./configure &amp;&amp; make</kbd>. Then <kbd>mkdir hidserv; cd
81) hidserv</kbd>, and run
82) <kbd>../thttpd -p 5222 -h localhost</kbd>. It will give you back your prompt,
Roger Dingledine Get rid of the dangerous in...

Roger Dingledine authored 17 years ago

83) and now you're running a webserver on port 5222. You can put files to
84) serve in the hidserv directory.
85) </p>
86) 
87) <p>If you're on Windows, you might pick <a
88) href="http://savant.sourceforge.net/">Savant</a> or <a
89) href="http://httpd.apache.org/">Apache</a>, and be sure to configure it
90) to bind only to localhost. You should also figure out what port you're
91) listening on, because you'll use it below.
92) </p>
93) 
94) <p>(The reason we bind the web server only to localhost is to make
95) sure it isn't publically accessible. If people could get to it directly,
96) they could confirm that your computer is the one offering the hidden
97) service.)
98) </p>
99) 
100) <p>Once you've got your web server set up, make sure it works: open your
101) browser and go to <a
102) href="http://localhost:5222/">http://localhost:5222/</a>, where 5222 is
103) the port that you picked above. Then try putting a file in the main html
104) directory, and make sure it shows up when you access the site.
105) </p>
106) 
107) <hr />
108) <a id="two"></a>
109) <h2><a class="anchor" href="#two">Step Two: Configure your hidden service</a></h2>
110) <br />
111) 
112) <p>Next, you need to configure your hidden service to point to your
113) local web server.
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

114) </p>
115) 
116) <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

117) href="http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#torrc">the
118) 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

119) look for the line</p>
120) 
121) <pre>
Roger Dingledine and resolve the other use-o...

Roger Dingledine authored 18 years ago

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

Roger Dingledine authored 18 years ago

123) </pre>
124) 
125) <p>
126) This section of the file consists of groups of lines, each representing
127) one hidden service. Right now they are all commented out (the lines
128) start with #), so hidden services are disabled. Each group of lines
Jens Kubieziel - HTML-ized the document a...

Jens Kubieziel authored 17 years ago

129) consists of one <var>HiddenServiceDir</var> line, and one or more
130) <var>HiddenServicePort</var> lines:</p>
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

131) <ul>
Jens Kubieziel - HTML-ized the document a...

Jens Kubieziel authored 17 years ago

132) <li><var>HiddenServiceDir</var> is a directory where Tor will store information
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

133) about that hidden service.  In particular, Tor will create a file here named
Jens Kubieziel - HTML-ized the document a...

Jens Kubieziel authored 17 years ago

134) <var>hostname</var> which will tell you the onion URL.  You don't need to add any
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

135) files to this directory.</li>
Jens Kubieziel - HTML-ized the document a...

Jens Kubieziel authored 17 years ago

136) <li><var>HiddenServicePort</var> lets you specify a virtual port (that is, what
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

137) port people accessing the hidden service will think they're using) and an
138) IP address and port for redirecting connections to this virtual port.</li>
139) </ul>
140) 
Roger Dingledine Get rid of the dangerous in...

Roger Dingledine authored 17 years ago

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

Roger Dingledine authored 18 years ago

142) </p>
143) 
144) <pre>
145) HiddenServiceDir /Library/Tor/var/lib/tor/hidden_service/
Roger Dingledine Get rid of the dangerous in...

Roger Dingledine authored 17 years ago

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

Roger Dingledine authored 18 years ago

147) </pre>
148) 
Jens Kubieziel - HTML-ized the document a...

Jens Kubieziel authored 17 years ago

149) <p>You're going to want to change the <var>HiddenServiceDir</var> line, so it points
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

150) to an actual directory that is readable/writeable by the user that will
151) be running Tor. The above line should work if you're using the OS X Tor
152) package. On Unix, try "/home/username/hidserv/" and fill in your own
153) username in place of "username". On Windows you might pick:</p>
154) <pre>
Roger Dingledine repair the tor hidden servi...

Roger Dingledine authored 18 years ago

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

Roger Dingledine authored 17 years ago

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

Roger Dingledine authored 18 years ago

157) </pre>
158) 
159) <p>Now save the torrc, shut down
Roger Dingledine Get rid of the dangerous in...

Roger Dingledine authored 17 years ago

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

Roger Dingledine authored 18 years ago

161) </p>
162) 
Jens Kubieziel - HTML-ized the document a...

Jens Kubieziel authored 17 years ago

163) <p>If Tor starts up again, great. Otherwise, something is wrong. First look at
164) your logfiles for hints. It will print some warnings or error messages. That
165) should give you an idea what went wrong. Typically there are typos in the torrc
166) or wrong directory permissions (See <a
Roger Dingledine Get rid of the dangerous in...

Roger Dingledine authored 17 years ago

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

Roger Dingledine authored 18 years ago

170) </p>
171) 
Jens Kubieziel - HTML-ized the document a...

Jens Kubieziel authored 17 years ago

172) <p>When Tor starts, it will automatically create the <var>HiddenServiceDir</var>
173) that you specified (if necessary), and it will create two files there.</p>
174) 
175) <dl>
176) <dt><var>private_key</var></dt>
177) <dd>First, Tor will generate a new public/private keypair for your hidden
178) service. It is written into a file called "private_key". Don't share this key
179) with others -- if you do they will be able to impersonate your hidden
180) service.</dd>
181) <dt><var>hostname</var><dt>
182) <dd>The other file Tor will create is called "hostname". This contains
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

183) a short summary of your public key -- it will look something like
184) <tt>6sxoyfb3h2nvok2d.onion</tt>. This is the public name for your service,
185) and you can tell it to people, publish it on websites, put it on business
Jens Kubieziel - HTML-ized the document a...

Jens Kubieziel authored 17 years ago

186) cards, etc.</dd>
187) 
188) <p>If Tor runs as a different user than you, for example on
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

189) OS X, Debian, or Red Hat, then you may need to become root to be able
Jens Kubieziel - HTML-ized the document a...

Jens Kubieziel authored 17 years ago

190) to view these files.</p>
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

191) 
192) <p>Now that you've restarted Tor, it is busy picking introduction points
Jens Kubieziel - HTML-ized the document a...

Jens Kubieziel authored 17 years ago

193) in the Tor network, and generating a <em>hidden service
194) descriptor</em>. This is a signed list of introduction points along with
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

195) the service's full public key. It anonymously publishes this descriptor
196) to the directory servers, and other people anonymously fetch it from the
197) directory servers when they're trying to access your service.
198) </p>
199) 
200) <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

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

Roger Dingledine authored 18 years ago

204) </p>
205) 
206) <hr />
207) <a id="three"></a>
Roger Dingledine Get rid of the dangerous in...

Roger Dingledine authored 17 years ago

208) <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

209) <br />
210) 
211) <p>If you plan to keep your service available for a long time, you might
Jens Kubieziel - HTML-ized the document a...

Jens Kubieziel authored 17 years ago

212) want to make a backup copy of the <var>private_key</var> file somewhere.
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

213) </p>
214) 
215) <p>We avoided recommending Apache above, a) because many people might
216) already be running it for a public web server on their computer, and b)
217) because it's big
218) and has lots of places where it might reveal your IP address or other
219) identifying information, for example in 404 pages. For people who need
220) more functionality, though, Apache may be the right answer. Can
221) 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

222) 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

223) </p>
224) 
225) <p>If you want to forward multiple virtual ports for a single hidden
Jens Kubieziel - HTML-ized the document a...

Jens Kubieziel authored 17 years ago

226) service, just add more <var>HiddenServicePort</var> lines.
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

227) If you want to run multiple hidden services from the same Tor
Jens Kubieziel - HTML-ized the document a...

Jens Kubieziel authored 17 years ago

228) client, just add another <var>HiddenServiceDir</var> line. All the following
229) <var>HiddenServicePort</var> lines refer to this <var>HiddenServiceDir</var> line, until
230) you add another <var>HiddenServiceDir</var> line:
Roger Dingledine whoops, i missed a whole do...

Roger Dingledine authored 18 years ago

231) </p>
232) 
233) <pre>
234) HiddenServiceDir /usr/local/etc/tor/hidden_service/
235) HiddenServicePort 80 127.0.0.1:8080
236) 
237) HiddenServiceDir /usr/local/etc/tor/other_hidden_service/
238) HiddenServicePort 6667 127.0.0.1:6667
239) HiddenServicePort 22 127.0.0.1:22
240) </pre>
241) 
242) <p>There are some anonymity issues you should keep in mind too:
243) </p>
244) <ul>
245) <li>As mentioned above, be careful of letting your web server reveal
246) identifying information about you, your computer, or your location.
247) For example, readers can probably determine whether it's thttpd or
248) Apache, and learn something about your operating system.</li>
249) <li>If your computer isn't online all the time, your hidden service
250) won't be either. This leaks information to an observant adversary.</li>
251) <!-- increased risks over time -->
252) </ul>
253) 
254) <hr />
255) 
256) <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

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