解决思路
访问A主机2222
端口,实则是访问B主机的22
端口。
实际解决
这里用到了端口转发工具lcx
(虽然ssh也可以实现)
git clone https://github.com/windworst/LCX
cd LCX
make
chmod +x lcx
lcx的用法:
./lcx -tran <local port> <remote host> <remote port>
这里的local port
就是A主机的 2222 端口,remote host
为 B 主机,remote port
为 B 主机的 22 的端口。
运用场景
使用命令:
ssh root@A -p 2222
适用于网络环境良好,但是连接大陆以外服务器卡顿的情况。