User Tools

Site Tools


linux:sysadmin:net:authentication_trough_webproxy

Authenticating against a webproxy

Wget setup

You may want to run wget inside a network environment, where a proxy requests authentication. Or you will like to use pacman in such an environment. You can do so by activating using wget in /etc/pacman.conf.

The following scenario is typical for Windows networks. Let the proxy have the IP 192.168.10.11, listening on port 8080. In this example, for authentication you have to submit the name of a windows domain user account. The domain's name is wonderwall, and the useraccount reads JohnDoe, the password will be Go4It. Let us further assume you want to fetch arch-0.6.iso from prdownloads.sourceforge.net.

  • Add the following lines to your environment:
export http_proxy="http://192.168.10.11:8080"
export ftp_proxy="http://192.168.10.11:8080"
  • Now, start wget with some enhanced options:
--proxy-username="string" --proxy-passwd="string"
 
wget --proxy-user "Wonderwall\JohnDoe" --proxy-passwd "Go4It" http://prdownloads.sourceforge.net/archlinux/arch-0.6.iso
  • You can create an alias to save that configuration, although it may be a security risk to save a passwd inside it:
alias wget 'wget --proxy-user "Wonderwall\JohnDoe" --proxy-passwd="Go4It"'
  • Altenatively, you may use the username/password in the http_proxy/ftp_proxy variables:
export http_proxy="http://wonderwall\\johndoe:Go4It@192.168.10.11:8080"
export ftp_proxy="http://wonderwall\\johndoe:Go4It@192.168.10.11:8080"
/srv/wiki.niwos.com/data/pages/linux/sysadmin/net/authentication_trough_webproxy.txt · Last modified: 2009/08/15 12:14 (external edit)