DEV Community

tp1050
tp1050

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
exit
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 - https://api.ipify.org; echo
147.232.135.100
torsocks wget -qO - https://api.ipify.org; echo
162.247.74.200

https://linuxconfig.org/install-tor-proxy-on-ubuntu-20-04-linux

Discussion (0)