且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

SSH隧道:local =>网关=> MySQL服务器

更新时间:2023-01-20 08:08:37

使用以下命令:

$ ssh -f user@gateway -L 3307:1.2.3.4:3306 -N 

这表明到客户端本地主机3307的所有连接都将通过SSH隧道转发到网关,然后连接到主机1.2.3.4到端口3306.

This states that all connections to client localhost 3307 will be forwarded via the SSH tunnel to gateway and then connected to host 1.2.3.4 to port 3306.

如果SSH位于端口24222上,则

edit: If the SSH is on port 24222 then

$ ssh -f user@gateway -p 24222 -L 3307:1.2.3.4:3306 -N