我有一个远程机器在example.com sshd监听端口1234和Web服务端口5678 。
由于某些原因,我想将http请求“本地化”到该Web服务。
当我执行
ssh -L 4321:example.com:5678 [email protected] -p 1234 -N
在本地计算机( 10.0.0.1 )上,我可以浏览到以下url来查看Web服务:
http://localhost:4321
但是,如果我将浏览器指向:
http://10.0.0.1:4321
我得到错误(错误102:net :: ERR_CONNECTION_REFUSED如果有任何区别)。
有没有办法让ip address而不是localhost的SSH端口转发?
我需要它为了使LAN上的其他计算机可以使用远程服务(10.0.0.0/24)。
使用远程端口转发时,请确保服务器上的sshd_config已启用网关端口(GatewayPorts是)。 否则sshd会忽略绑定接口,只绑定在localhost上