Using apt-get on Linux behind a proxy with Windows domain authentication

by Ras 29. November 2011 17:35

Configuring Linux (Ubuntu on this example) to use proxy with Windows domain authentication

As a usual problem when you are using a proxy server and have to use authentication with a windows domain, as username will be something like domain\username,  it can't be used on Linux.

The reason is we can’t use something like:
export http_proxy=”http://domain\username:password@proxyipaddress:proxyport”

That won’t work!!

As a solution there is a small app out there that you can be installed and used on your machine as an intermediate proxy between your computer and the active proxy server.

To get this you need to download and install ntlmaps from:

http://ntlmaps.sourceforge.net/

(or from debian or ubuntu packages)

During installation it will ask for configuration or you can change the configuration from /etc/ntlmaps/server.cfg after installation.

You specify the proxy server address, port and domain name and username/password on the configuration and also the proxy port that is supposed to be used on your computer and other apps need to use that port on localhost as a proxy(default is 5865)

You can create an environment variable after that similar to below:


export http_proxy=”http://127.0.0.1:5865″
export ftp_proxy=”http://127.0.0.1:5865″


(You can add them to .bashrc of your profile or /etc/profile if you don’t want to add manually after each restart)

And on /etc/apt/apt.conf :
Acquire::http::Proxy “http://127.0.0.1:5865″

Enjoy!

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

About the author

Ras is a network/Security professional working on multiple areas with multiple certificates like CCNP, CCIP, CCSP, CCSA, CCSE, LPI, PM, IPv6, ..

Month List