Tuesday, September 05, 2006

yum through a proxy: ntlmaps

This article is deprecated.  Yum configuration file (usually, /etc/yum.conf) supports the following proxy settings:

More info here:

Original post below: 
I had a devil of a time trying to get yum on my Fedora Core 4 box working through the proxy at work. The article below was very helpful in fixing the problem:

I had tried everything, from environment variables to config file changes, and nothing worked. What finally did the trick was this neat little program a frustrated programmer invented as a result of his company using a Microsoft proxy and all his programs breaking because of the Digest authentication NTLM does. Here is the link:

What NTLMaps does is make the proxy server think it is talking to MS IE 5.5. So, where I was getting errors like this:
[Errno 4] IOError: HTTP Error 400: Bad Request ( The data is invalid. )

I am now able to smoothly flow out the proxy. Awesome!

Just make sure to correctly input your NT domain, username and password in the ntlmaps server.cfg file:
NT_DOMAIN: [your nt domain]
USER: [your username]
PASSWORD: [your password]

NT_DOMAIN: mydomain
USER: cacasodo
PASSWORD: mypassword

You'll need to restart main.py for this to work.

Of course, having your password in an ascii text file is not very secure, but if you need to use this product, don't forget to delete the password after you've finished using yum. You'll then point yum to the ntlmaps port on your localhost as below.

Here is the proxy line you'll need to add to your yum.conf:

This will end up looking something like this:

If you're using ntlmaps, your proxy line will look something like this:

Feel free to drop me a line or ask me a question.