如何在2个代理之间进行动态端口转发?

问题描述 投票:0回答:1

我有一台无法访问互联网的本地计算机和一台可以访问互联网的计算机。在我的本地网络中,我只能在通过 ssh 连接到其他两台计算机后才能连接到该计算机。

Local (123.123.123.0) ---> Host1 (123.123.123.1) ---> Host2 (123.123.123.2) ---> Host3 (123.123.123.3)
我访问互联网的方式是在其他两台主机之间跳转后,仅在主机 3(可以访问互联网的主机)上使用 lynx。 流程如下:

local$ ssh [email protected]
host1$ ssh [email protected]
host2$ ssh [email protected]
host3$ lynx google.com

我想通过动态端口转发连接到host3,这样我就可以通过SOCKS使用firefox访问它,但是我真的不知道如何使用两台机器作为代理(Host1和Host2)。

我尝试过

ssh -D 8081 [email protected] ssh -D 8082 [email protected] ssh -D 8083 [email protected]
并将firefox配置为使用123.123.123.1:8080 SOCKS代理,但它不起作用。

shell ssh proxy openssh tunnel
1个回答
0
投票

假设为每个主机设置了 ssh 密钥,您可以运行以下命令跳转到最终主机

ssh -D 8081 -J [email protected],[email protected] [email protected] 
© www.soinside.com 2019 - 2024. All rights reserved.