d69b4f076ad41a34902ccd5cbf14491375ef599d
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 13 years ago

1) ## translation metadata
2) # Revision: $Revision: 22314 $
3) # Translation-Priority: 3-low
4) 
5) #include "head.wmi" TITLE="Tor Project: Hidden Service Configuration Instructions" CHARSET="UTF-8"
6) <div id="content" class="clearfix">
7)   <div id="breadcrumbs">
Andrew Lewman change all of the breadcrum...

Andrew Lewman authored 13 years ago

8)     <a href="<page index>">Home &raquo; </a>
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 13 years ago

9)     <a href="<page docs/documentation>">Documentation &raquo; </a>
10)     <a href="<page docs/tor-hidden-service>">Tor Hidden Service</a>
11)   </div>
12)   <div id="maincol">
Andrew Lewman change all of the breadcrum...

Andrew Lewman authored 13 years ago

13)     <h1>Configuring Hidden Services for <a href="<page index>">Tor</a></h1>
Sebastian Hahn We decided to go with HTML...

Sebastian Hahn authored 13 years ago

14)     <hr>
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 13 years ago

15)     
16)     <p>Tor allows clients and relays to offer hidden services. That is,
17)     you can offer a web server, SSH server, etc., without revealing your
18)     IP address to its users. In fact, because you don't use any public address,
19)     you can run a hidden service from behind your firewall.
20)     </p>
21)     
22)     <p>If you have Tor installed, you can see hidden services
23)     in action by visiting <a href="http://duskgytldkxiuqc6.onion/">our
24)     example hidden service</a>.
25)     </p>
26)     
27)     <p>This howto describes the steps for setting up your own hidden service
28)     website. For the technical details of how the hidden service protocol
29)     works, see our <a href="<page docs/hidden-services>">hidden service protocol</a> page.
30)     </p>
31)     
Sebastian Hahn We decided to go with HTML...

Sebastian Hahn authored 13 years ago

32)     <hr>
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 13 years ago

33)     <a id="zero"></a>
34)     <h2><a class="anchor" href="#zero">Step Zero: Get Tor working</a></h2>
Sebastian Hahn We decided to go with HTML...

Sebastian Hahn authored 13 years ago

35)     <br>
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 13 years ago

36)     
37)     <p>Before you start, you need to make sure:</p>
38)     <ol>
39)     <li>Tor is up and running,</li>
40)     <li>You actually set it up correctly.</li>
41)     </ol>
42)     
43)     
44)     <p>Windows users should follow the <a
45)     href="<page docs/tor-doc-windows>">Windows
46)     howto</a>, OS X users should follow the <a
47)     href="<page docs/tor-doc-osx>">OS
48)     X howto</a>, and Linux/BSD/Unix users should follow the <a
49)     href="<page docs/tor-doc-unix>">Unix howto</a>.
50)     </p>
51)     
52)     <p>Once you've got Tor installed and configured,
53)     you can see hidden services in action by following this link to <a
54)     href="http://duskgytldkxiuqc6.onion/">our example hidden service</a>
55)     or the <a
56)     href="http://gaddbiwdftapglkq.onion/">Wikileaks hidden service</a>.
57)     It will typically take 10-60 seconds to load
58)     (or to decide that it is currently unreachable). If it fails
59)     immediately and your browser pops up an alert saying that
60)     "www.duskgytldkxiuqc6.onion could not be found, please check the name and
61)     try again" then you haven't configured Tor correctly; see <a
Andrew Lewman clean up wiki and faq refer...

Andrew Lewman authored 13 years ago

62)     href="<wikifaq>#ItDoesntWork">the
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 13 years ago

63)     it-doesn't-work FAQ entry</a> for some help.
64)     </p>
65)     
Sebastian Hahn We decided to go with HTML...

Sebastian Hahn authored 13 years ago

66)     <hr>
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 13 years ago

