28 abril 2014

Git SSH over HTTP Proxy

If you are like me and you are using Linux behind an HTTP proxy, you will probably want to access GitHub and other Git remote repositories through SSH. For that to work, you will likely need to use some sort of utility that will enable you to connect to an SSH server through an HTTP proxy server.

To do that, you can use the connect-proxy command. The repository has no binary, so you will have to compile it on your own. But it is not hard if you are a good Linux user . If you run the install.sh script, you will end up with the binary at /usr/local/bin.

The last thing to do is to setup your SSH config file accordingly:

$ cat ~/.ssh/config

Host *
  ServerAliveInterval 30
Host *.amazonaws.com
  ProxyCommand connect-proxy -H proxy.myserver.com:80 %h %p
Host github.com 
  ProxyCommand connect-proxy -H proxy.myserver.com:80 %h %p 

Extra bonus: access to Amazon EC2 with SSH over HTTP Proxy.

If you know a better way to do this, please comment!
Postar um comentário
Contato

Email:bruno.borges(at)gmail.com

LinkedIn: www.linkedin.com/in/brunocborges
Twitter: www.twitter.com/brunoborges
Comprei e Não Vou
Rio de Janeiro, RJ Brasil
Oracle
São Paulo, SP Brasil