SSH connect through a HTTPS proxy
If you’re on a shielded network which only allows HTTP connections to the internet and you need to connect to a SSH destination, proxytunnel can be a useful tool.
~/.ssh/config
Configure an alias Host proxy-target # Hostname and port the proxy should forward the traffic to Hostname 192.168.1.2 Port 22 # Forward the SSH traffic via a proxy incl. proxy authentication ProxyCommand proxytunnel --encrypt-proxy --proxy=proxytunnel.example.com:443 --proxyauth=PROXY_USERNAME:PROXY_PASSWORD --dest=%h:%p --header="User-Agent: user-agent"
Configure an alias Host proxy-target # Hostname and port the proxy should forward the traffic to Hostname 192.168.1.2 Port 22 # Forward the SSH traffic via a proxy incl. proxy authentication ProxyCommand proxytunnel --encrypt-proxy --proxy=proxytunnel.example.com:443 --proxyauth=PROXY_USERNAME:PROXY_PASSWORD --dest=%h:%p --header="User-Agent: user-agent"
Install required software on client side:
sudo apt-get install -y proxytunnel
sudo apt-get install -y proxytunnel
/etc/apache2/sites-available/proxytunnel.conf
<VirtualHost proxytunnel:443> Servername proxytunnel.example.com DocumentRoot /var/www/null
SSLEngine on SSLProtocol All -SSLv2