Reuse your precious ports simultaneously.
It is a well-known trick to
use the HTTP
CONNECT method to politely ask a web proxy to open a specific port on a specific machine on the Internet. This is how many people manage to connect back to their SSH server at home. SSH clients such as PuTTY know how to go through web proxies using this technique.
However, your company security administrator may have configured the proxy to only allow port 443 for outgoing
CONNECT requests. Well, you can easily set up your SSH server so that it listens on both 22 and 443 ports:
# sshd_config file Port 22 Port 443
What if you also run a HTTPS server on this machine? There is no way for you to contact it outside port 443 (due to the security policy) and besides, everyone else using the service at https://home.example.com/ uses port 443.
You have one port and two services. Do you really have to abandon one of them?
You need some kind of proxy, or rather, reverse-proxy sitting on port 443 at home.example.com that can tell the difference between a SSL connection and a SSH connection.
Using a tool such as Ethereal, it's quite easy to notice the differences between the two protocols by looking at the first few packets of data exchanged. The SSH server packets look something like:
while the client resembles:
Then they both negotiate the cyphering protocol and everything else. HTTP over SSL looks different. ...