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 :)

pixelstats trackingpixel