HowTo Wget behind Authenticated Proxy

on January 4 | in Linux, Programming / Scripting | by | with 8 Comments

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 🙂

Pin It

related posts

8 Responses to HowTo Wget behind Authenticated Proxy

  1. Mohammad Asad says:

    thanks !!!!!!!!!!!!!!!!
    really helpful
    keep it up

  2. Arunabh says:

    thanks alot for sharing such good knowledge.

  3. Muhammad Umar Rasul says:

    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.

  4. proxy_pass is now proxy_password on RHEL6

  5. R. GANAPATHI RAO says:

    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.

  6. R. GANAPATHI RAO says:

    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.

  7. Tushar Semwal says:

    Mine worked with proxy_passwd = my_password

  8. […] HowTo Wget behind Authenticated Proxy | … – 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 […]

Leave a Reply

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

« »