Skip to content

Instantly share code, notes, and snippets.

Last active March 14, 2019 15:52
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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.

$ 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
Port 22
ProxyCommand socat - PROXY:localhost:%h:%p,proxyport=3128

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, 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