Wednesday, April 27, 2011

How to Tunnel SSH via HTTP Proxy

I have to access ssh server but there is http proxy when I want to go to internet. How can I tunnel ssh via http proxy? Here are the way to do it:

# Download corkscrew. It is easy tool for tunneling SSH through HTTP proxies

# Extract corkscrew then configure and install it
tar -xzvf corkscrew.tar.gz
cd corkscrew
./configure
make install
# Create ~/.ssh/proxyauth file and set authentication for http proxy server
username:password
# Open ~/.ssh/config file. Add proxy server ip address and its authentication in proxyauth file like this:
Host *
ProxyCommand corkscrew proxy_ip_address proxy_port %h %p ~/.ssh/proxyauth
# Try to access your server via ssh
ssh username@example.com
And it's all done. Enjoy!

2 comments:

Anonymous said...

Thanx for this howto ;-)

Stu said...

yeah, you're welcome :)