nc:代理错误:“HTTP/1.0 403 禁止”

nc:代理错误:“HTTP/1.0 403 禁止”

我正在使用 Ubuntu 13.10 x86_64。我无法通过代理 ssh 到远程主机。

当我发布时:

ssh -vl hackep6t 162.251.80.25

我得到了这个输出:

OpenSSH_6.2p2 Ubuntu-6ubuntu0.1, OpenSSL 1.0.1e 11 Feb 2013
debug1: Reading configuration data /home/rootkea/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Executing proxy command: exec nc -X connect -x 192.168.5.254:3128 162.251.80.25 22
debug1: permanently_drop_suid: 1000
debug1: identity file /home/rootkea/.ssh/id_rsa type -1
debug1: identity file /home/rootkea/.ssh/id_rsa-cert type -1
debug1: identity file /home/rootkea/.ssh/id_dsa type 2
debug1: Checking blacklist file /usr/share/ssh/blacklist.DSA-1024
debug1: Checking blacklist file /etc/ssh/blacklist.DSA-1024
debug1: identity file /home/rootkea/.ssh/id_dsa-cert type -1
debug1: identity file /home/rootkea/.ssh/id_ecdsa type -1
debug1: identity file /home/rootkea/.ssh/id_ecdsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2p2 Ubuntu-6ubuntu0.1
nc: Proxy error: "HTTP/1.0 403 Forbidden"
ssh_exchange_identification: Connection closed by remote host 

请帮忙。

答案1

您似乎正在通过 HTTP 代理(端口 3128 上的 squid)进行连接,但 nc 的默认连接协议是 SOCKS5。我认为您需要在 ssh_config 中添加-X connect语句ProxyCommand,以使 nc 通过 HTTP 与您的代理进行通信。请参阅man nc以了解详细信息。

相关内容