postimg
Dec 2009 21

Using SSH To Get Around Those Pesky Firewalls0

Posted In Networking By John Hass

Firewalls are important for safety on the internet, but sometimes they just get in the way, so why not remedy that by using what you can to your advantage. At my home I am required to have an SSH connection back to the office. The office is able to connect to all of our remote sites, but  I am not able to have VNC to my home, so I must tunnel VNC. In order to do that I do a SSH local port forward

ssh john@example.com -L8080:127.0.0.1:5590


This will connect to my desktop at work and create a tunnel. The tunnel is from the machine I am sshing from to my desktop at work on port 5590.  So to connect to VNC I just do:

vncviewer 127.0.0.1:8080

Then I am connected via the ssh tunnel to work.

Now lets say you wanted to connect off site to somewhere else, but your always having to ssh to work then to the site so:

Laptop ====> work (example.com)====> site (site.com)

and you have to ssh in 3 times to run different processes or view logs. Why not create a tunnel to do all the work?

ssh john@example.com -L8080:site.com:22

You can then ssh right into site.com by typing

ssh john@localhost -P 8080

this is because the connection is tunneled.

I will get into more ssh stuff as needed like remote port sharing and sharing keys, but the above example really does show the power of ssh.

Leave a comment

Get Adobe Flash playerPlugin by wpburn.com wordpress themes