How to setup and use Tor Anonymity in Ubuntu

tor-vidalia-control-panel-ubuntu-11-04

Just before the new year, I saw a news article by Wired that highlighted flaws found in the Tor Anonymity Network. I had never used Tor, but I knew what it was, the benefits it could provide, and a bit about how it worked.

With a little free time on my hands I decided to set it up and see what all the fuss was about. At the time I was installing the Tor components in OS X, but I was curious about installing it in Ubuntu and the resources and instructions that I came across were not as straight forward as they could have been. That is where this post comes it, to provide a simple step by step guide with no fuss.

What is Tor?

This is how Wikipedia explains Tor:

Tor is a system intended to enable online anonymity, composed of client software and a network of servers which can hide information about users’ locations and other factors which might identify them. Use of this system makes it more difficult to trace internet traffic to the user, including visits to Web sites, online posts, instant messages, and other communication forms. It is intended to protect users’ personal freedom, privacy, and ability to conduct confidential business, by keeping their internet activities from being monitored.

What does it look like?

Tor itself doesn’t have a graphical user interface (GUI), but there is an application known as Vidalia which provides a nice and simple user interface for controlling all of your Tor needs.

When installing Tor in Ubuntu, you will need to install 3 components: Tor, Polipo, and Vidalia. Tor and Vidalia should now be obvious to you (since I’ve explained that Vidalia provides a GUI to Tor).

Again, according to Wikipedia here is what Polipo is:

Polipo is a fast and lightweight, forwarding and caching proxy server, SOCKS proxy and computer software daemon.

Install Tor in Ubuntu

This is really quite simple and I could easily provide a simple bash script to automate all of this for you, but that would mean that I would have to maintain it and that you wouldn’t learn anything. ;)

For simplicity, I will write this guide assuming you are using Ubuntu 10.10, aka Maverick. If you’re using a different version, make sure you change the necessary bits below.

  1. Open “Software Sources,” select the “Other Software” tab, click the “Add” button at the bottom and paste the following:

    deb http://deb.torproject.org/torproject.org maverick main

    Click “Add Source,” then click Close. When it asks if you want to Reload, click yes and ignore any errors for now.

  2. Open a Terminal and add the Tor Repository keys and update Apt:

    gpg –keyserver keys.gnupg.net –recv 886DDD89
    gpg –export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add –
    sudo apt-get update

  3. Install Tor, Polipo, and Vidalia:

    sudo apt-get install tor tor-geoipdb polipo vidalia -y

    When prompted during the installation of Vidalia, select the option to permanently replace (or however it is worded).

  4. Download a pre-made config file for Polipo:

    wget https://gitweb.torproject.org/torbrowser.git/blob_plain/HEAD:/build-scripts/config/polipo.conf
    sudo mv /etc/polipo/config /etc/polipo/config.bak
    sudo mv polipo.conf /etc/polipo/config

  5. Now Stop and Restart both Tor and Polipo for safe measure:

    sudo /etc/init.d/tor stop
    sudo /etc/init.d/polipo stop
    sudo /etc/init.d/polipo start

    Open the application Vidalia when you would like to connect to the Tor network. If you want it on by default, you can always set Vidalia to autostart with your computer.

  6. All thats left is to configure your Applications to use the Tor proxies! If you don’t adjust the network settings of your applications to use the Tor proxy settings then you’re not using Tor at all. You can confirm that Tor is indeed working by visiting the Tor detector page.

If you run into issues for any reason, check back through the steps listed above. If that still doesn’t fix them, you might check the Community Ubuntu Documentation on Tor page or the official Tor for Linux/BSD/Unix page.

Configuring applications to use the Tor proxies

There are 2 types of configurations for Tor:

  1. HTTP or HTTPS – Typically used for web browsers such as Opera, Firefox, Safari, Google Chrome, etc.

    Host: 127.0.0.1
    Port: 8118

  2. Sockets – Typcially used for instant messaging applications such as Trillian, Digsby, MSN, AOL, Empathy, Pidgin, etc.

    Host: 127.0.0.1
    Port: 9050

Nearly any application that allows you to adjust network settings by using proxies can make use of the Tor Anonymity Network. Configuring your application of choice is a matter of selection to use HTTP or Sockets.

If you’re unsure, use trial and error. ;)

A great note that I came across on the Community Ubuntu Documentation page for Tor that I think everyone should read carefully before using Tor is as follows:

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.

Conclusion

Hopefully by this point you’ve successfully configured Tor for all of your anonymity needs. Will Tor works great, it only works great if you’ve configured it correctly.

Some Tor connections may be slower than others. If you’re experiencing a connection that is simply too slow for your needs or if you need a new ip address so you can get that file from RapidShare without having to wait for an hour, simply open Vidalia Control Panel and click “Use a New Identity.”

Remember that Tor can be used for Windows and Mac, and is more straightforward to install for them as well.

While there have been a few flaws exposed, as mentioned before, I would tend to think the risk of being identified over Tor is very low since the attacks would have to occur on the same network that you’re connected to. I typically only use Tor at public internet access points (which is where these attacks would be most likely to occur), but it can be very handy in many situations and will likely continue to be on the list of my apps to install for a long long time.