Skip to content

torsocks Introduction

torsocks is a utility to reroute IP traffic from a command-line application over the Tor network or a SOCKS5 server.

Using torsocks

dnf -y install epel-release
dnf -y install tor torsocks
systemctl enable --now tor

The common options of the torsocks command follow and, under normal circumstances, require nothing additional. The options come before the application to run (e.g., curl):

OptionsDescription
--shellCreates a new shell with LD_PRELOAD
-u USERSets the SOCKS5 username
-p PASSSets the SOCKS5 password
-a ADDRESSSets the SOCKS5 server address
-P PORTSets the SOCKS5 server port
-iEnables Tor isolation

A sample (redacted) output from the IP checker icanhazip.com via torsocks:

torsocks output

Notice that the torsocks IP address differs from the direct curl IP address.

Author: Neel Chauhan

Contributors: Steven Spencer, Ganna Zhyrnova