commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
I have a server with a php requiring basic authentication, like this:
header('WWW-Authenticate: Basic realm="do auth"');
header('HTTP/1.0 401 Unauthorized');
And the basic authentication in wget do not worked:
wget --auth-no-challenge --http-user="username" --http-password="password" -O- "http://url"
wget --keep-session-cookies --save-cookies=cookies.txt --load-cookies=cokies.txt --http-user="username" --http-password="password" -O- "http://url"
I always received the 401 Authorization failed.
The saved cookie is always empty.
With my way, I received the header from the server and save the cookie, then resend the session cookie with authentication data
There are 5 alternatives - vote for the best!
If you can do better, submit your command here.
You must be signed in to comment.