torsocks 简介¶
torsocks 是一个实用工具,可以将命令行应用程序的 IP 流量重新路由到 Tor 网络或 SOCKS5 服务器。
使用 torsocks¶
dnf -y install epel-release
dnf -y install tor torsocks
systemctl enable --now tor
torsocks 命令的常用选项如下,在正常情况下不需要其他操作。选项应放在要运行的应用程序(例如 curl)之前。
| 选项 | 描述 |
|---|---|
| --shell | 创建一个新的 shell,并设置 LD_PRELOAD |
| -u USER | 设置 SOCKS5 用户名 |
| -p PASS | 设置 SOCKS5 密码 |
| -a ADDRESS | 设置 SOCKS5 服务器地址 |
| -P PORT | 设置 SOCKS5 服务器端口 |
| -i | 启用 Tor 隔离 |
通过 torsocks 使用 IP 检查器 icanhazip.com 的示例(已编辑)输出

请注意,torsocks 的 IP 地址与直接使用 curl 的 IP 地址不同。
作者:Neel Chauhan
贡献者:Steven Spencer, Ganna Zhyrnova