Objective: I want to access my internal website from home so I can do work.

Computers involved:

  • sharms-desktop: My home desktop
  • sharms-server: Server at work with an External IP that allows port 22 to connect to it
  • sharms-webdev: Server at work with the webpage I need to work on

How to do it
This is actually super easy. All we need to do is create an “ssh tunnel” that will allow us to go from sharms-desktop to sharms-server to sharms-webdev. I made a pretty picture to illustrate:

And now the goods, here is exactly what I type, and thats it:

sharms-desktop ~# ssh -N -f -L 10001:sharms-webdev:443 sharms@sharms-server

Now when I point my browser to https://localhost:10001 I am actually seeing the page as if I were on the lan at https://sharms-webdev. Change port 443 to 80 if you are not using ssl. Also the -N means we don’t actually want to open up a new ssh session to run commands, -f means go ahead and run in the background, and the -L lets you specify the tunnel parameters.

Related posts:

  1. Looking for help
  2. Cool things you can do with Ubuntu
  3. Network Manager vs. ConnMan
  4. Stylish desktop, new search engines
  5. Connecting to Ubuntu from Windows