How to create an SSH tunnel ?

Discussion in 'Mac OS X Server, Xserve, and Networking' started by Angelo95210, Nov 3, 2009.

  1. Angelo95210 macrumors 6502a

    Angelo95210

    Joined:
    Jan 7, 2009
    Location:
    Paris, France
    #1
    Hi guys !

    I want to create a SSH tunnel from my mac to my webserver, in order to use MySQL Query Browser. I am not allowed to access the MySQL db from outside but I have an SSH access... (on port 2222)

    Does someone know how to do this ?

    Here are the command I tried :
    Code:
    ssh -p2222 -L 3306:localhost:3306 user@host
    ssh -L 3306:localhost:3306 "-p2222 user@host"
    Each time I got this error message from the console when I try to connect with MySQL Query Browser :
    Code:
    open failed: administratively prohibited: open failed
    Guys would be great if you could help ! ;-)
     
  2. Serif macrumors regular

    Joined:
    Jul 10, 2008
    Location:
    UK
    #2
    Looks OK to me. There might be a clue in the server logs as regards why it is disallowing the connection. I'm guessing from the message that the MySQL server is seeing your connection but hasn't been told to accept connections from the localhost? If you have the privileges, maybe use "tcpdump -i lo0 port 3306" to watch what is happening and confirm that you're seeing the traffic hit your server.
     
  3. belvdr macrumors 603

    Joined:
    Aug 15, 2005
    #3
    It looks like they don't allow port forwarding through the server's SSH daemon by setting AllowTcpForwarding to No.
     
  4. Angelo95210 thread starter macrumors 6502a

    Angelo95210

    Joined:
    Jan 7, 2009
    Location:
    Paris, France

Share This Page