How To Use wget With Username and Password for FTP / HTTP File Retrieval

by Vivek Gite · 6 comments

Q. How do I use wget ftp / http client tool to download files from password protected web page?

A. wget command supports username and password combo for both FTP and HTTP file retrieval.

Pass following option to wget command:
--user=userName: Your FTP/HTTP username
--password=passWord : Your HTTP/FTP password

These parameters can be overridden using the --ftp-user and --ftp-password options for FTP connections and the --http-user and --http-password options for HTTP connections.

Download a file called foo.pdf from theos.in:
$ wget --user=vivek --password='myPassword' http://theos.in/protected/area/foo.pdf

Featured Articles:

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 6 comments… read them below or add one }

1 lakshminarayanan 05.14.08 at 1:17 pm

wow…that was cool!

2 chadido 08.08.09 at 7:36 am

thats great u saved me

3 Mauricio Hernandez 08.21.09 at 3:21 am

Could this be used for rapidshare?

4 Vagin 08.24.09 at 12:49 am

Didn’t work for me. I am on a windows machine. Not sure if that makes a diffrence.

5 iqueen 11.18.09 at 11:35 am

gnuwin32.sf.net
wget 1.12
–ftp-user=
–ftp-password=

6 Asterisk 01.12.10 at 9:30 am

Works Like a charm!!!
tx.

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous FAQ:

Next FAQ:

nixCraft FAQ PDF Collection Now Available To All