Creating an SSH Tunnel

February 3, 2011

After some searching and trial-and-error, I came upon the following command to create an SSH tunnel.

ssh -L <local-port>:<remote-port> <user>@<remote-host>


I discovered using localhost instead of can cause problems, especially with a remote MySQL server thinking it’s a local socket rather than TCP/IP connection.

comments powered by Disqus