SSH tunnel: local => gateway => MySQL server

前端 未结 3 1977
-上瘾入骨i
-上瘾入骨i 2021-02-01 06:50

I need to access a MySQL database on a remote server at my lab. The server is only accessible once I log in to a gateway server on the remote network:

local serv         


        
3条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-01 07:51

    Using the tunnel:

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

    you will be able to connect to the database on localhost port 3307

提交回复
热议问题