# How to connect an Elasticsearch server with username and password?

**URL:** <https://community.siren.io/t/how-to-connect-an-elasticsearch-server-with-username-and-password/115>\
**Category:** Siren Platform/Investigate Tech Support Community\
**Created:** [August 12, 2019, 2:06am UTC](https://community.siren.io/t/how-to-connect-an-elasticsearch-server-with-username-and-password/115 "2019-08-12T02:06:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hagen666](https://avatars.discourse-cdn.com/v4/letter/h/ba9def/32.png) [@hagen666](https://community.siren.io/u/hagen666)\
**Post date:** [August 12, 2019, 2:06am UTC](https://community.siren.io/t/how-to-connect-an-elasticsearch-server-with-username-and-password/115/1 "2019-08-12T02:06:25Z")

</div>

Hi,

How to connect a remote elasticsearch server with username and password?

I set ‘elasticsearch.username’ and ‘elasticsearch.password’ in investigate.yml, and set ‘elasticsearch.ssl.virificationMode’'s value to none.

When I start Investigate Server and login the Siren, an error occurrs, showing “could not retrieve virtual indices(401): Authentication finally failed”, the line no is 35 in siren\_core\_plugins.jdbc\_api.index.js.

My siren version is 10.2.4, and i wanna know how to slove it?

Is there any step that missing? or the way i connect the ES server is not proper?

Looking forward to your reply.

Hagen Han

---

<div class="post-metadata">

**Author:** ![varun.sharma](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.siren.io/varun.sharma/32/46_2.png) [@varun.sharma](https://community.siren.io/u/varun.sharma)\
**Post date:** [August 12, 2019, 9:50am UTC](https://community.siren.io/t/how-to-connect-an-elasticsearch-server-with-username-and-password/115/2 "2019-08-12T09:50:08Z")

</div>

Hello hagen666,  
Do you have correct username and password? And have you configured Searchguard (Assuming you’re using Searchguard)? You may check it by running (In terminal):  
`curl -XGET -k -u ${elasticsearch.username}:${elasticsearch.password} https://localhost:9220`  
Make sure to replace the use the username and password you’re using in Investigate.yml

- If you get a response like: `Search Guard not initialized (SG11). See http://docs.search-guard.com/v6/sgadmin`  
Then refer to [Search Guard integration docs](https://docs.support.siren.io/10.2.4/platform/en/siren-investigate/authentication-and-access-control/search-guard-integration-and-siren-investigate-access-control.html).
- Or, if you get a response like:

```auto
{
  "name" : "ntu7c_T",
  "cluster_name" : "siren-distribution",
  "cluster_uuid" : "qwtsEymJSyWy-yK4Dq_v3A",
  "version" : {
    "number" : "6.8.0",
    "build_flavor" : "oss",
    "build_type" : "tar",
    "build_hash" : "65b6179",
    "build_date" : "2019-05-15T20:06:13.172855Z",
    "build_snapshot" : false,
    "lucene_version" : "7.7.0",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

```

- Then run: `curl -XGET -k -u ${elasticsearch.username}:${elasticsearch.password} http://localhost:9220/_siren/connector/index/_search?pretty`. And tell us what error you get.

Regards,  
Varun

---

<div class="post-metadata">

**Author:** ![hagen666](https://avatars.discourse-cdn.com/v4/letter/h/ba9def/32.png) [@hagen666](https://community.siren.io/u/hagen666)\
**Post date:** [August 13, 2019, 9:54am UTC](https://community.siren.io/t/how-to-connect-an-elasticsearch-server-with-username-and-password/115/3 "2019-08-13T09:54:22Z")

</div>

Thank you for your reply. I solved it successfully now.  
After reading the docs in [https://siren.io/browsing-neo4j-data-with-siren-10-2/](https://siren.io/browsing-neo4j-data-with-siren-10-2/), I try to use the neoNode  
plugin to import data. The problem is my elasticsearch server has username and password, and i don’t know how to put the credential information.  
Is there any method to put my username or password? and can i set the verificationMode(like siren federate) to none?

Hagen Han

The error message is that: “unable to get local issure certificate”,and i also don’t know how to put my ES username and password into the neoNode plugin.

---

<div class="post-metadata">

**Author:** ![hagen666](https://avatars.discourse-cdn.com/v4/letter/h/ba9def/32.png) [@hagen666](https://community.siren.io/u/hagen666)\
**Post date:** [August 13, 2019, 11:33am UTC](https://community.siren.io/t/how-to-connect-an-elasticsearch-server-with-username-and-password/115/4 "2019-08-13T11:33:59Z")

</div>

Now, it seems that i solved the problem. By editing app.js and node-fetch.lib.index.js.

Thank you all the same.

* * *

It seems that the the problem hasn’t been solved yet. After creating entity in Siren, the NeoNode try to connect the Siren and editing the data, which need siren’s authentication. How to solve it?
