SSH 隧道和企业代理

SSH 隧道和企业代理

场景如下:

2 台计算机(PC1 和 PC2)都使用需要身份验证的 HTTP 代理访问互联网。

我使用以下命令从 PC1 通过 SSH 连接到 PC2:

ssh -D 8080 user@PC2_IP -v

隧道已创建,但当我尝试使用 127.0.0.1:8080 作为 socks4/socks5 代理访问 PC1 中的互联网(Firefox)时,它不起作用。

我错过了什么?

我尝试过不同的端口。另外,我在家里也试过了,也可以,但不同之处在于没有代理。

我如何告诉 PC1 使用 SSH 隧道访问 PC2 的互联网?

  • 我在两台电脑上都有 root 权限
  • 两台电脑的操作系统都是 Debian 6.0.4

访问网站时的详细参数输出:

debug1: channel 11: new [dynamic-tcpip]
debug1: Connection to port 8080 forwarding to socks port 0 requested.
debug1: channel 12: new [dynamic-tcpip]
debug1: Connection to port 8080 forwarding to socks port 0 requested.
debug1: channel 13: new [dynamic-tcpip]
channel 19: open failed: connect failed: Connection timed out
debug1: channel 19: free: direct-tcpip: listening port 8080 for www.superuser.com port 80, connect from 127.0.0.1 port 59380, nchannels 17
channel 20: open failed: connect failed: Connection timed out
debug1: channel 20: free: direct-tcpip: listening port 8080 for www.superuser.com port 80, connect from 127.0.0.1 port 59381, nchannels 16
channel 3: open failed: connect failed: Connection timed out
debug1: channel 3: free: direct-tcpip: listening port 8080 for safebrowsing.google.com port 443, connect from 127.0.0.1 port 59335, nchannels 15
channel 4: open failed: connect failed: Connection timed out
debug1: channel 4: free: direct-tcpip: listening port 8080 for www.google.co.ve port 443, connect from 127.0.0.1 port 59385, nchannels 14
channel 13: open failed: connect failed: Connection timed out
debug1: channel 13: free: direct-tcpip: listening port 8080 for clients2.google.com port 80, connect from 127.0.0.1 port 59391, nchannels 13

在浏览器中,我得到 net::ERR_TIMED_OUT。

相关内容