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:
proxy=your_proxy_server:
proxy_username=
proxy_password=


More info here:
http://joyslearns.wordpress.com/2012/07/18/proxy-settings-for-yum-install-fedora-17/

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:
http://www.fedoraforum.org/forum/showthread.php?s=&threadid=742

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:
http://ntlmaps.sourceforge.net/

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]


eg,
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:
proxy=http://<username>:<password>@localhost:5865

This will end up looking something like this:
proxy=http://gagazote:password@localhost:5865

If you're using ntlmaps, your proxy line will look something like this:
proxy=http://localhost:5865

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