67)     <a id="one"></a>
68)     <h2><a class="anchor" href="#one">Step One: Install a web server locally</a></h2>
Sebastian Hahn We decided to go with HTML...

Sebastian Hahn authored 13 years ago

69)     <br>
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 13 years ago

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

Sebastian Hahn authored 13 years ago

111)     <hr>
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 13 years ago

112)     <a id="two"></a>
113)     <h2><a class="anchor" href="#two">Step Two: Configure your hidden service</a></h2>
Sebastian Hahn We decided to go with HTML...

Sebastian Hahn authored 13 years ago

114)     <br>
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 13 years ago

115)     
116)     <p>Next, you need to configure your hidden service to point to your
117)     local web server.
118)     </p>
119)     
120)     <p>First, open your torrc file in your favorite text editor. (See <a
Andrew Lewman clean up wiki and faq refer...

Andrew Lewman authored 13 years ago

121)     href="<wikifaq>#torrc">the
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 13 years ago

122)     torrc FAQ entry</a> to learn what this means.) Go to the middle section and
123)     look for the line</p>
124)     
125)     <pre>
126)     \############### This section is just for location-hidden services ###
127)     </pre>
128)     
129)     <p>
130)     This section of the file consists of groups of lines, each representing
131)     one hidden service. Right now they are all commented out (the lines
132)     start with #), so hidden services are disabled. Each group of lines
133)     consists of one <var>HiddenServiceDir</var> line, and one or more
134)     <var>HiddenServicePort</var> lines:</p>
135)     <ul>
136)     <li><var>HiddenServiceDir</var> is a directory where Tor will store information
137)     about that hidden service.  In particular, Tor will create a file here named
138)     <var>hostname</var> which will tell you the onion URL.  You don't need to
139)     add any files to this directory. Make sure this is not the same directory
140)     as the hidserv directory you created when setting up thttpd, as your
141)     HiddenServiceDir contains secret information!</li>
142)     <li><var>HiddenServicePort</var> lets you specify a virtual port (that is, what
143)     port people accessing the hidden service will think they're using) and an
144)     IP address and port for redirecting connections to this virtual port.</li>
145)     </ul>
146)     
147)     <p>Add the following lines to your torrc:
148)     </p>
149)     
150)     <pre>
151)     HiddenServiceDir /Library/Tor/var/lib/tor/hidden_service/
152)     HiddenServicePort 80 127.0.0.1:5222
153)     </pre>
154)     
155)     <p>You're going to want to change the <var>HiddenServiceDir</var> line, so it points
156)     to an actual directory that is readable/writeable by the user that will
157)     be running Tor. The above line should work if you're using the OS X Tor
158)     package. On Unix, try "/home/username/hidden_service/" and fill in your own
159)     username in place of "username". On Windows you might pick:</p>
160)     <pre>
161)     HiddenServiceDir C:\Documents and Settings\username\Application Data\hidden_service\\
162)     HiddenServicePort 80 127.0.0.1:5222
163)     </pre>
164)     
165)     <p>Now save the torrc, shut down
166)     your Tor, and then start it again.
167)     </p>
168)     
169)     <p>If Tor starts up again, great. Otherwise, something is wrong. First look at
170)     your logfiles for hints. It will print some warnings or error messages. That
171)     should give you an idea what went wrong. Typically there are typos in the torrc
172)     or wrong directory permissions (See <a
Andrew Lewman clean up wiki and faq refer...

Andrew Lewman authored 13 years ago

173)     href="<wikifaq>#Logs">the
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 13 years ago

