我不确定我是否使用了正确的“端口转发”术语。我想要做的是连接到连接到专用网络上的远程服务器的本地端口。
local - >跳转框 - >服务器
在服务器上,网络服务器正在端口80上运行 在本地我想让我的浏览器连接到localhost:8080并到达服务器的端口80。 跳转框是标准端口22 ssh服务器。
这可能吗?
答案 0 :(得分:2)
我找到了答案:
ssh <user>@<server ip> -o 'ProxyCommand ssh <user>@<jump box> nc <server ip> 22 2>/dev/null' -f -L <local port>:localhost:<server port> -N
例如
ssh jsmith@web.local -o 'ProxyCommand ssh jsmith@gateway.example.com nc web.local 22 2>/dev/null' -f -L 8080:localhost:80 -N