Bird
Raised Fist0

Which of the following is the correct syntax to pass basic authentication credentials in a curl command to Elasticsearch?

easy📝 Syntax Q3 of Q15
Elasticsearch - Security
Which of the following is the correct syntax to pass basic authentication credentials in a curl command to Elasticsearch?
Acurl -auth username:password http://localhost:9200
Bcurl --auth username password http://localhost:9200
Ccurl -u username:password http://localhost:9200
Dcurl -user username password http://localhost:9200
Step-by-Step Solution
Solution:
  1. Step 1: Recall curl basic auth syntax

    The correct syntax uses '-u' followed by 'username:password'.
  2. Step 2: Identify incorrect options

    Options with '--auth', '-auth', or '-user' are invalid curl flags.
  3. Final Answer:

    curl -u username:password http://localhost:9200 -> Option C
  4. Quick Check:

    curl basic auth = -u username:password [OK]
Quick Trick: Use '-u username:password' for curl basic auth [OK]
Common Mistakes:
MISTAKES
  • Using incorrect curl flags like --auth or -user
  • Separating username and password with space instead of colon
  • Omitting the '-u' flag entirely

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes