In this article, we will delve into the process of configuring Tor with a bridge and Privoxy to proxy the entire system in Ubuntu. This setup allows you to route your system’s traffic through the Tor network, enhancing your privacy and security online.
Configuring Tor with a bridge and Privoxy to proxy the entire system in Ubuntu is a straightforward process that enhances your online privacy and security. By following the steps outlined in this article, you can route your system’s traffic through the Tor network, ensuring anonymity and bypassing any restrictions imposed by ISPs or governments.
- What are Tor, Bridge, and Privoxy?
- Step 1: Installing Tor
- Step 2: Verifying Tor Installation
- Step 3: Installing obfs4proxy
- Step 4: Obtaining Bridge Lines
- Step 5: Configuring Tor with Bridges
- Step 6: Restarting Tor and Checking the Log
- Step 7: Installing and Configuring Privoxy
- Step 8: Restarting Privoxy
- Step 9: Proxying HTTP and HTTPS Traffic
- Alternative Method for Ubuntu Desktop
- Verifying the Configuration
What are Tor, Bridge, and Privoxy?
Tor is a free and open-source software that allows anonymous communication by directing internet traffic through a free, worldwide, volunteer overlay network consisting of more than seven thousand relays.
A bridge in Tor is a relay that is not listed in the public Tor directory, thus making it possible for people to connect to the Tor network when governments or ISPs block all public Tor relays.
Privoxy is a non-caching web proxy with advanced filtering capabilities for enhancing privacy, modifying web page data, managing HTTP cookies, and controlling access.
Step 1: Installing Tor
First, we need to install Tor. Open the terminal and run the following command:
sudo apt-get install tor
This command uses the
apt-get package handling utility to install Tor. The
sudo command is used to run this command as an administrator.
Step 2: Verifying Tor Installation
After installing Tor, we need to check if it’s running properly. Execute the following command:
service tor status
If the server is not running, start it by running:
service tor start
To check the Tor log, run:
journalctl -exft Tor
Look for the line “Bootstrapped 100%: Done”. If this line is not present, it means Tor is not running properly, and you need to configure a bridge.
Step 3: Installing obfs4proxy
To configure a bridge, we need to install
obfs4proxy. Run the following command to install it:
sudo apt install obfs4proxy
obfs4proxy is a pluggable transport proxy for Tor, which allows Tor to connect to bridges.
Step 4: Obtaining Bridge Lines
To obtain bridge lines, visit the Tor Bridges website and follow the instructions to get your bridge line(s).
Step 5: Configuring Tor with Bridges
Next, we need to configure Tor to use the bridges. Open the
torrc file by running:
sudo vim /etc/tor/torrc
Add the following code to the end of the
ClientTransportPlugin obfs4 exec /usr/bin/obfs4proxy
Bridge obfs4 <bridge IP>:<bridge port> <bridge fingerprint> cert=<cert string> iat-mode=0
<bridge fingerprint>, and
<cert string> with the values from your bridge line(s). Save the file and exit.
Step 6: Restarting Tor and Checking the Log
After configuring Tor with bridges, restart the Tor service:
sudo service tor restart
Check the Tor log again:
journalctl -exft Tor
Make sure that the “Bootstrapped 100%: Done” line is present.
Step 7: Installing and Configuring Privoxy
Next, we need to install Privoxy. Run the following command:
sudo apt-get install privoxy
After installing Privoxy, we need to configure it to work with Tor. Open the Privoxy configuration file:
sudo vim /etc/privoxy/config
Remove the comment from the line:
forward-socks5t / 127.0.0.1:9050 .
Save the file and exit.
Step 8: Restarting Privoxy
Restart the Privoxy service:
service privoxy restart
Step 9: Proxying HTTP and HTTPS Traffic
Finally, we need to set the proxy for HTTP and HTTPS traffic. Run the following commands:
These commands set the
https_proxy environment variables to the address and port where Privoxy is running.
Alternative Method for Ubuntu Desktop
If you are using the desktop version of Ubuntu, you can set the proxy in the Network settings:
- Go to Network settings and select the Proxy tab.
127.0.0.1as the proxy address and
8118as the port for HTTP and HTTPS proxies.
Verifying the Configuration
To check if everything is working correctly, you can visit check.torproject.org on your browser. It will confirm if you are using Tor successfully.
Configuring Tor with a bridge and Privoxy to proxy the entire system in Ubuntu might seem complex, but it’s a straightforward process when you follow these steps. This setup will help you maintain your online privacy and bypass any restrictions your ISP or government might impose.
The purpose is to route your system’s traffic through the Tor network, enhancing your privacy and security online.
You can install Tor by running the command
sudo apt-get install tor in the terminal.
A bridge is a relay that is not listed in the public Tor directory, allowing people to connect to the Tor network when public Tor relays are blocked.
You can obtain bridge lines by visiting the Tor Bridges website (https://bridges.torproject.org/) and following the instructions provided.
You need to open the
torrc file using the command
sudo vim /etc/tor/torrc and add the bridge configuration code to the end of the file, replacing the placeholders with your bridge line values.
Privoxy can be installed by running
sudo apt-get install privoxy in the terminal. After installation, you need to open the Privoxy configuration file using
sudo vim /etc/privoxy/config and make the necessary changes to enable proxying through Tor.
You can set the proxy by running the commands
export http_proxy="http://127.0.0.1:8118" and
export https_proxy="https://127.0.0.1:8118" in the terminal.
You can visit check.torproject.org on your browser to confirm if you are using Tor successfully.
These steps are specific to Ubuntu, but similar configurations can be applied to other Linux distributions as well.