Can’t Access Github behind proxy or Firewall

Use corkscrew to get through the firewall. You will have to install it from source.

website: http://www.agroman.net/corkscrew/

Now edit your ~/.ssh/config file, create it if you haven’t got one.

> cat ~/.ssh/config
Host gitproxy
User git
Hostname ssh.github.com
Port 443
ProxyCommand /usr/local/bin/corkscrew proxy.example.com 3128 %h %p
IdentityFile /home/jordan/.ssh/id_rsa

Now use this proxy when cloning git

git clone [email protected]:jordandcarter/ihavealovelybunchofproject

If you have trouble connecting, cloning, pulling, pushing to and from git through a firewall with a proxy.  This should have have solved your problem and allow git to create an ssh tunnel through the http proxy.

Posted on March 17, 2010 at 9:45 pm by Jordan Carter · Permalink
In: Server Config, Ubuntu Tricks, Web Development · Tagged with: , , , ,

5 Responses

Subscribe to comments via RSS

  1. Written by Dairon Medina
    on May 28, 2010 at 2:25 am
    Permalink

    Hey, my proxy have authentication and i cant connect, it gives the following error:
    Proxy could not open connnection to gitproxy: Proxy Authentication Required
    ssh_exchange_identification: Connection closed by remote host
    Please help me and reggards from Cuba

  2. Written by Jordan Carter
    on June 3, 2010 at 5:16 am
    Permalink

    What you need to do is (if unix system)

    Change ProxyCommand /usr/local/bin/corkscrew proxy.example.com 3128 %h %p
    to
    ProxyCommand /usr/local/bin/corkscrew proxy.example.com 3128 %h %p /home/dairon/.proxyauth

    Then inside .proxyauth put

    :

    The proxy will now be used with that username and password.

  3. Written by Javid Jamae
    on June 22, 2012 at 5:38 am
    Permalink

    Any tips on doing this for windows? I’m trying to get through a windows proxy so the proxyauth file is something like:

    NTADMIN\username:password

    I tried with quoting and also with escaping the backslash, but I keep getting the “Proxy could not open connnection to ssh.github.com: Proxy Authentication Required” error.

  4. Written by Jordan Carter
    on October 23, 2012 at 10:20 pm
    Permalink

    Sorry, I avoid development on a windows machine like the plague. Did you find a solution?

  5. Written by Glen Robertson
    on August 31, 2012 at 10:22 am
    Permalink

    Thanks this helped me.

    I wrote a gist so you can create a separate origin for the proxy config: https://gist.github.com/3542771

    Cheers

Subscribe to comments via RSS

Leave a Reply