修改公网机器的配置

修改sshd_config
vim /etc/ssh/sshd_config

#GatewayPorts no => GatewayPorts yes

#重启ssh服务
sudo /etc/init.d/ssh stop
root@localhost:~# sudo /etc/init.d/ssh start



内网机器端口转发(假设内网的机器端口80要转发到公网机器的9091端口上)

ssh -NR 9091:0.0.0.0:80 root@remote_ip