Skip to content

Instantly share code, notes, and snippets.

@lujiacn
Last active November 20, 2015 09:26
Show Gist options
  • Save lujiacn/1ac3f7e6cef446319476 to your computer and use it in GitHub Desktop.
Save lujiacn/1ac3f7e6cef446319476 to your computer and use it in GitHub Desktop.
git connect-proxy
http://www.zeitoun.net/articles/ssh-through-http-proxy/start
Configure the client
I suppose you are on a Linux system (debian for example). First you have to compile the connect binary which will help your ssh client to use proxies (HTTPS in our case). Then you have to configure your ssh client to tell him to use HTTPS proxy when he tries to connect to your ssh server.
Install the connect software :
On debian system, just install the connect-proxy package :
sudo apt-get install connect-proxy
On other Linux systems, you have to compile it :
cd /tmp/
wget http://www.meadowy.org/~gotoh/ssh/connect.c
gcc connect.c -o connect
sudo cp connect /usr/local/bin/ ; chmod +x /usr/local/bin/connect
Configure your ssh client. Open or create your ~/.ssh/config file and add these lines :
## Outside of the firewall, with HTTPS proxy
Host my-ssh-server-host.net
ProxyCommand connect -H proxy.free.fr:3128 %h 443
## Inside the firewall (do not use proxy)
Host *
ProxyCommand connect %h %p
Then pray and test the connection :
ssh my-ssh-server-host.net
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment