How to create SSH tunnels to get around Firewall

Posted By Sagar Patil

I normally have access to unix/linux systems through ssh (port 22) but firewall access is often disabled for ports like TNS (1521/1526), Emagent(1158), Grid  (5500). How do you connect to those ports if you don’t have direct access through firewall ? … Use SSH tunneling.

1.  Locate Source (Windows Desktop), Destination  Unix server IP address and port number you wish to connect at Destination

I am trying to connect to destination oracle server ( using TNS port 1529

2. Open putty and add following configuration

Add server and port details

C:\>telnet localhost 1529
Connecting To localhost…Could not open connection to the host, on port 1529: Connect failed

3. Now startup putty session and ssh login at Remote server.

run “netstat -an” on windows desktop to see any sessions with port 1529 are listed

Now try “telnet localhost 1529″ to see if it’s all working as it should.

4. Configure connection detail to port on your local machine which will create a tunnel to the destination server.

I am using TORA so I have directed port 1529 at my local machine , this is very important.

I am now able to connect to Target Oracle database thru my ssh tunnel successfully.

5. Let’s  use “netstat -anp”  at server to see connections from source desktop. (Remote Oracle Server)  & (my Desktop)

[oracle@~]$ netstat -anp | grep
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp        0      0 ::ffff:    ::ffff:    ESTABLISHED -
tcp        0      0 ::ffff:    ::ffff:    ESTABLISHED -

6. At desktop run “netstat -an”  to see established sessions.

Leave a Reply

You must be logged in to post a comment.

Top of Page

Top menu