我的 ISP 阻止了tor网络。我无法连接到目录服务器。
如何tor通过HTTP/SOCKS代理进行配置以建立连接?
我正在使用没有 GUI 桌面环境的 ubuntu 服务器。我需要tor通过命令行进行配置。
# /var/log/tor/log
...
Mar 14 14:34:27.556 [warn] Problem bootstrapping. Stuck at 5%: Connecting to directory server. (Connection timed out; TIMEOUT; count 42; recommendation warn)
Mar 14 14:36:29.540 [warn] Problem bootstrapping. Stuck at 5%: Connecting to directory server. (Connection timed out; TIMEOUT; count 43; recommendation warn)
Mar 14 14:42:35.556 [warn] Problem bootstrapping. Stuck at 5%: Connecting to directory server. (Connection timed out; TIMEOUT; count 44; recommendation warn)
Mar 14 14:53:46.532 [warn] Problem bootstrapping. Stuck at 5%: Connecting to directory server. (Connection timed out; TIMEOUT; count 45; recommendation warn)
Mar 14 15:34:26.596 [warn] Problem bootstrapping. Stuck at 5%: Connecting to directory server. (Connection timed out; TIMEOUT; count 46; recommendation warn)
Mar 14 15:34:57.572 [warn] Problem bootstrapping. Stuck at 5%: Connecting to directory server. (Connection timed out; TIMEOUT; count 47; recommendation warn)
Mar 14 15:36:28.580 [warn] Problem bootstrapping. Stuck at 5%: Connecting to directory server. (Connection timed out; TIMEOUT; count 48; recommendation warn)
Mar 14 15:42:34.532 [warn] Problem bootstrapping. Stuck at 5%: Connecting to directory server. (Connection timed out; TIMEOUT; count 49; recommendation warn)
Mar 14 15:53:45.572 [warn] Problem bootstrapping. Stuck at 5%: Connecting to directory server. (Connection timed out; TIMEOUT; count 50; recommendation warn)
Run Code Online (Sandbox Code Playgroud)
mpy*_*mpy 17
您需要编辑您的torrc文件,该文件可能位于/etc/tor/torrc. 用户特定的配置在~/.torrc.
您的相关选项是(取自手册页):
HTTPProxy 主机[:端口]
Tor 将通过此主机:端口(如果未指定端口,则为主机:80)发出其所有目录请求,而不是直接连接到任何目录服务器。
HTTPProxyAuthenticator 用户名:密码
如果定义,Tor 将使用此用户名:密码进行基本 HTTP 代理身份验证,如 RFC 2617。这是目前 Tor 支持的唯一 HTTP 代理身份验证形式;如果您希望它支持其他人,请随时提交补丁。
HTTPSProxy 主机[:端口]
Tor 将通过此主机:端口(如果未指定端口,则为主机:443)进行所有 OR (SSL) 连接,通过 HTTP CONNECT 而不是直接连接到服务器。如果您的 HTTPS 代理仅允许连接到某些端口,您可能需要设置 FascistFirewall 以限制您可能尝试连接的端口集。
HTTPSProxyAuthenticator 用户名:密码
如果定义,Tor 将使用此用户名:密码进行基本 HTTPS 代理身份验证,如 RFC 2617。这是目前 Tor 支持的唯一 HTTPS 代理身份验证形式;如果您希望它支持其他人,请随时提交补丁。
Socks4Proxy 主机[:端口]
Tor 将通过 SOCKS 4 代理在主机:端口(如果未指定端口,则主机:1080)进行所有 OR 连接。
Socks5Proxy 主机[:端口]
Tor 将通过 SOCKS 5 代理在主机:端口(如果未指定端口,则主机:1080)进行所有 OR 连接。
Socks5ProxyUsername 用户名
Socks5ProxyPassword 密码
如果已定义,则根据 RFC 1929 使用用户名和密码对 SOCKS 5 服务器进行身份验证。用户名和密码都必须在 1 到 255 个字符之间。
似乎您正在搜索第一个选项 ( HTTPProxy),因为您无法连接到目录服务器。如果您需要密码来访问代理,也请查看该HTTPProxyAuthenticator选项。