9

I must be missing something... I could swear I've done this before but I've torched the VM's that I was using previously.

How do you get apt-get to authenticate through a proxy that only supports NTLM? Do I need to change my proxy config to also support other authentication mechanisms?

Ubuntu 10.04.

squillman
  • 37,883
  • 12
  • 92
  • 146

3 Answers3

12

A better alternative is to install CNTLM, which is an NTLM proxy that presents itself as an ordinary web proxy.

It's quite easy to install from .deb (trivial dependencies adduser and libc6 which should be on every system ever) and configure. Once you have it installed, you just tell apt-get to use proxy localhost:3128.

This solution has two advantages:

  1. it works for all programs using HTTP/HTTPS/FTP, including apt-get, web browsers, and SSH sessions tunneled over HTTPS (good for escaping the firewall if you need to.)

  2. your password is stored in cntlm.conf as a hash instead of in plain text.

CNTLM works on Windows as well. Very neat.

Bart De Vos
  • 17,911
  • 6
  • 63
  • 82
Li-aung Yip
  • 423
  • 1
  • 4
  • 9
  • This solution worked for me. I installed CNTLM on the Windows host machine and I'm just using it as a relay that doesn't require any authentication. The only drawback with CNTLM is the credentials have to be provided, either in the .ini file or in the command line or prompted during startup. It doesn't use the .pac configuration file from Windows either. In addition, it should be correctly configured to only allow the VM to connect through it and not create a security breach. – NicolasBernier Feb 23 '23 at 12:49
6

in /etc/apt/apt.conf, add the line:

Acquire::http::Proxy "http://MYDOMAIN\MYNAME:MYPASS@MY.PROXY.COM:MYPORT";

the semicolon is required at the end of the line to add

Grizly
  • 2,063
  • 15
  • 21