SSH Tunnels

From Osnow

Jump to: navigation, search

So if you're self-employed, you have probably found yourself working in a library or coffee shop at some point but restricted by their firewall. There is an easy solution where you can respect their firewall but still be able to access all the services you need to get your work done.

Contents

SSH Server Setup

Install linux on a computer at home and then install OpenSSH.

Open up /etcssh/sshd_config in your editor and find the following string:

   Port 22 

And replace it with

   Port 443 

If you want to lock down access to only certain users then add the following command to the config file.

   AllowUsers jdoe

Also if you don't want to use keys but simply use passwords you will need to uncomment the following line.

   PasswordAuthentication yes

Save the file and then restart OpenSSH from the command line.

   /etc/init.d/ssh restart

Home Firewall Configuraiton

Now you need to set up your firewall at home. You'll need to forward port 443 to the server you set up.

Next, you'll need to know the IP address for your server so you can connect from where you're working. I'd recommend using a service like DynDNS.


SSH Client Configuration

Windows

  • Download [Putty | www.chiark.greenend.org.uk/~sgtatham/putty/]
  • Set up a new session and enter either the IP or domain name for your server at home and port 443.
  • Next go to Connections>SSH>Tunnels
  • We'll use FTP as the first example. There are times that FTP doesn't cooperate so you may want to try using SFTP. So enter port 22 as the source port and in the destination field you'll want to enter the IP or domain you are trying to reach followed by the port number, ie, ftp.example.com:22.
  • Click Add, and then add any other services you need access to.
  • Save your settings.
  • Open a connection to your SSH server.
  • Connect to the service that was previously block using localhost:port instead of the actual domain name. Now you'll be able to access IMAP, FTP or whatever other service is being blocked by a firewall.

Linux

Coming Soon.


Additional Resources

http://weyland.be/wrdprss/index.php/2005/09/28/connections-through-firewall-via-ssh-tunnel/

http://help.ubuntu.com/community/AdvancedOpenSSH

Personal tools