ssh反向隧道,让内网也可以对外提供服务

  1. 打开 /etc/ssh/sshd_config,将GatewayPorts参数设为yes
  2. service sshd restart,重启ssh服务

简历反向隧道
ssh -f -NT -R *:8888:192.168.1.102:8080 [email protected]

又,这种隧道一般而言需要长期保持,而ssh连接会超时断开,所以需要用autossh来保持隧道可用。
方法如下:
autossh -M 5678 -NR 19999:localhost:22 [email protected]

https://qdan.me/list/VOSXmsI4tv7fIciF
http://blog.zjutoe.net/?p=95

你可能感兴趣的:(ssh反向隧道,让内网也可以对外提供服务)