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
myproxyid:mypassword
:wq

Create Tunneling Script

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

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



    Leave a Reply

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

    WordPress.com Logo

    You are commenting using your WordPress.com 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 )

    Google+ photo

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

    Connecting to %s


  • Recent Posts

  • Archives

  • Categories


Follow

Get every new post delivered to your Inbox.

%d bloggers like this: