Simple HTTP tunneling from work to home

Presentation

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: 68.220.112.76
  • 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.

Software requirement

We need the GNU httptunnel package.

Ubuntu:

  • sudo apt-get install httptunnel

CentOS:

Setup

The server, the home PC:

  • sudo hts --forward-port 192.168.1.1:22 443

The client, the work PC:

  • htc --forward-port 2222 68.220.112.76:443

Note that sudo is only required when forwarding to a port below 1024.

Usage

To connect from the work PC to the home PC:

  • ssh localhost -p 2222

Short URL for this post: http://tmblr.co/ZCdKJyoXec51
blog comments powered by Disqus