跳至内容

torsocks 简介

torsocks 是一款实用程序,用于通过 Tor 网络或 SOCKS5 服务器重新路由来自命令行应用程序的 IP 流量。

使用 torsocks

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

torsocks 命令的常用选项如下,在正常情况下,不需要其他操作。这些选项位于要运行的应用程序之前(例如,curl

选项描述
--shell使用 LD_PRELOAD 创建新的 shell
-u USER设置 SOCKS5 用户名
-p PASS设置 SOCKS5 密码
-a ADDRESS设置 SOCKS5 服务器地址
-P PORT设置 SOCKS5 服务器端口
-i启用 Tor 隔离

通过 torsocks 使用 IP 检查器 icanhazip.com 的示例(已屏蔽)输出

torsocks output

请注意,torsocks IP 地址与直接 curl IP 地址不同。

作者:Neel Chauhan

贡献者:Steven Spencer,Ganna Zhyrnova