Last update: 2019-02-06

Using tor to download anonymously on CentOS Linux


In order to download anonymously (whether it's for free speech reasons, to bypass IP-based restrictions, or for other reasons) the TOR Project provides the perfect solution, and it's really easy to use from the command line. On CentOS or RedHat Linux, the best way to get tor is to download it from the EPEL repository. Simply install EPEL and then install tor:

<bash>
yum install epel-release
yum install tor

You can configure the various options by editing files in the /etc/tor folder, however the defaults are fine for our uses, so we won't change anything. Once configured, you have to start the service. This will create a SOCKS proxy for you to use:

<bash>
systemctl start tor

Note that this takes a minute to start, because the service needs to start the proxy and then connect to the tor directory node. Monitor the startup sequence to know when it's done setting itself up:

<bash>
systemctl status tor

Once the service is running, you can use the torsocks binary to fetch something from the Internet over that tor proxy. For example, here we will use youtube-dl to download a video file:

<bash>
torsocks youtube-dl --prefer-free-formats http://www.example.com/some_video.mp4

At the end, I would suggest stopping the tor proxy when you don't need it:

<bash>
systemctl stop tor

That's it!



© 2007-2019 Patrick Lambert - All resources on this site are provided under the MIT License - You can contact me at: contact@dendory.net