174)     logging FAQ entry</a> if you don't know how to enable or find your
175)     log file.)
176)     </p>
177)     
178)     <p>When Tor starts, it will automatically create the <var>HiddenServiceDir</var>
179)     that you specified (if necessary), and it will create two files there.</p>
180)     
181)     <dl>
182)     <dt><var>private_key</var></dt>
183)     <dd>First, Tor will generate a new public/private keypair for your hidden
184)     service. It is written into a file called "private_key". Don't share this key
185)     with others -- if you do they will be able to impersonate your hidden
186)     service.</dd>
187)     <dt><var>hostname</var></dt>
188)     <dd>The other file Tor will create is called "hostname". This contains
189)     a short summary of your public key -- it will look something like
190)     <tt>duskgytldkxiuqc6.onion</tt>. This is the public name for your service,
191)     and you can tell it to people, publish it on websites, put it on business
192)     cards, etc.</dd>
193)     </dl>
194)     
195)     <p>If Tor runs as a different user than you, for example on
196)     OS X, Debian, or Red Hat, then you may need to become root to be able
197)     to view these files.</p>
198)     
199)     <p>Now that you've restarted Tor, it is busy picking introduction points
200)     in the Tor network, and generating a <em>hidden service
201)     descriptor</em>. This is a signed list of introduction points along with
202)     the service's full public key. It anonymously publishes this descriptor
203)     to the directory servers, and other people anonymously fetch it from the
204)     directory servers when they're trying to access your service.
205)     </p>
206)     
207)     <p>Try it now: paste the contents of the hostname file into your web
208)     browser. If it works, you'll get the html page you set up in step one.
209)     If it doesn't work, look in your logs for some hints, and keep playing
210)     with it until it works.
211)     </p>
212)     
Sebastian Hahn We decided to go with HTML...

Sebastian Hahn authored 13 years ago

213)     <hr>
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 13 years ago

214)     <a id="three"></a>
215)     <h2><a class="anchor" href="#three">Step Three: More advanced tips</a></h2>
Sebastian Hahn We decided to go with HTML...

Sebastian Hahn authored 13 years ago

216)     <br>
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 13 years ago

217)     
218)     <p>If you plan to keep your service available for a long time, you might
219)     want to make a backup copy of the <var>private_key</var> file somewhere.
220)     </p>
221)     
222)     <p>We avoided recommending Apache above, a) because many people might
223)     already be running it for a public web server on their computer, and b)
224)     because it's big
225)     and has lots of places where it might reveal your IP address or other
226)     identifying information, for example in 404 pages. For people who need
227)     more functionality, though, Apache may be the right answer. Can
228)     somebody make us a checklist of ways to lock down your Apache when you're
229)     using it as a hidden service? Savant probably has these problems too.
230)     </p>
231)     
232)     <p>If you want to forward multiple virtual ports for a single hidden
233)     service, just add more <var>HiddenServicePort</var> lines.
234)     If you want to run multiple hidden services from the same Tor
235)     client, just add another <var>HiddenServiceDir</var> line. All the following
236)     <var>HiddenServicePort</var> lines refer to this <var>HiddenServiceDir</var> line, until
237)     you add another <var>HiddenServiceDir</var> line:
238)     </p>
239)     
240)     <pre>
241)     HiddenServiceDir /usr/local/etc/tor/hidden_service/
242)     HiddenServicePort 80 127.0.0.1:8080
243)     
244)     HiddenServiceDir /usr/local/etc/tor/other_hidden_service/
245)     HiddenServicePort 6667 127.0.0.1:6667
246)     HiddenServicePort 22 127.0.0.1:22
247)     </pre>
248)     
249)     <p>There are some anonymity issues you should keep in mind too:
250)     </p>
251)     <ul>
252)     <li>As mentioned above, be careful of letting your web server reveal
253)     identifying information about you, your computer, or your location.
254)     For example, readers can probably determine whether it's thttpd or
255)     Apache, and learn something about your operating system.</li>
256)     <li>If your computer isn't online all the time, your hidden service
257)     won't be either. This leaks information to an observant adversary.</li>
258)     <!-- increased risks over time -->
259)     </ul>
260)     
Sebastian Hahn We decided to go with HTML...

Sebastian Hahn authored 13 years ago

261)     <hr>