DEV Community


Posted on

Set UP Tor as local proxy

sudo apt install tor

Apt through Tor
Going off of the apt-transport-tor Github README, to get apt to work through Tor:

Back up /etc/apt/sources.list and all .list files in /etc/apt/sources.list.d
Open a terminal by pressing Ctrl+Alt+T
Run the following:

sudo -i
apt update
apt install apt-transport-tor
sed -i 's/ http/ tor+http/g' /etc/apt/sources.list /etc/apt/sources.list.d/*.list
apt update
Make sure to fix any error messages that appear (if needed, restore the files you backed up)

Note: Be aware that some programs, like Google Chrome, will modify their .list file, so those programs may automatically switch back to trying to connect directly when checking for updates instead of going through Tor.

Tor is running when you try to connect using it. You can run sudo netstat -plnt | fgrep :9050 and see if you get a line saying tor is running.

ss -nlt

test connection
wget -qO -; echo
torsocks wget -qO -; echo

Discussion (0)