标签:port span autossh 外网 sshd_conf ssh 访问内网 str SSH隧道
内网主机上配置:
autossh -M 5678 -CNR 1234:localhost:22 ubuntu@123.207.121.121
可以实现将访问主机123.207.121.121的1234端口的数据,通过隧道转发到内网主机的22端口。
外网主机上配置:
/etc/ssh/sshd_config 加入 GatewayPorts yes
sudo service sshd restart
在外网主机上测试:
ssh floyd@localhost -p 1234
就可以访问到内网主机
标签:port span autossh 外网 sshd_conf ssh 访问内网 str SSH隧道
原文地址:https://www.cnblogs.com/rayfloyd/p/11732184.html