一、雲伺服器:
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 [email protected]
- 8888是雲伺服器的端口
- 8080是内網機器的端口