Accessing Git under Authenticated Proxy

My office got proxy and firewall. Therefore, only access to port 80 (HTTP), 23 (FTP), and several ports that opened, but not GIT port (port 9418). To make it worse, it also needs authentication to access the proxy.

Here’s simple way to bypass the proxy, and tunnel the GIT into HTTP port:

Use Corksrew

# sudo apt-get install corkscrew

Create Authentication File

You need to store your proxy username and password into this file. It’s a simple file with username:password format.

# vi $HOME/authfile

Create Tunneling Script

This script will be executed by GIT to tunnel the data into HTTP port.

# vi
exec /usr/bin/corkscrew your.proxy.address <proxy_port> $* /your/authfile/location
#chmod +x
Register the Tunneling Script in GIT
# git config --global core.gitproxy /your/
Now you can clone the GIT repository normally

    Leave a Reply

    Fill in your details below or click an icon to log in: Logo

    You are commenting using your account. Log Out /  Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out /  Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out /  Change )

    Connecting to %s

  • Recent Posts

  • Archives

  • Categories

%d bloggers like this: