wget is a wonderful tool, specially when you need to download files on remote servers / machines. On remote computers you do not have access to the GUI, and if you want to download a file in the remote filesystem from the Internet your best option is: The command line, and there you have two nice options curl and wget.

Today we'll see how to use wget when you need provide username and password to download a file.

How to use wget with username and password

There are some sites that ask you to provide a login identity in order to access the restricted section of its filesystem.

The command line with wget is something like this:

wget --user=the-username --password='the-password' http://any.valid.url/and_path/and_file

So you are mostly using wget as in its simple way, which is:

wget http://url/path/filename

But with the options

--user: Where you specify a valid user to access the restricted area in the remote site --password: Where you specify the password of the above mentioned user.


As you can see it is really easy to use wget user password combination. Have fun.