云服务器8023端口映射到本机8023端口
ssh -N -R 8023:127.0.0.1:8023 root@43.xxx.xxx.xxx
广域网访问:http://43.xxx.xxx.xxx:8023
云服务器ssh开启配置使其生效#
出于安全考虑,如果 SSH 服务器 没有开启允许 GatewayPorts 选项,则即使指定了 远程 IP,也仍然只会绑定到 127.0.0.1.
在 /etc/ssh/sshd_config 配置文件中找到 GatewayPorts,设置为 yes,并重启 sshd 服务。
如有需要可以开启tcp转发: AllowAgentForwarding yes
重启sshd方法:sevice ssh restart 或者 /etc/rc.d/init.d/ssh restart