Curl authentication

Posted on

Curl authentication – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about linux, apache-2.2, networking, bash, terminal.

I am trying to download a file with cURL from a password protected directory on my site. It is not working. Instead of the downloading the requested file, it downloads a HTML file that says, “Authentication Required!” I’m not sure what the problem is.

I’ve tried both of these (with the same result). The username and password are correct (and if the link below is used in a web browser, the file downloads successfully).

1) The username and password are included as part of the URL.

curl --O /file.dmg;

2) The username and password are included as an option.

curl -u username:wordpass.1 --O /file.dmg;

Solution :

The problem was that authentication was set to Digest for the realm. Changing it to Basic fixed the problem.

Leave a Reply

Your email address will not be published.