Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
GitHub over NTLM

Using GitHub with read/write access, on Debian / Ubuntu, behind a NTLM proxy

This gist is accessible using:

Accessing the Internet, on Linux, behind a NTLM proxy

Most tools don't know how to pass a NTLM proxy, but do know how to pass an HTTP proxy.

Use cntlm to proxify the NTML proxy with a local HTTP proxy (replace $DOMAIN and $USER with the right values):

$ sudo apt install cntlm
$ cntlm -H -d $DOMAIN -u $USER
$ sudo vi /etc/cntlm.conf

Set domain and username, and paste the output of the cntlm command above in that file.

:wq
$ sudo service cntlm restart

Tunneling the git-over-SSH trafic through the proxy

$ sudo apt install socat
$ mkdir -p ~/.ssh
$ cat >>| ~/.ssh/config <<EOF
Host github
User git
Hostname github.com
Port 22
ProxyCommand socat - PROXY:localhost:%h:%p,proxyport=3128
EOF

That's it, you're ready to clone GitHub repositories with read / write access.

$ git clone github:REGOVAR/Regovar.git

Note: use github where you used to have git@github.com, so that it takes your ~/.ssh/config file into account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.