How to Use wget With Username and Password for FTP/HTTP Site on Linux

Twitter and LinuxGNU Wget is a free software package for retrieving files using HTTP, HTTPS and FTP, the most widely-used Internet protocols. Some of the website and most of ftp site on internet require username and password in order to access the pages. This post will describe how to use wget with basic authentication.The following example of wget commands should allow you to access pages on a website that requires a username and password:

wget http://username:myPassword@www.ehowstuff.local/example/file.txt
wget --http-user=username --http-password=myPassword http://www.ehowstuff.local/example/file.txt
wget --user=username --password='myPassword' ftp://www.ehowstuff.local/example/file.txt
wget -r --user=username --password='myPassword' ftp://www.ehowstuff.local/example/

Leave a Reply

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

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>