Linux Install tor and privoxy To Communicate Anonymously On the Internet

Question: How do I install Tor (The Onion Router) software under Debian / Ubuntu Linux? How do I communicate anonymously on the Internet? How do I anonymously browser the Internet so that I can avoid network surveillance that threatens personal freedom and privacy under Linux operating systems?

Answer: Onion routing is a system enabling its users to communicate anonymously on the Internet. You need to install following softwares:

[a] tor – a free software implementation of second-generation onion routing for Windows / Linux / UNIX computer systems.

[b] privoxy – a non-caching web proxy with advanced filtering capabilities for enhancing privacy, modifying web page data, managing HTTP cookies, controlling access, and removing ads, banners, pop-ups and other obnoxious Internet junk. Privoxy has a flexible configuration and can be customized to suit individual needs and tastes. Privoxy has application for both stand-alone systems and multi-user networks.

WARNING! These examples and faq is about anonymity and not about security. Tor can be easily used to see sensitive data by exit nodes. Do not mistake Tor’s anonymity for security.

Install tor and privoxy

Type the following command as root user or use sudo command:
$ sudo apt-get install tor privoxy

Linux tor and privoxy configuration

By default tor listen on TCP port # 9050. Open /etc/privoxy/config file, enter:
$ sudo vi /etc/privoxy/config
Append / change following config directive to chain Privoxy and Tor, both running on the same system:

forward-socks4a   /               127.0.0.1:9050 .

Save and close the file. Restart privoxy:
$ sudo /etc/init.d/privoxy restart

Sample privoxy config file

See man page for detailed information (above configuration is sufficient to get started with tor)

# Generally, this file goes in /etc/privoxy/config
forward-socks4a / 127.0.0.1:9050 .
confdir /etc/privoxy
logdir /var/log/privoxy
actionsfile standard
actionsfile default  
actionsfile user     
filterfile default.filter
 
debug   4096 
debug   8192 
 
user-manual /usr/share/doc/privoxy/user-manual
listen-address  127.0.0.1:8118
toggle  1
enable-remote-toggle 0
enable-edit-actions 0
enable-remote-http-toggle 0
buffer-limit 4096

# Generally, this file goes in /etc/privoxy/config
forward-socks4a / 127.0.0.1:9050 .
confdir /etc/privoxy
logdir /var/log/privoxy
actionsfile standard
actionsfile default
actionsfile user
filterfile default.filter debug 4096
debug 8192 user-manual /usr/share/doc/privoxy/user-manual
listen-address 127.0.0.1:8118
toggle 1
enable-remote-toggle 0
enable-edit-actions 0
enable-remote-http-toggle 0
buffer-limit 4096

Configure browser for tor

Open Firefox click on Edit > Preferences > Advance tab > Settings:

Fig.01: Tor with Firefox network settings

Set 127.0.0.1 and 8118 as privoxy server IP and port number. Now Firefox is ready to use with Tor.

Firefox Torbutton plugin

You can also install Torbutton plugin, for best safety. Simply grab and install the Torbutton plugin, restart your Firefox, and you’re all set to use Tor. From the project page:

Torbutton provides a button to securely and easily enable or disable the browser’s use of Tor. It is currently the only addon that will safely manage your Tor browsing to prevent IP address leakage, cookie leakage, and general privacy attacks.

Further readings:

Posted by: SXI ADMIN

The author is the creator of SXI LLC and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.