一、云服务器:
CentOS 7.5,假设公网IP为:1.2.3.4
ssh配置修改:
1. 打开 /etc/ssh/sshd_config,将GatewayPorts参数设为yes
2. service sshd restart,重启ssh服务
二、内网:
ssh -f -NT -R \*:8888:127.0.0.1:8080 root@1.2.3.4
- 8888是云服务器的端口
- 8080是内网机器的端口
CentOS 7.5,假设公网IP为:1.2.3.4
ssh配置修改:
1. 打开 /etc/ssh/sshd_config,将GatewayPorts参数设为yes
2. service sshd restart,重启ssh服务
ssh -f -NT -R \*:8888:127.0.0.1:8080 root@1.2.3.4