Try RB_TREE instead of SPLAY_TREE, but with a single-entry caching optimization.
[tor.git] / doc / tor.1.in
blob29ec9e7392d915921b6962c9a0a0ade2b20dda28
1 .TH TOR 1 "March 2005" "TOR"
2 .SH NAME
3 tor \- The second-generation onion router
4 .SH SYNOPSIS
5 .B tor
6 [\fIOPTION value\fR]...
7 .SH DESCRIPTION
8 .I tor
9 is a connection-oriented anonymizing communication
10 service. Users choose a source-routed path through a set of nodes, and
11 negotiate a "virtual circuit" through the network, in which each node
12 knows its predecessor and successor, but no others. Traffic flowing down
13 the circuit is unwrapped by a symmetric key at each node, which reveals
14 the downstream node.
15 .PP
16 Basically \fItor\fR provides a distributed network of servers ("onion
17 routers"). Users bounce their TCP streams -- web traffic, ftp, ssh, etc --
18 around the routers, and recipients, observers, and even the routers
19 themselves have difficulty tracking the source of the stream.
20 .SH OPTIONS
21 \fB-h, -help\fP
22 Display a short help message and exit.
23 .TP
24 \fB-f \fR\fIFILE\fP
25 FILE contains further "option value" pairs. (Default: @CONFDIR@/torrc)
26 .TP
27 Other options can be specified either on the command-line (\fI--option
28 value\fR), or in the configuration file (\fIoption value\fR).
29 Options are case-insensitive.
30 .TP
31 \fBLog \fR\fIminSeverity\fR[-\fImaxSeverity\fR] \fBstderr\fR|\fBstdout\fR|\fBsyslog\fR\fP
32 Send all messages between \fIminSeverity\fR and \fImaxSeverity\fR to
33 the standard output stream, the standard error stream, or to the system
34 log. (The "syslog" value is only supported on Unix.)  Recognized
35 severity levels are debug, info, notice, warn, and err.  If only one
36 severity level is given, all messages of that level or higher will be
37 sent to the listed destination.
38 .TP
39 \fBLog \fR\fIminSeverity\fR[-\fImaxSeverity\fR] \fBfile\fR \fIFILENAME\fP
40 As above, but send log messages to the listed filename.  The "Log"
41 option may appear more than once in a configuration file.  Messages
42 are sent to all the logs that match their severity level.
43 .TP
44 \fBBandwidthRate \fR\fIN\fR \fBbytes\fR|\fBKB\fR|\fBMB\fR|\fBGB\fR|\fBTB\fP
45 A token bucket limits the average incoming bandwidth on this node to
46 the specified number of bytes per second. (Default: 780 KB)
47 .TP
48 \fBBandwidthBurst \fR\fIN\fR \fBbytes\fR|\fBKB\fR|\fBMB\fR|\fBGB\fR|\fBTB\fP
49 Limit the maximum token bucket size (also known as the burst) to the given number of bytes. (Default: 48 MB)
50 .TP
51 \fBMaxAdvertisedBandwidth \fR\fIN\fR \fBbytes\fR|\fBKB\fR|\fBMB\fR|\fBGB\fR|\fBTB\fP
52 If set, we will not advertise more than this amount of bandwidth for our
53 BandwidthRate. Server operators who want to reduce the number of clients
54 who ask to build circuits through them (since this is proportional to
55 advertised bandwidth rate) can thus reduce the CPU demands on their
56 server without impacting network performance.
57 .TP
58 \fBDataDirectory \fR\fIDIR\fP
59 Store working data in DIR (Default: @LOCALSTATEDIR@/lib/tor)
60 .TP
61 \fBDirServer \fR\fIaddress:port fingerprint\fP
62 Use a nonstandard authoritative directory server at the provided
63 address and port, with the specified key fingerprint.  This option can
64 be repeated many times, for multiple authoritative directory
65 servers. If no \fBdirserver\fP line is given, Tor will use the default
66 directory servers: moria1, moria2, and tor26.
67 .TP
68 \fBGroup \fR\fIGID\fP
69 On startup, setgid to this user.
70 .TP
71 \fBHttpProxy\fR \fIhost\fR[:\fIport\fR]\fP
72 If set, Tor will make all its directory requests through this host:port,
73 rather than connecting directly to any directory servers.
74 .TP
75 \fBHttpsProxy\fR \fIhost\fR[:\fIport\fR]\fP
76 If set, Tor will make all its OR (SSL) connections through this host:port,
77 via HTTP CONNECT, rather than connecting directly to servers.
78 .TP
79 \fBKeepalivePeriod \fR\fINUM\fP
80 To keep firewalls from expiring connections, send a padding keepalive
81 cell on open connections every NUM seconds. (Default: 5 minutes.)
82 .TP
83 \fBMaxConn \fR\fINUM\fP
84 Maximum number of simultaneous sockets allowed.  You probably don't need
85 to adjust this. (Default: 1024)
86 .TP
87 \fBOutboundBindAddress \fR\fIIP\fP
88 Make all outbound connections originate from the IP address specified.  This
89 is only useful when you have multiple network interfaces, and you want all
90 of Tor's outgoing connections to use a single one.
91 .TP
92 \fBPIDFile \fR\fIFILE\fP
93 On startup, write our PID to FILE. On clean shutdown, remove FILE.
94 .TP
95 \fBRunAsDaemon \fR\fB0\fR|\fB1\fR\fP
96 If 1, Tor forks and daemonizes to the background. (Default: 0)
97 .TP
98 \fBUser \fR\fIUID\fP
99 On startup, setuid to this user.
101 \fBControlPort \fR\fIPort\fP
102 If set, Tor will accept connections from the same machine (localhost only) on
103 this port, and allow those connections to control the Tor process using the
104 Tor Control Protocol (described in control-spec.txt).  Note: unless you also
105 specify one of \fBHashedControlPassword\fP or \fBCookieAuthentication\fP,
106 setting this option will cause Tor to allow any process on the local host to
107 control it.
109 \fBHashedControlPassword \fR\fIhashed_password\fP
110 Don't allow any connections on the control port except when the other process
111 knows the password whose one-way hash is \fIhashed_password\fP.  You can
112 compute the hash of a password by running "tor --hash-password
113 \fIpassword\fP".
115 \fBCookieAuthentication \fR\fB0\fR|\fB1\fP
116 If this option is set to 1, don't allow any connections on the control port
117 except when the connecting process knows the contents of a file named
118 "control_auth_cookie", which Tor will create in its data directory.  This
119 authentication methods should only be used on systems with good filesystem
120 security.
121 \fBDirFetchPeriod \fR\fIN\fR \fBseconds\fR|\fBminutes\fR|\fBhours\fR|\fBdays\fR|\fBweeks\fP
122 Every time the specified period elapses, Tor downloads a directory.
123 A directory contains a signed list of all known servers as well as
124 their current liveness status. A value of "0 seconds" tells Tor to choose an
125 appropriate default. (Default: 1 hour for clients, 20 minutes for servers.)
127 \fBStatusFetchPeriod \fR\fIN\fR \fBseconds\fR|\fBminutes\fR|\fBhours\fR|\fBdays\fR|\fBweeks\fP Every time the
128 specified period elapses, Tor downloads signed status information about the
129 current state of known servers.  A value of "0 seconds" tells Tor to choose
130 an appropriate default. (Default: 30 minutes for clients, 15 minutes for
131 servers.)  (Default: 20 minutes.)
133 \fBRendPostPeriod \fR\fIN\fR \fBseconds\fR|\fBminutes\fR|\fBhours\fR|\fBdays\fR|\fBweeks\fP
134 Every time the specified period elapses, Tor uploads any rendezvous
135 service descriptors to the directory servers.  This information is also
136 uploaded whenever it changes.  (Default: 20 minutes.)
138 .SH CLIENT OPTIONS
140 The following options are useful only for clients (that is, if \fBSOCKSPort\fP is non-zero):
142 \fBAllowUnverifiedNodes\fR \fBentry\fR|\fBexit\fR|\fBmiddle\fR|\fBintroduction\fR|\fBrendezvous\fR|...\fP
143 Where on our circuits should we allow Tor servers that the directory
144 servers haven't authenticated as "verified"?  (Default: middle,rendezvous.)
146 \fBClientOnly \fR\fB0\fR|\fB1\fR\fP
147 If set to 1, Tor will under no circumstances run as a server.  (Usually,
148 you don't need to set this; Tor is pretty smart at figuring out whether
149 you are reliable and high-bandwidth enough to be a good server.)
151 \fBEntryNodes \fR\fInickname\fR,\fInickname\fR,\fI...\fP
152 A list of preferred nodes to use for the first hop in the circuit, if possible.
154 \fBExitNodes \fR\fInickname\fR,\fInickname\fR,\fI...\fP
155 A list of preferred nodes to use for the last hop in the circuit, if possible.
157 \fBExcludeNodes \fR\fInickname\fR,\fInickname\fR,\fI...\fP
158 A list of nodes to never use when building a circuit.
160 \fBStrictExitNodes \fR\fB0\fR|\fB1\fR\fP
161 If 1, Tor will never use any nodes besides those listed in "exitnodes" for
162 the last hop of a circuit.
164 \fBStrictEntryNodes \fR\fB0\fR|\fB1\fR\fP
165 If 1, Tor will never use any nodes besides those listed in "entrynodes" for
166 the first hop of a circuit.
168 \fBFascistFirewall \fR\fB0\fR|\fB1\fR\fP
169 If 1, Tor will only create outgoing connections to ORs running on ports that
170 your firewall allows (defaults to 80 and 443; see \fBFirewallPorts\fR).  This will
171 allow you to run Tor as a client behind a firewall with restrictive policies,
172 but will not allow you to run as a server behind such a firewall.
174 \fBFirewallPorts \fR\fIPORTS\fP
175 A list of ports that your firewall allows you to connect to.  Only used when
176 \fBFascistFirewall\fR is set. (Default: 80, 443.)
178 \fBLongLivedPorts \fR\fIPORTS\fP
179 A list of ports for services that tend to have long-running connections
180 (e.g. chat and interactive shells). Circuits for streams that use these
181 ports will contain only high-uptime nodes, to reduce the chance that a
182 node will go down before the stream is finished.
184 \fBMapAddress\fR \fIaddress\fR \fInewaddress\fR
185 When a request for address arrives to Tor, it will rewrite it to newaddress before processing it. For example, if you always want connections to www.indymedia.org to exit via yourtorserver, use "MapAddress www.indymedia.org www.indymedia.org.yourtorserver.exit".
187 \fBNewCircuitPeriod \fR\fINUM\fP
188 Every NUM seconds consider whether to build a new circuit. (Default: 60)
190 \fBMaxCircuitDirtiness \fR\fINUM\fP
191 Feel free to reuse a circuit that was first used at most NUM seconds
192 ago, but never attach a new stream to a circuit that is too old.
194 \fBNodeFamily \fR\fInickname\fR,\fInickname\fR,\fI...\fP
195 The named Tor servers constitute a "family" of similar or co-administered
196 servers, so never use any two of them in the same circuit. Defining a
197 NodeFamily is only needed when a server doesn't list the family itself
198 (with MyFamily). This option can be used multiple times.
200 .\" \fBPathlenCoinWeight \fR\fI0.0-1.0\fP
201 .\" Paths are 3 hops plus a geometric distribution centered around this coinweight. Must be >=0.0 and <1.0. (Default: 0.3) NOT USED CURRENTLY
202 .\" .TP
203 \fBRendNodes \fR\fInickname\fR,\fInickname\fR,\fI...\fP
204 A list of preferred nodes to use for the rendezvous point, if possible.
206 \fBRendExcludeNodes \fR\fInickname\fR,\fInickname\fR,\fI...\fP
207 A list of nodes to never use when choosing a rendezvous point.
209 \fBSOCKSPort \fR\fIPORT\fP
210 Bind to this port to listen for connections from SOCKS-speaking applications.
211 Set this to 0 if you don't want to allow application connections. (Default:
212 9050)
214 \fBSOCKSBindAddress \fR\fIIP\fP
215 Bind to this address to listen for connections from SOCKS-speaking applications. (Default: 127.0.0.1) You can also specify a port (e.g. 192.168.0.1:9100). This directive can be specified multiple times to bind to multiple addresses/ports.
217 \fBSOCKSPolicy \fR\fIpolicy\fR,\fIpolicy\fR,\fI...\fP
218 Set an entrance policy for this server, to limit who can connect to the SOCKS ports. The policies have the same form as exit policies below.
220 \fBTrackHostExits \fR\fIhost1\fR,\fI.domain1\fR|\fI.\fR\fP
221 For each value in the comma separated list, Tor will track recent connections
222 to hosts that match this value and attempt to
223 reuse the same exit node for each. If the value is prepended with a '.', it is
224 treated as matching an entire domain. If one of the values is just a '.', it
225 means match everything. This option is useful if you frequently connect to
226 sites that will expire all your authentication cookies (ie log you out) if
227 your IP address changes. Note that this option does have the disadvantage of
228 making it more clear that a given history is
229 associated with a single user. However, most people who would wish to observe
230 this will observe it through cookies or other protocol-specific means anyhow.
232 \fBTrackHostExitsExpire \fR\fINUM\fP
233 Since exit servers go up and down, it is desirable to expire the association
234 between host and exit server after NUM seconds of inactivity. The default
235 is 1800 seconds (30 minutes).
237 .SH SERVER OPTIONS
239 The following options are useful only for servers (that is, if \fBORPort\fP is non-zero):
241 \fBAddress \fR\fIaddress\fP
242 The IP or fqdn of this server (e.g. moria.mit.edu). You can leave this
243 unset, and Tor will guess your IP.
245 \fBContactInfo \fR\fIemail_address\fP
246 Administrative contact information for server.
248 \fBExitPolicy \fR\fIpolicy\fR,\fIpolicy\fR,\fI...\fP
249 Set an exit policy for this server. Each policy is of the form
250 "\fBaccept\fP|\fBreject\fP \fIADDR\fP[\fB/\fP\fIMASK\fP]\fB:\fP\fIPORT\fP".
251 If \fB/\fP\fIMASK\fP is omitted then this policy just applies to the host
252 given.  Instead of giving a host or network you can also use "\fB*\fP" to
253 denote the universe (0.0.0.0/0).  \fIPORT\fP can be a single port number,
254 an interval of ports "\fIFROM_PORT\fP\fB-\fP\fITO_PORT\fP", or "\fB*\fP".
256 For example, "reject 127.0.0.1:*,reject 192.168.1.0/24:*,accept *:*" would
257 reject any traffic destined for localhost and any 192.168.1.* address, but
258 accept anything else.
260 This directive can be specified multiple times so you don't have to put
261 it all on one line.
263 See RFC 3330 for more details about internal and reserved IP address
264 space. Policies are considered first to last, and the first match wins. If
265 you want to _replace_ the default exit policy, end your exit policy with
266 either a reject *:* or an accept *:*. Otherwise, you're _augmenting_
267 (prepending to) the default exit policy. The default exit policy is:
268 .PD 0
269 .RS 12
270 .IP "reject 0.0.0.0/8" 0
271 .IP "reject 169.254.0.0/16" 4
272 .IP "reject 127.0.0.0/8"
273 .IP "reject 192.168.0.0/16"
274 .IP "reject 10.0.0.0/8"
275 .IP "reject 172.16.0.0/12"
276 .IP "reject *:25"
277 .IP "reject *:119"
278 .IP "reject *:135-139"
279 .IP "reject *:445"
280 .IP "reject *:1214"
281 .IP "reject *:4661-4666"
282 .IP "reject *:6346-6429"
283 .IP "reject *:6699"
284 .IP "reject *:6881-6999"
285 .IP "accept *:*"
289 \fBMaxOnionsPending \fR\fINUM\fP
290 If you have more than this number of onionskins queued for decrypt, reject new ones. (Default: 100)
292 \fBMyFamily \fR\fInickname\fR,\fInickname\fR,\fI...\fP
293 Declare that this Tor server is controlled or administered by a group
294 or organization identical or similar to that of the other named servers.
295 When two servers both declare that they are in the same 'family', Tor clients
296 will not use them in the same circuit.  (Each server only needs to list the
297 other servers in its family; it doesn't need to list itself, but it won't hurt.)
299 \fBNickname \fR\fIname\fP
300 Set the server's nickname to 'name'.
302 \fBNumCPUs \fR\fInum\fP
303 How many processes to use at once for decrypting onionskins. (Default: 1)
305 \fBORPort \fR\fIPORT\fP
306 Bind to this port to listen for connections from Tor clients and servers.
308 \fBORBindAddress \fR\fIIP\fP
309 Bind to this address to listen for connections from Tor clients and servers. (Default: 0.0.0.0)
311 \fBRedirectExit \fR\fIpattern target\fP
312 Whenever an outgoing connection tries to connect to one of a given set
313 of addresses, connect to \fItarget\fP (an \fIaddress:port\fP pair) instead.
314 The address
315 pattern is given in the same format as for an exit policy.  The
316 address translation applies after exit policies are applied.  Multiple
317 \fBRedirectExit\fP options can be used: once any one has matched
318 successfully, no subsequent rules are considered.  You can specify that no
319 redirection is to be performed on a given set of addresses by using the
320 special target string "pass", which prevents subsequent rules from being
321 considered.
323 \fBShutdownWaitLength\fR\fINUM\fP
324 When we get a SIGINT and we're a server, we begin shutting down: we close
325 listeners and start refusing new circuits. After \fBNUM\fP seconds,
326 we exit. If we get a second SIGINT, we exit immediately.  (Default:
327 30 seconds)
329 \fBDirPostPeriod \fR\fIN\fR \fBseconds\fR|\fBminutes\fR|\fBhours\fR|\fBdays\fR|\fBweeks\fP
330 Every time the specified period elapses, Tor uploads its server
331 descriptors to the directory servers.  This information is also
332 uploaded whenever it changes.  (Default: 20 minutes.)
334 \fBAccountingMax \fR\fIN\fR \fBbytes\fR|\fBKB\fR|\fBMB\fR|\fBGB\fR|\fBTB\fP
335 Never send more than the specified number of bytes in a given
336 accounting period, or receive more than that number in the period.
337 When the number of bytes is exhausted, Tor will hibernate until some
338 time in the next accounting period.  To prevent all servers from
339 waking at the same time, Tor will also wait until a random point in
340 each period before waking up.  If you have bandwidth cost issues,
341 enabling hibernation is preferable to setting a low bandwidth, since it
342 provides users with a collection of fast servers that are up some of
343 the time, which is more useful than a set of slow servers that are
344 always "available".
346 \fBAccountingStart \fR\fBday\fR|\fBweek\fR|\fBmonth\fR [\fIday\fR] \fIHH:MM\fR\fP
347 Specify how long accounting periods last.  If \fBmonth\fP is given,
348 each accounting period runs from the time \fIHH:MM\fR on the
349 \fIday\fRth day of one month to the same day and time of the next.
350 (The day must be between 1 and 28.)  If \fBweek\fP is given, each
351 accounting period runs from the time \fIHH:MM\fR of the \fIday\fRth
352 day of one week to the same day and time of the next week, with Monday
353 as day 1 and Sunday as day 7.  If \fBday\fR is given, each accounting
354 period runs from the time \fIHH:MM\fR each day to the same time on the
355 next day.  All times are local, and given in 24-hour time.  (Defaults to
356 "month 1 0:00".)
358 .SH DIRECTORY SERVER OPTIONS
360 The following options are useful only for directory servers (that is, if \fBDirPort\fP is non-zero):
362 \fBAuthoritativeDirectory \fR\fB0\fR|\fB1\fR\fP
363 When this option is set to 1, Tor operates as an authoritative
364 directory server.  Instead of caching the directory, it generates its
365 own list of good servers, signs it, and sends that to the clients.
366 Unless the clients already have you listed as a trusted directory, you
367 probably do not want to set this option.  Please coordinate with the other
368 admins at tor-ops@freehaven.net if you think you should be a directory.
370 \fBDirPort \fR\fIPORT\fP
371 Bind the directory service to this port.
373 \fBDirBindAddress \fR\fIIP\fP
374 Bind the directory service to this address. (Default: 0.0.0.0)
376 \fBDirPolicy \fR\fIpolicy\fR,\fIpolicy\fR,\fI...\fP
377 Set an entrance policy for this server, to limit who can connect to the directory ports. The policies have the same form as exit policies above.
379 \fBRecommendedVersions \fR\fISTRING\fP
380 STRING is a command-separated list of Tor versions currently believed
381 to be safe. The list is included in each directory, and nodes which
382 pull down the directory learn whether they need to upgrade.  This
383 option can appear multiple times: the values from multiple lines are
384 spliced together.
386 \fBDirAllowPrivateAddresses \fR\fB0\fR|\fB1\fR\fP
387 If set to 1, Tor will accept router descriptors with arbitrary "Address"
388 elements. Otherwise, if the address is not an IP or is a private IP,
389 it will reject the router descriptor. Defaults to 0.
391 \fBRunTesting \fR\fB0\fR|\fB1\fR\fP
392 If set to 1, Tor tries to build circuits through all of the servers it
393 knows about, so it can tell which are up and which are down.  This
394 option is only useful for authoritative directories, so you probably
395 don't want to use it.
397 .SH HIDDEN SERVICE OPTIONS
399 The following options are used to configure a hidden service.
401 \fBHiddenServiceDir \fR\fIDIRECTORY\fP
402 Store data files for a hidden service in DIRECTORY.  Every hidden
403 service must have a separate directory.  You may use this option multiple
404 times to specify multiple services.
406 \fBHiddenServicePort \fR\fIVIRTPORT \fR[\fITARGET\fR]\fP
407 Configure a virtual port VIRTPORT for a hidden service.  You may use this
408 option multiple times; each time applies to the service using the most recent
409 hiddenservicedir.  By default, this option maps the virtual port to the
410 same port on 127.0.0.1.  You may override the target port, address, or both
411 by specifying a target of addr, port, or addr:port.
413 \fBHiddenServiceNodes \fR\fInickname\fR,\fInickname\fR,\fI...\fP
414 If possible, use the specified nodes as introduction points for the hidden
415 service. If this is left unset, Tor will be smart and pick some reasonable
416 ones; most people can leave this unset.
418 \fBHiddenServiceExcludeNodes \fR\fInickname\fR,\fInickname\fR,\fI...\fP
419 Do not use the specified nodes as introduction points for the hidden
420 service. In normal use there is no reason to set this.
422 .\" UNDOCUMENTED
423 .\" ignoreversion
425 .SH SIGNALS
426 Tor catches the following signals:
428 \fBSIGTERM\fR
429 Tor will catch this, clean up and sync to disk if necessary, and exit.
431 \fBSIGINT\fR
432 Tor clients behave as with SIGTERM; but Tor servers will do a controlled
433 slow shutdown, closing listeners and waiting 30 seconds before exiting.
435 \fBSIGHUP\fR
436 The signal instructs Tor to reload its configuration (including closing
437 and reopening logs), fetch a new directory, and kill and restart its
438 helper processes if applicable.
440 \fBSIGUSR1\fR
441 Log statistics about current connections, past connections, and
442 throughput.
444 \fBSIGUSR2\fR
445 Switch all logs to loglevel debug. You can go back to the old loglevels
446 by sending a SIGHUP.
448 \fBSIGCHLD\fR
449 Tor receives this signal when one of its helper processes has exited,
450 so it can clean up.
452 \fBSIGPIPE\fR
453 Tor catches this signal and ignores it.
455 \fBSIGXFSZ\fR
456 If this signal exists on your platform, Tor catches and ignores it.
458 .SH FILES
460 .I @CONFDIR@/torrc
461 The configuration file, which contains "option value" pairs.
463 .I @LOCALSTATEDIR@/lib/tor/
464 The tor process stores keys and other data here.
466 .SH SEE ALSO
467 .BR privoxy (1),
468 .BR tsocks (1),
469 .BR torify (1)
471 .BR http://tor.eff.org/
473 .SH BUGS
474 Plenty, probably. It's still in alpha. Please report them.
475 .SH AUTHORS
476 Roger Dingledine <arma@mit.edu>, Nick Mathewson <nickm@alum.mit.edu>.