2

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 
    HostName        1.1.1.1 
        Port            3000 
        IdentityFile    ~/.ssh/%r 


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

So now I would like to "CONVERT":

ssh -L 3306:localhost:3306 root@vps1

in a ssh_config zone

Could someone help me?

1 Answer 1

7

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .