首页  编辑  

SSH tunnel can't listen all IP, only 127.0.0.1(localhost)

Tags: /计算机文档/Linux & Unix/   Date Created:

How to make ssh tunnel open to public?

ssh -R 8080:localhost:80 -N root@example.com
如果使用 ssh -R 0.0.0.0:8080:localhost:80 -N root@example.com 来建立隧道穿透代理,结果发现远程服务器不能监听0.0.0.0,只能监听127.0.0.1端口,解决方法是,在远程服务器上,修改ssh配置:
 set GatewayPorts=clientspecified in /etc/ssh/sshd_config

GatewayPorts yes
or
GatewayPorts clientspecified