Simple HTTP tunneling from work to home
HTTP tunneling is a technique to hide a connection, say SSH, into a simple and harmless HTTP protocol. The point is that quite often SSH will be blocked by the the work firewall, even if you are using another port like 443 because it will see that what is really going through is SSH. By using HTTP tunneling, the SSH is encapsulated in an HTTP message. So most firewall will let it pass.
There are already many tutorial on how to do HTTP tunneling. But they usually apply to a 3 tiers configuration where you will use your home PC to access to a server on the Internet from work.
This tutorial covers the very simple case where you want to SSH to your home PC from work.
Example of a network configuration
- Home WAN IP: 184.108.40.206
- LAN IP of server you wish to connect to: 192.168.1.1
- Open port on work firewall: 443 (HTTPS). I prefer to use this port instead of 80 so I can keep the later for plain Web Server access.
We need the GNU httptunnel package.
sudo apt-get install httptunnel
sudo rpm -ivh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
yum install httptunnel
The server, the home PC:
sudo hts --forward-port 192.168.1.1:22 443
The client, the work PC:
htc --forward-port 2222 220.127.116.11:443
Note that sudo is only required when forwarding to a port below 1024.
To connect from the work PC to the home PC:
ssh localhost -p 2222