# How to run curl and hide the username's password from command?

**URL:** <https://discuss.elastic.co/t/how-to-run-curl-and-hide-the-usernames-password-from-command/352567>\
**Category:** Elasticsearch\
**Created:** [February 5, 2024, 8:10pm UTC](https://discuss.elastic.co/t/how-to-run-curl-and-hide-the-usernames-password-from-command/352567 "2024-02-05T20:10:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpniel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mpniel/32/113170_2.png) [@mpniel](https://discuss.elastic.co/u/mpniel)\
**Post date:** [February 5, 2024, 8:10pm UTC](https://discuss.elastic.co/t/how-to-run-curl-and-hide-the-usernames-password-from-command/352567/1 "2024-02-05T20:10:48Z")

</div>

How to run curl and hide the username's password from command?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 5, 2024, 8:23pm UTC](https://discuss.elastic.co/t/how-to-run-curl-and-hide-the-usernames-password-from-command/352567/2 "2024-02-05T20:23:55Z")

</div>

Don't set the password and curl will ask you.  
Otherwise, use an API Key.

---

<div class="post-metadata">

**Author:** ![mpniel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mpniel/32/113170_2.png) [@mpniel](https://discuss.elastic.co/u/mpniel)\
**Post date:** [February 5, 2024, 10:32pm UTC](https://discuss.elastic.co/t/how-to-run-curl-and-hide-the-usernames-password-from-command/352567/3 "2024-02-05T22:32:27Z")

</div>

How do I create an api key for use with curl?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 5, 2024, 11:57pm UTC](https://discuss.elastic.co/t/how-to-run-curl-and-hide-the-usernames-password-from-command/352567/4 "2024-02-05T23:57:34Z")

</div>

> **[Create API key API | Elasticsearch Guide \[8.12\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html)**

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 4, 2024, 11:58pm UTC](https://discuss.elastic.co/t/how-to-run-curl-and-hide-the-usernames-password-from-command/352567/5 "2024-03-04T23:58:03Z")

</div>

Closed on March 4, 2024, 11:58pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
