And then add the Tor repository (and the key) in Ubuntu using these commands:
For Linux Mint, replace $ (lsb_release -cs) in the first command with the code name of the Ubuntu version on which your version of Linux Mint is based. For Linux Mint 19 (and 19.x), use bionic , while for Linux Mint 18.x use xenial.
Now you can install Tor, tor-geoipdb (to be able to use country-specific output nodes), torsocks (a library for easily torching applications) and deb.torproject.org-keyring (a package that makes sure you have the last signature of key repository ):
II. Optionally, install Privoxy and configure it to use with Tor
Privoxy is a web proxy without a cache. You can use it with Tor if you plan to use Tor with applications that only support HTTP proxies (not compatible with SOCKS5).
To install Privoxy on Ubuntu or Linux Mint, use:
To use Privoxy with Tor you must edit your configuration file ed
/etc/privoxy/config con un editor de texto, como Nano (como root):
In this configuration file, paste the following line at the end, without changing anything else:
There is a space and then a period at the end of the line, which is not a typo.
Then save the file and sa (to save the file using the Nano command line text editor, press Ctrl + O, then Enter; exit using Ctrl + X).
Now you will need to restart Privoxy:
Using Tor and Privoxy in Ubuntu or Linux Mint
I. Tor use through torsocks
To easily start an application and make it use Tor, you can use torsocks, which works with both GUI and command line programs. This library ensures that DNS requests are handled securely and explicitly rejects any non-TCP traffic from the application you are using.
For example, to start Sporify with torsocks, use:
To test it, run this command to get your real IP address:
(In case curl is not installed, you can install it using: sudo apt install curl )
And then execute the same command but using torsocks:
The torsocks command should return a different IP because it was executed through the Tor proxy.
If you receive an error, the Tor service may not be running. It should start automatically when it is installed, but if it is not, you can start it with this command:
However, there is a problem with torsocks: it fails to start some applications. For example, running torsocks firefox or torsocks google-chrome does nothing. For such cases, you must enter the Tor SOCKS5 proxy manually in the application you wish to use; see below.
II. Enter the proxy address manually
Once you install Tor and Privoxy, you can use the following proxy information (you only need to configure one of these two) in the application's network / proxy settings:
SOCKS5 proxy: use localhost as the proxy / IP server, and 9050 as the HTTP proxy port (requires Privoxy to be installed and configured as explained): use localhost as the proxy address and 8118 as the port.
Use an SOCKS5 proxy when possible or, if the application does not support it, use a normal HTTP proxy instead.
You can also use Tor as a proxy for the entire system. For example, in Gnome, go to System Settings> Network, click Network Proxy, set the proxy to Manual, then use localhost as Host Socks and 9050 as the port: