Wednesday, February 24, 2010

Creating ssh tunnel from Windows and Solaris

I was trying to find the easiest way to create an ssh tunnel from Windows to a Solaris box via an authenticated gateway server to access a secure web page in the target server, though there are many ways to do that, I found that the easiest one is to use command line.


Assume that a Host A wants to tunnel HTTPS traffic to host C via an authenticated Gateway server host C (where you have an account), then the following steps would be helpful.


Lets assume that the target's server IP address is 10.2.152.2 and the gateway IP is 10.2.152.1, and you want to access https://10.2.152.2:9443 from the source system.



Creating ssh tunnel from Solaris:

bash-3.00$ ssh -L 9443:10.2.152.2:9443 -X username@10.2.152.1

Password: ********

Last login: Wed Oct 21 20:03:26 2009 from system25

Sun Microsystems Inc. SunOS 5.10 Generic January 2005

Sun Microsystems Inc. SunOS 5.10 Generic January 2005

bash-3.00$

Now from a firefox browser if you type https://localhost:9443, the HTTPS traffic will be tunneled to https://10.2.152.2:9443.



Creating ssh tunnel from Windows:


Even though there are many ways to do it from Windows using putty, if you are an UNIX user who love command line, its almost similar to that of the above procedure.


1. Download putty (and cd to the directory where you cn find putty.exe).


2. C:\putty_install> putty -L 9443:10.2.152.2:9443 -X username@10.2.152.1

(A putty window opens)

Using username "username".

Using keyboard-interactive authentication.

Password: ********

Last login: Wed Oct 21 20:03:28 2009 from system25

Sun Microsystems Inc. SunOS 5.10 Generic January 2005

Sun Microsystems Inc. SunOS 5.10 Generic January 2005

bash-3.00$


Now https://localhost:9443 from Windows system will fetch https://10.2.152.2:9443.

No comments:

Post a Comment