SSH through an HTTP proxy

To SSH (OpenSSH) through an HTTP proxy, you can use the ProxyCommand config option with one of several programs that know how to talk to an HTTP proxy using the HTTP CONNECT method. The one I use is called corkscrew and it works equally well on Linux and Cygwin.

Something like this will do the trick to let you connect through an HTTP proxy to a home server that has an sshd running on port 1234.

Host home
	User            	marc
	HostName        	dns.home.org
	Port            	1234
	ServerAliveInterval 	30
	ProxyCommand    	/usr/bin/corkscrew proxy.corporation.com 3128 %h %p

Once you have one host that you can connect to through the proxy, you can even use that host to get to other hosts.

Host webhost
	User            	marc
	HostName        	dns.webhost.com
	ServerAliveInterval 	30
	ProxyCommand    	/usr/bin/ssh home nc -w 600 %h %p

Leave a Reply

Your email address will not be published.