Changing the Password for Elasticsearch and Kibana

This page describes how to change the password for Elasticsearch / Kibana.

Kibana gets its password from Elasticseach. To change the password for the admin user for Elasticsearch and Kibana:
  1. On one of the Elasticsearch nodes, run these commands:
    ESHOME=/opt/mapr/elasticsearch/elasticsearch-5.4.1
    cd $ESHOME/usr/share/elasticsearch/usr/share/elasticsearch/plugins/search-guard-5
    bash tools/hash.sh -p "NewPasswordYouWantForAdmin"
    $2a$12$6ASxMQEBKYPyGUc10RyleOhz3c8RrvPGb7oqLC9xGGwPxJFwOLJtq
  2. Using the hash generated in step 1, edit the sgconfig/sg_internal_users.yml file. Change this:
    admin:
    hash: $2a$12$VcCDgh2NDk07JGN0rjGbM.Ad41qVR/YFJcgHp0UGns5JDymv..TOG
    #password is: <PasswordSpecifiedAtClusterInstallation>
    to this:
    admin:
    hash: $2a$12$6ASxMQEBKYPyGUc10RyleOhz3c8RrvPGb7oqLC9xGGwPxJFwOLJtq
    #password is: <NewPasswordYouWantForAdmin>
    #hash: $2a$12$VcCDgh2NDk07JGN0rjGbM.Ad41qVR/YFJcgHp0UGns5JDymv..TOG
    #password is: <PasswordSpecifiedAtClusterInstallation>
  3. Save the file.
  4. Load the new users database into Elasticsearch:
    KSPW=$(cat $ESHOME/etc/elasticsearch/.keystore_password)
    ./tools/sgadmin.sh -h <esHostname> -f sgconfig/sg_internal_users.yml -t internalusers -ks 
    ../../../../../etc/elasticsearch/keystores/admin-usr-keystore.jks -kspass $KSPW -ts 
    ../../../../../etc/elasticsearch/keystores/truststore.jks -tspass $KSPW -cn MaprMonitoring