autoSSH内网穿透
vim /etc/ssh/sshd_config
#GatewayPorts no -> GatewayPorts yes
sudo service sshd restart
yum install autossh
#-M 4010 x使用内网主机 A 的 4010 端口监视 SSH 连接状态,连接出问题了会自动重连
#-N 不执行远程命令
#-R 远程主机(公网主机 B)的某个端口:转发到本地指定机器的指定端口
autossh -M 4010 -NR 80:localhost:4000 username@xxx.xxx.xxx.xxx (-p xxxx)
本文介绍如何在Linux系统中设置autoSSH,实现内网穿透,通过监控并自动重连SSH连接。主要内容包括修改sshd_config文件、启用GatewayPorts、安装autossh并配置其监视和转发选项。

764

被折叠的 条评论
为什么被折叠?



