简体   繁体   English

SSH隧道通过http代理

[英]SSH tunnel through http proxy

I need to create an ssh tunnel to a ssh server and then use a http proxy, 我需要创建一个ssh隧道到ssh服务器,然后使用http代理,

so what I'm doing is ssh -D 5555 user@remotemachine I then configure firefox to use a socks proxy at localhost:5555 but I need the ssh server to use the http proxy and I cant seem to find out how to do this. 所以我正在做的是ssh -D 5555用户@ remotemachine然后我配置firefox在localhost:5555使用socks代理,但我需要ssh服务器使用http代理,我似乎无法找到如何做到这一点。

Consider a scenario where personA is connected to proxy and personB wants to connect to it using personA's connection. 考虑一种情况,其中personA连接到代理,而personB想要使用personA的连接连接到它。 Since A is logged into the proxy, http, https, ftp and socks connection to proxy-server must be available on local port. 由于A登录到代理,因此必须在本地端口上提供http,https,ftp和socks连接到代理服务器。

The proxy-server's ip is PROXY_IP and the http_proxy is available on port PROXY_PORT. 代理服务器的ip是PROXY_IP,http_proxy在端口PROXY_PORT上可用。

At A : 在A:
Connect to Proxy 连接到代理
At B: 在B:
ssh -L $MY_HTTP_PORT:PROXY_SERVER_IP:PROXY_PORT userA@userA_IP ssh -L $ MY_HTTP_PORT:PROXY_SERVER_IP:PROXY_PORT userA @ userA_IP
Cool. 凉。 Proxy tunnel has been setup for http. 已为http设置代理隧道。
Point your firefox to use the port MY_HTTP_PORT on localhost for http_proxy. 指向firefox以使用localhost上的端口MY_HTTP_PORT来获取http_proxy。
You are done. 你完成了。
The funda behind this is : 这背后的基础是:
At B, you are mapping a localport (MY_HTTP_PORT) to point to PROXY_IP (proxy ip) PROXY_PORT port (http) using userA@userA_IP as an intermediate. 在B,您使用userA @ userA_IP作为中间点,将localport(MY_HTTP_PORT)映射到指向PROXY_IP(代理IP)PROXY_PORT端口(http)。

Details on this link . 链接的详细信息。

Use the following command: 使用以下命令:

ssh -gf -ND 9999 user@server

Then configure the SOCKS proxy in your browser with port=9999 and server=localhost 然后在浏览器中使用port=9999server=localhost配置SOCKS代理

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM