Jesse Beder
Jesse Beder

Reputation: 34034

Why isn't wget accepting my username/password?

I've tried both

wget --user=myuser --password=mypassword myfile

and

wget --ftp-user=myuser --ftp-password=mypassword myfile

but I keep getting the error

HTTP request sent, awaiting response... 401 Authorization Required
Authorization failed.

I know the file is there, and I know the username/password are correct - I can ftp in with no problem. Any thoughts on what's going on here? How do I even tell if wget is paying attention to the username/password that I'm giving it? (The error is the same if I simply don't provide that info.)

Upvotes: 7

Views: 38717

Answers (4)

Frederick
Frederick

Reputation: 1301

One more comment:

Setting --user and --password sets the user/pw for both ftp and http requests, so that's more general.

In my case, nothing worked, except using --ask-password

I was using a https URL.

Upvotes: 2

snugam
snugam

Reputation: 1

it might be useful to add that if you need to add a domain name before that the backslash must be escaped i.e. "\" is preceded with another "\" e.g. "domain\\username" similarly if the password has any chars that requires escaping (i supposed, havn't tested it).

wget --http-user=domain\\\username --http-password=password http://...

Upvotes: 0

Latib
Latib

Reputation:

try wget --http-user=username --http-password=password http://....

Upvotes: 25

Marc Novakowski
Marc Novakowski

Reputation: 45398

Are you using an "ftp://" URL? From the error message it appears that you're making a request for an "http://" URL.

Upvotes: 4

Related Questions