Showing posts with label tunnel. Show all posts
Showing posts with label tunnel. Show all posts

13 Oct 2011

Creating an SSH tunnel in Microsoft Windows using putty

We've already seen how to create an ssh tunnel using *nix command line in  a previous post, but now we'll see how to do it in microsoft windows.

Just to remember you that an SSH tunnel can be used, among many other things, to give you access to an application running on a specific port on a remote machine to which you would not have direct access as it was blocked by a firewall. You need, however, to have ssh access to that machine.

Firts we need putty, an ssh client that can be downloaded here for free:
http://www.chiark.greenend.org.uk/~sgtatham/putty/

Then start it up and type in the hostname you are connecting to as shown in the picture.
Having the hostname we change to the Tunnel configuration screen, under Connection/SSH (see figure).
 Here we enter the local port in which the destination port will be mapped and the destination IP or hostname and port and then click the 'Add' button.

In this example we would be tunneling our local port 8088 to the remote machine's port 8088.
Finnaly we just hit 'Open' and a shell will be shown asking for our credentials on the remote server.
After a successfull login the remote service will be available in the local machine as localhost:8088



15 Jun 2008

Creating an SSH Tunnel

Sometimes we just needed to map an ethernet port on my machine to a remote server, in order to access it as it was locally available through 120.0.0.1.

This is the kind of situation in which I use an SSH tunnel.

Assuming that you want to access a database server running on port 3306 on a machine whose IP address is 192.168.1.120 and you don't have access to that machine but can log into 192.168.0.10 from which you can then connect to the database server machine.
Then you could do this:

# ssh -L <localport>:192.168.1.120:3306 -l <remote-username> 192.168.0.10

After a successful login you would be able to connect to the remote database server in your local machine on the port you specified.

# mysql -u DB_USERNAME -h 127.0.0.1:<localport>