FreeKB - Curl -u --user (authentication)
Curl - -u --user (authentication)

In this example, the foo.html page is being requested from the web server.



Let's say access to this page require basic authentication (username/password). The -u or --user option can be used to include a username and password in the request.

curl --user john.doe:itsasecret


Special Characters

Be aware that if the username or password contains special characters, such as an exclamation point . . . 

curl --user john.doe:itsa!secret


Something like this will be returned.

-bash: !s: event not found


Special characters will need to be escaped, like like.

curl --user john.doe:itsa\!secret


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter c7bd1 in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |