If you need to access a web application that is firewalled off to a certain ip address space that you are not currently on, you may still be able to access the service by tunneling your connection over SSH.

If you have SSH access to the machine you are trying to access, you can run the following in Terminal:

$ REMOTE_SITE_PORT=3000
$ LOCAL_PORT=3500
$ SSH_HOST='piggy.crbs.ucsd.edu'
$ REMOTE_SITE_TO_ACCESS='localhost'
$ ssh -f $SSH_HOST -L $LOCAL_PORT:$REMOTE_SITE_TO_ACCESS:$REMOTE_SITE_PORT -N

You can even use this method to "leapfrog" from one server to another.

For example:

$ REMOTE_SITE_PORT=3000
$ LOCAL_PORT=3500
$ SSH_HOST='dev-bcarl.crbs.ucsd.edu'
$ REMOTE_SITE_TO_ACCESS='piggy.crbs.ucsd.edu'
$ ssh -f $SSH_HOST -L $LOCAL_PORT:$REMOTE_SITE_TO_ACCESS:$REMOTE_SITE_PORT -N
  • No labels