Tunneling for security

For a comprehensive guide to ssh tunneling please check out Using SSH Tunneling.

Setting Up The Tunnel

Through Putty

  • Open up Putty.
  • Specify the host as 'riviera.nuigalway.ie' and the port as '22' as shown below.

  • In the left menu, go to Connection→SSH→Tunnels.
  • Create the new local tunnel as below and click 'Add':

  • 'Click Open' and log into your Compsoc account as normal.

Through the Terminal

  • Use ssh to connect to the server and specify the local port, host and hostport . For example:
 $ ssh <username>@riviera.nuigalway.ie -L 3022:proxy.nuigalway.ie:8080
  • You will be prompted for your Compsoc password.

Setting Up the Browser

  • Open up your browser (firefox portable will work on your U:/ drive) and go to Options→Advanced→Network→Settings if using Firefox on Windows or Edit→Preferences→Advanced→Network→Settings if you are using Firefox on Linux.
  • Add the manual proxy details as below:

Firefox NUIG Proxy Settings

Reverse Tunnels

Reverse tunnels can also be created. These tunnels allow you to use a port on a remote machine and have it redirected back your local machine.

For example:

Johnny is in his student accomodation and has created a webpage for his group project. Johnny decides he wants to show his buddy Jimmy the website he's made but can't redirect port 80 on his gateway. Both Johnny and Jimmy are members of their local CompSoc which run an SSH server.

Johhny can use a reverse tunnel to let Jimmy view his website via their CompSoc server.

Johnny used the following code:

 $  ssh username@domain.com -NR REMOTEPORT:localhost:LOCALPORT -v

Jimmy used the following tunnel to redirect his traffic from local port 8080 through Johhny's reverse tunnel:

 $  ssh username@domain.com -N -L REMOTEPORT:localhost:8080 -v

Now all Jimmy needs to do is enter http://localhost:8080 into his web browser and he'll be redirected to the web server running on Johhny's laptop.

Of course the same can be used for VNC, FTP, SFTP and all other TCP protocols.

 
how_to/ssh_tunneling.txt · Last modified: 2009/04/21 16:40 by foehammer
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki