Install and Use torsocks on Ubuntu

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo apt install torsocks
sudo apt install torsocks
sudo apt install torsocks

if you need to change configuration :

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
/etc/tor/torsocks.conf
/etc/tor/torsocks.conf
/etc/tor/torsocks.conf

Proxify applications

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
curl https://api.ipify.org?format=json
curl https://api.ipify.org?format=json
curl https://api.ipify.org?format=json
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
torsocks curl https://api.ipify.org?format=json
torsocks curl https://api.ipify.org?format=json
torsocks curl https://api.ipify.org?format=json

Set shell to use Torsocks by default

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
. torsocks on
. torsocks on
. torsocks on
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
. torsocks off
. torsocks off
. torsocks off

References
https://www.binarytides.com/proxify-applications-with-torsocks/
https://linuxconfig.org/install-tor-proxy-on-ubuntu-20-04-linux