UbuntuHelp:TOR

出自Ubuntu中文

{i} TOR is part of the UserDocumentation series of index pages. Please read the WikiGuide prior to making changes.

This page is a brief howto for running a TOR client and server under Ubuntu 6.10 (Edgy Eft) , 7.04 (Feisty Fawn) and 8.04 (Hardy Heron). Please also consult the official Tor installation guide until this page has been completely updated as it is crucial to get everything right with a security application such as Tor.

目录

[编辑] Introduction

TOR or The Onion Router is a toolset used to help anonymize your traffic. The project is backed by the EFF (Electronic Frontier Foundation). From the TOR website: Tor is a toolset for a wide range of organizations and people that want to improve their safety and security on the Internet. Using Tor can help you anonymize web browsing and publishing, instant messaging, IRC, SSH, and other applications that use the TCP protocol. Tor also provides a platform on which software developers can build new applications with built-in anonymity, safety, and privacy features. This guide is an adaptation of the official Tor installation method. It has been changed to reflect installation methods unique to Ubuntu Edgy Eft, but may easily be used as a guide for other Debian based distros.

[编辑] Installing TOR

See Tor installation documentation for the latest instructions. You will need to add the following repositories to your /etc/apt/sources.list file:

  • Ubuntu 6.10 (Edgy Eft):
deb http://mirror.noreply.org/pub/tor edgy main
deb-src http://mirror.noreply.org/pub/tor edgy main
  • Ubuntu 7.04 (Feisty Fawn):
deb http://mirror.noreply.org/pub/tor feisty main
deb-src http://mirror.noreply.org/pub/tor feisty main
  • Ubuntu 8.04 (Hardy Heron):
deb http://mirror.noreply.org/pub/tor hardy main
deb-src http://mirror.noreply.org/pub/tor hardy main

This can be done by using nano, gedit or another text editor of your choosing. Or use the System --> Admin --> Software|Sources GUI application. Before moving on be sure to get the PGP keys for the new repositories and do an update / upgrade using the following commands or use the authentication tab in the Software Sources GUI:

$ gpg --keyserver subkeys.pgp.net --recv 94C09C7F
$ gpg --fingerprint 94C09C7F
$ gpg --export 94C09C7F | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get upgrade

Then, we will install TOR by issuing the following command or use System --> Administration --> Synaptic Package Manager:

$ sudo apt-get install tor

[编辑] Install Privoxy

Simply make sure you have universal repositories and then:

$ sudo apt-get install privoxy

[编辑] Configure Privoxy

$ sudo nano /etc/privoxy/config

Add the following line (anywhere in the file is fine):

forward-socks4a / localhost:9050 . 

Save (Ctrl+X if in nano and save the file before exiting).

[编辑] Starting Services and Checking Status

$ sudo /etc/init.d/tor start
$ sudo /etc/init.d/privoxy start

/* Check that the service is running on port 9050 */

$ netstat -a | grep 9050

/* You should see the following output: */

tcp 0 0 localhost:9050 *:* LISTEN

If you are interested in testing by connecting to a website try Xenobite Thats it!

[编辑] A Note On Local Logging

To be truly anonymous, you may want to turn off local logging for all your GET/POST/CONNECT request in privoxy's config file:

$ sudo nano /etc/privoxy/config

Go to line 573 (approx) and comment the line like so:

# debug   1    # show each GET/POST/CONNECT request
debug   4096 # Startup banner and warnings
debug   8192 # Errors - *we highly recommended enabling this*

Ctrl+X, Save and you're done. You may also choose to enable SafeLogging in your TOR config. This can be done by opening the config file at /etc/tor/torrc and adding "SafeLogging 1" to the end of the file. See the TOR Manual for more information.

[编辑] Anonymizing Applications

What's the use of having TOR and Privoxy setup without enabling your new anonymous proxy in your common web applications? At this time TOR only supports http and https traffic, but still recommends using TOR in your browser's proxy settings for all protocols as a hidden image link can give away your IP address if linked to an image on an FTP site. A complete list of supported applications can be found here.

[编辑] Firefox 2.0

  1. Go to Edit > Preferences
  2. Select Advanced then the Network tab
  3. Select Settings under Connection
  • Use 127.0.0.1:8118 for all proxies, except SOCKS
  • SOCKS is 127.0.0.1:9050
  • SOCKS version is v5

Note: Browsing through an anonymizing proxy will always slow down your connection. It is recommended that you use a proxy switcher such as Tor Button, many of which are available from http://addons.mozilla.org.

[编辑] Gaim

  1. Go to the Accounts, select your Account
  2. Select Edit Account
  3. Go to the Advanced Tab
  4. Under Proxy Options select proxy type SOCKS v5
  • Enter 127.0.0.1 for the host
  • Enter 9050 for the port
  • Leave user/pass blank

[编辑] Mozilla Thunderbird

Get the Tor Button addon for Thunderbird, install and setup just like with Firefox. If you're using the same server name for receiving and sending mail but still want to receive mail through Tor, change your SMTP server's name to it's IP and exclude the IP from being proxied. This way, mail will be received from your mail server by it's name (and through Tor), but sent by the same server without Tor.

[编辑] X-Chat

Settings-> Preferences -> Network -> Network setup -> Proxy server Use the following settings:

Hostname: 127.0.0.1
Port: 9050
Type: Socks5

[编辑] Azureus (BitTorrent Client)

Again, pretty much all you really need to do here is to proxy tracker communications. There is an option for this under the connections pane in Azureus. Fill in 127.0.0.1 9050 for the SOCKS proxy for tracker data. The most common proxy settings under Proxy Options in Connection Tab of Options Menu:

  • Enable proxying of tracker communications (checked)
  • I have a SOCKS proxy (checked)
  • Host: 127.0.0.1
  • Port: 9050
  • Username and Password <none>
  • Enable proxying of peer communications (checked)
  • Inform tracker of limitation (unchecked)
  • SOCKS version V5
  • Use same proxy settings for tracker and peer communications

More information here.

[编辑] References and More Information