Skip to content

Instantly share code, notes, and snippets.

@Arkanosis
Last active March 14, 2019 15:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Arkanosis/741fbc266902ff903d1caefa58d1c4e0 to your computer and use it in GitHub Desktop.
Save Arkanosis/741fbc266902ff903d1caefa58d1c4e0 to your computer and use it in GitHub Desktop.
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