This howto describe how to run wget behind authenticated proxy to download files. GNU Wget is a package for retrieving files using HTTP, HTTPS and FTP, the most widely-used Internet protocols. It is a non-interactive commandline tool, so it may easily be called from scripts, cron jobs, terminals without X-Windows support, etc.

GNU Wget comes as default software with almost every distribution, so we are going to just configure it to start downloading using authenticated proxy.

1) Export http_proxy variable

export http_proxy=”http://yourproxyaddress.com:port/”

2) Export http_proxy variable in bash login script

vi ~/.bash_profile

export http_proxy=”http://yourproxyaddress.com:port/”

3) Define Proxy User / Pass in .wgetrc

vi ~/.wgetrc

proxy_user=your_username
proxy_pass=your_password

4) Test

[root@centos1 ~]# wget http://www.rarlab.com/rar/rarlinux-3.8.0.tar.gz
–08:46:50–  http://www.rarlab.com/rar/rarlinux-3.8.0.tar.gz
Resolving proxy01.sohailriaz.com… 10.1.59.81
Connecting to proxy01.sohailriaz.com|10.1.59.81|:80… connected.
Proxy request sent, awaiting response… 200 OK
Length: 791915 (773K) [application/x-gzip]
Saving to: rarlinux-3.8.0.tar.gz'

100%[=======================================>] 791,915     88.8K/s   in 11s

08:47:04 (70.7 KB/s) - rarlinux-3.8.0.tar.gz’ saved [791915/791915]

Enjoy Brothers 🙂

Related Posts

8 thoughts on “HowTo Wget behind Authenticated Proxy

  1. How to configure the POP TOP On RHEL 5 by using the the two lancard Scenario.
    as well as i want to configure the Proxy Squid on the Same Machine.

    One is local and other will use the Live IP.

    Can someone give me the step by step instruction.

    Waitinf for the Urgent response.

  2. Thanx for the info about setting http_proxy. Even man pages of wget does
    not list this option. I landed upon your blog and learned it. But your blog
    has an error, i.e., proxy_pass. It should be proxy_password. I tried it
    on FC14 and failed and was successful only when I changed to
    proxy_password which is listed in the wget man pages.
    Nevertheless thanks again for your efforts in imparting knowledge
    to your friends world over.

  3. Dear Sohail Riaz,
    I am in the middle of learning configuring IPV6 on FC14. I wish use this
    FC14 box as IPV6 router. The box has 2 ethernet interfaces. Please help
    me.

Leave a Reply

Your email address will not be published. Required fields are marked *