Can’t Access Github behind proxy or Firewall

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


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

> cat ~/.ssh/config
Host gitproxy
User git
Port 443
ProxyCommand /usr/local/bin/corkscrew 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

    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

    What you need to do is (if unix system)

    Change ProxyCommand /usr/local/bin/corkscrew 3128 %h %p
    ProxyCommand /usr/local/bin/corkscrew 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

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


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

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

    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

    Thanks this helped me.

    I wrote a gist so you can create a separate origin for the proxy config:


Subscribe to comments via RSS

Leave a Reply