I have a problem tunneling a ssh connection to a remote server to use Mysql.

I try:

ssh -L 3306:localhost:3306 root@vps1

and works perfectly! (I tested the connection using Mysql WorkBench)

BUt if i do:

ssh root@vps1tunnel

I CAN connect but Mysql WorkBench can't connect to the remote server using the tunnel.

These are the zones in my ssh_config

Host vps1 
        Port            3000 
        IdentityFile    ~/.ssh/%r 

Host vps1tunnel 
        Port            3000 
        IdentityFile    ~/.ssh/%r 
        # MySQL 
        LocalForward    localhost:3306

So now I would like to "CONVERT":

ssh -L 3306:localhost:3306 root@vps1

in a ssh_config zone

Could someone help me?


You want

LocalForward 3306 localhost:3306

Because, as with the -L option, the 'remote' address in the LocalForward option is relative to the SSH server, not the client.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.