# Problem with Credentials directly in the host url

**URL:** <https://discuss.elastic.co/t/problem-with-credentials-directly-in-the-host-url/79594>\
**Category:** Elasticsearch\
**Created:** [March 22, 2017, 1:50pm UTC](https://discuss.elastic.co/t/problem-with-credentials-directly-in-the-host-url/79594 "2017-03-22T13:50:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akhilesh\_Anb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akhilesh_anb/32/4343_2.png) [@Akhilesh\_Anb](https://discuss.elastic.co/u/Akhilesh_Anb)\
**Post date:** [March 22, 2017, 1:50pm UTC](https://discuss.elastic.co/t/problem-with-credentials-directly-in-the-host-url/79594/1 "2017-03-22T13:50:48Z")

</div>

Hi,

Im trying to access the host with credentials with below syntax

> '[https://user:password@my-site.com:9200](https://user:password@my-site.com:9200)'

Here i'm having one problem.

username :- akhilesh  
password :- akhil@123

when i'm trying to access with URL like

> [https://akhilesh:akhil@123](https://akhilesh:akhil@123)@192.168.86.72:9200

Its throwing me an error, as there are two '@' in the host. Its getting confused and taking **123@192.168.86.72:9200** as a host.

How can i solve this problem?

---

<div class="post-metadata">

**Author:** ![joshbressers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshbressers/32/42332_2.png) [@joshbressers](https://discuss.elastic.co/u/joshbressers)\
**Post date:** [March 22, 2017, 2:25pm UTC](https://discuss.elastic.co/t/problem-with-credentials-directly-in-the-host-url/79594/2 "2017-03-22T14:25:25Z")

</div>

You can escape the @ in the password with %40. So for example:

> [https://akhilesh:akhil%40123@192.168.86.72:9200](https://akhilesh:akhil%40123@192.168.86.72:9200)

Do be mindful that if you include the password in the URL like this from the command line, another user on the system may be able to view it via a process list.

---

<div class="post-metadata">

**Author:** ![Akhilesh\_Anb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akhilesh_anb/32/4343_2.png) [@Akhilesh\_Anb](https://discuss.elastic.co/u/Akhilesh_Anb)\
**Post date:** [March 22, 2017, 3:44pm UTC](https://discuss.elastic.co/t/problem-with-credentials-directly-in-the-host-url/79594/3 "2017-03-22T15:44:48Z")

</div>

Hi @joshbressers,

Thank you for the reply,

---

<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:** [April 19, 2017, 3:44pm UTC](https://discuss.elastic.co/t/problem-with-credentials-directly-in-the-host-url/79594/4 "2017-04-19T15:44:48Z")

</div>

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