I'm trying to download an ISO image for Enterprise Linux from RHN or Novell Suse. Both providers have placed ISO images behind paywall. I need to provide authentication credentials before downloading all files. How do I download ISO files using the wget command with user name and password?
You can use the Linux wget command to download large ISO files. The wget can provide user name and password for HTTP/401 Unauthorized headers using the following syntax:
wget --http-user=RHNUserName --http-password=RHNPassword 'https://content-web.rhn.redhat.com/rhn/isos/....'
OR
wget --http-user=NovellUserName --http-password=NovellPassword 'http://download.novell.com/sendredirect....'
In this example, I'm downloading SLES 11 SP1 AMD64 workstation from my personal account, enter:
wget --http-user=MyUSERID --http-password='SecretPassword' 'http://download.novell.com/sendredirect?target=%2Fprot%2Fx4q3cbksW7Q%7E%2FSLES-11-SP1-DVD-x86_64-GM-DVD2.iso&buildid=x4q3cbksW7Q~&fileid=X4FjnhU0Qk4~&mirror=AkamaiHost&nohost=false'
Sample outputs:
Resolving download.novell.com... 130.57.4.44 Connecting to download.novell.com|130.57.4.44|:80... connected. HTTP request sent, awaiting response... 302 Moved Temporarily Location: http://cdn.novell.com/prot/x4q3cbksW7Q~/SLES-11-SP1-DVD-x86_64-GM-DVD2.iso [following] --2011-07-28 07:35:00-- http://cdn.novell.com/prot/x4q3cbksW7Q~/SLES-11-SP1-DVD-x86_64-GM-DVD2.iso Resolving cdn.novell.com... 64.208.241.56, 64.208.241.42 Connecting to cdn.novell.com|64.208.241.56|:80... connected. HTTP request sent, awaiting response... 401 Unauthorized Reusing existing connection to cdn.novell.com:80. HTTP request sent, awaiting response... 200 OK Length: 4605421568 (4.3G) [application/octet-stream] Saving to: `SLES-11-SP1-DVD-x86_64-GM-DVD2.iso.1' 45% [=============================================> ] 2,09,79,89,128 527K/s eta 23m 36s
Please note that user name and password may be intercepted by a third-party while in transit. So make sure you use https version for downloading files.
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop












{ 8 comments… read them below or add one }
What about 2GB upper limit of file size when using wget? Is it still an issue?
No. I can download large files too such as 4.1FB DVD.
Wget 1.10, released June 2005, introduced large file support for files greater than 2Gigs. so use wget version 1.1 or later, you won’t face any issues
Hope it helps
Not only is the user / password sent in clear-text but they are also going to be found in your shell history.
Usually not a big issue, but .bash_histories are regularly checked during pentests. :)
So ? Who cares :p
Use curl.
#> curl –user $USERNAME ‘http://RHN URL/’
You will be prompted for the password. There will be no password in your .bash_history. See `man curl` for more info.
Hmmmmm……but when using a proxy……???
uGet, download manager, can also use username and password logins in CLI but also in a GUI. It can also work via a proxy as well as a LOT more cool features. :)
http://uget.visuex.com and for a list of all the features (there is a lot) go to http://uget.visuex.com/features