远程主机上
/etc/ssh/sshd_config中,开启
GatewayPorts yes
systemctl reload sshd
本地:
ssh -CqTnN -R 0.0.0.0:9000:localhost:7070 root@109.105.4.65
109.105.4.65 9000端口的流量会发送到 localhost的7070端口
SecureSRT设置: 选项->会话选项->远程/x11
ssh -CqTnN -R 0.0.0.0:9999:54.209.106.26:22 [email protected]
将109.105.4.65的9999端口流量发送到54.209.106.26的22端口
所以ssh 109.105.4.65 -p9999,可以连接54.209.106.26