SSH Tunneling / Port Forwarding

The following are two examples of accessing your workstation/server inside your firewall

for this how to I will assume the following:


-A system behind the firewall (ssh.company.com) is available to the outside world
-Inside the firewall are several workstations you can remote desktop into (work1.company.com work2.company.com)
-Also inside the firewall is a web server (webpage.company.com) available only inside the company firewall -Your username is bob
-You are outside the firewall and have internet access


Remote Desktop Into A Server

open a console and type the following to open up a connection. For this example we will be accessing the remote desktop of work1.company.com


ssh -L 3390:work1.company.com:3389 -l bob ssh.company.com


After logging with your password, you can now open up your remote desktop application (IE: tsclient or rdesktop)


in the remote desktop client under host enter localhost:3390, and for credentials use the username and password you would normally use for that workstation.


Your remote desktop session should now start and it should be like your sitting in the office. There may be some lag due to the internet connection as well as ssh compression but the connection is solid and secure


Accessing A Internal Website

open a console and type the following to open up a connection. For this example we will be accessing the website of webpage.company.com


ssh -N -L 8888:webpage.company.com:80 bob@ssh.company.com


After logging with your password, you can now open up your favorite web browser and point it to http://localhost:8888


You will now be surfing on your internal website