SSH tunneling is a very useful feature of SSH protocol. I’ve used it all the time to connect to a LAN network from public / DMZ network. At extreme case, I’ve created a tunnel that goes to another tunnel to reach the host. So how do you do it?
SSH Tunneling using PuTTY
PuTTY is my favorite SSH client on Windows OS. You can download it here. From their website, "PuTTY is a free implementation of Telnet and SSH for Win32 and Unix platforms, along with an xterm terminal emulator".
So download PuTTY if you haven’t done so and all you have to do is to double click the executable. Once PuTTY is loaded, you’ll see screen like below. Type in the host name or IP address and an identifier to identify the connection so you can load it later. Also click on the plus sign next to SSH to expand it.
Next, click on Tunnels under SSH. Take a look at the difference between local and remote tunnel to understand the difference. For the purpose of this document, let’s say you want to connect to your hosting server that has MySQL server listen only to localhost. However, you want to use a GUI client like SQLYog to run SQL queries.