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

Andrew Lewman authored 14 years ago

1) ## translation metadata
Roger Dingledine looks like we never set the...

Roger Dingledine authored 14 years ago

2) # Revision: $Revision$
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 14 years ago

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 14 years ago

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

Andrew Lewman authored 14 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 14 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 14 years ago

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

Andrew Lewman authored 14 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 14 years ago

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

Andrew Lewman authored 14 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 14 years ago

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

Andrew Lewman authored 14 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
Andrew Lewman change the test hidserv lin...

Andrew Lewman authored 13 years ago

56)     href="http://3g2upl4pq6kufc4m.onion/">DuckDuckGo search engine hidden service</a>.
57)     It will typically take 10-60 seconds to load (or to decide that it
58)     is currently unreachable). If it fails immediately and your browser
59)     pops up an alert saying that "www.duskgytldkxiuqc6.onion could not
60)     be found, please check the name and try again" then you haven't
61)     configured Tor correctly; see <a
Roger Dingledine fix the faq anchors that ha...

Roger Dingledine authored 13 years ago

62)     href="<page docs/faq>#DoesntWork">the
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 14 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 14 years ago

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

Andrew Lewman authored 14 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 14 years ago

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

Andrew Lewman authored 14 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 14 years ago

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

Andrew Lewman authored 14 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 14 years ago

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

Andrew Lewman authored 14 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
Roger Dingledine change links to the #torrc...

Roger Dingledine authored 13 years ago

121)     href="<page docs/faq>#torrc">the
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 14 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>
Sebastian Hahn Remove backslash from Windo...

Sebastian Hahn authored 12 years ago

161)     HiddenServiceDir C:\Users\username\Documents\tor\hidden_service
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 14 years ago

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
Roger Dingledine revise #Logs entry. fix sev...

Roger Dingledine authored 13 years ago

172)     or wrong directory permissions (See <a href="<page docs/faq>#Logs">the
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 14 years ago

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

Sebastian Hahn authored 14 years ago

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

Andrew Lewman authored 14 years ago

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

Sebastian Hahn authored 14 years ago

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

Andrew Lewman authored 14 years ago

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

Sebastian Hahn authored 14 years ago

260)     <hr>