How to Default Password Reset

I tried to change the password in three ways, but all failed.

First attempt
Viewed the document and changed the administrator password. An error occurred when I saw the article Apply configuration changes using

ERR: An unexpected IllegalStateException occured: failed to load plugin class []
java.lang.IllegalStateException: failed to load plugin class []
        at org.elasticsearch.plugins.PluginsService.loadPlugin(
        at org.elasticsearch.plugins.PluginsService.<init>(
        at org.elasticsearch.client.transport.TransportClient.newPluginService(
        at org.elasticsearch.client.transport.TransportClient.buildTemplate(
        at org.elasticsearch.client.transport.TransportClient.<init>(
Caused by: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(
        at java.base/java.lang.reflect.Constructor.newInstance(
        at org.elasticsearch.plugins.PluginsService.loadPlugin(
        ... 7 more
Caused by: ElasticsearchSecurityException[Error while initializing transport SSL layer from PEM: ElasticsearchException[Unable to read /etc/elasticsearch/kirk.pem (/etc/elasticsearch/kirk.pem). Please make sure this files exists and is readable regarding to permissions. Property: opendistro_security.ssl.transport.pemcert_filepath]]; nested: ElasticsearchException[Unable to read /etc/elasticsearch/kirk.pem (/etc/elasticsearch/kirk.pem). Please make sure this files exists and is readable regarding to permissions. Property: opendistro_security.ssl.transport.pemcert_filepath];
        ... 13 more
Caused by: ElasticsearchException[Unable to read /etc/elasticsearch/kirk.pem (/etc/elasticsearch/kirk.pem). Please make sure this files exists and is readable regarding to permissions. Property: opendistro_security.ssl.transport.pemcert_filepath]
        ... 17 more

Second try
In order to approach it in a different way, we tried to change the password through ‘Internal users’ menu in ‘kibana’ but it also failed.

{"status":"FORBIDDEN","message":"Resource 'admin' is read-only."}

Last attempt

Although it was used to execute the ‘internal_users.yml’ docker container that was modified after reading the above article, This, too, failed.

node1 | [2021-04-05T05:02:05,046][WARN ][c.a.o.s.a.BackendRegistry] [15a978978631] Authentication finally failed for kibanaserver from ....

kibana | {"type":"log","@timestamp":"2021-04-05T05:02:05Z","tags":["error","elasticsearch","data"],"pid":1,"message":"[ResponseError]: Response Error"}

The above error occurred when trying to access the changed information after changing the password of the kibanaserver account for testing. I think the changed password is probably not applied correctly.

It’s okay if it’s not my approach. I want to know how to change the password. Can someone help me?

@dhhan Your first attempt is needed to change the admin password. You can’t change it using UI or API, as admin certificate is needed.
Assuming you used and as a result were provided with admin cert and key (kirk.pem and kirk-key.pem most likely). Can you try to place these in the elasticsearch/config directory and rerun the using below arguments:

sh -cd /path/to/securityconfig/ -icl -nhnv -cacert /path/to/config/root-ca.pem -cert /path/to/config/kirk.pem -key /path/to/config/kirk-key.pem

1 Like

Do I need to create ‘kirk.pem’ file and ‘kirk-key.pem’ file separately?

I found out that two files do not exist inside the working ODE and ODK containers.

find / -name 'kirk.pem'
find / -name 'kirk-key.pem'

Work was in progress with reference to Docker - Open Distro Documentation

Isn’t the ‘install_demo_configuration’ you mentioned included in ‘openistro-for-elastic search:1.13.2’?

I have just copied the basic docker-compose.yml file from the link you provided and ran docker-compose up.

Once I connected to one of the two ES containers, in config folder I see the following structure:

esnode-key.pem (node key)
esnode.pem (node cert)
kirk-key.pem (admin key)
kirk.pem (admin cert)
root-ca.pem (root ca used to sign all of above certs)

These certs were created using demo script included in the odfe, which detected no security configuration and therefore was executed creating necessary certs and updating config in elasticsearch.yml

If custom configuration (and therefore certs) are being provided via volume mappings in docker-compose.yml file, these need to be placed in config directory and absolute path used in the script execution. Only admin cert/key can be used, therefore if you have not created such cert/key, I would recommend running default docker-compose.yml, extracting the certs and elasticsearch.yml file for comparison. You will notice below line in elasticsearch.yml:


  • CN=kirk,OU=client,O=client,L=test, C=de

Which matched dn of the kirk cert and therefore makes that cert admin.

1 Like

@Anthony Thank you so much for your kind reply to my stupid question.

As you told me, I realized while running ‘default docker-compose.yml’ and comparing directories.

I forgot that I removed the files related to the demo certificate by referring to the Docker Security Configuration - Open Distro Documentation document to provide the certificate to ODFE.

After deleting demo file, I realized that ‘admin key’ and ‘admin cert’ were not created separately.

Thanks to you, I searched the document again and finally found Generate Certificates - Open Distro Documentation. I haven’t tried it yet, but I expect it to work out.

Once again, thank you for answering my stupid question.