Changing the Password for Elasticsearch and Kibana

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-<es_version>
    cd $ESHOME/usr/share/elasticsearch/plugins/search-guard-6
    bash tools/hash.sh -p "NewPasswordYouWantForAdmin"
      $2a$12$6ASxMQEBKYPyGUc10RyleOhz3c8RrvPGb7oqLC9xGGwPxJFwOLJtq
    The es_version depends on the EEP that you have installed. To determine the es_version, use the following table, or refer to Component Versions for Released EEPs:
    Core Version EEP Version <es_version>
    7.7.0 9.2.2 6.8.8
    7.6.1 9.2.1 6.8.8
    7.5.0 9.2.x 6.8.8
    7.4.0 9.x.x 6.8.8
    7.3.0 9.x.x 6.8.8
    7.2.0 9.x.x 6.8.8
    7.1.0 9.0.0 6.8.8
    7.0.0 8.0.0 6.8.8
    6.2.0 8.0.0 6.8.8
    6.2.0 7.1.1 6.8.8
    6.2.0 7.1.0 6.8.8
    6.2.0 7.0.1 6.8.8
    6.2.0 7.0.0 6.8.8
    6.1.1 6.3.5 6.8.8
    6.1.1 or 6.1.0 6.3.4 6.8.8
    6.1.1 or 6.1.0 6.3.3 6.8.8
    6.1.0 6.3.2 6.8.8
    6.1.0 6.3.1 6.8.8
    6.1.0 6.3.0 6.5.3
    6.1.0 6.2.0 6.5.3
    6.1.0 6.1.1 6.5.3
    6.1.0 6.1.0 6.5.3
    6.1.0 6.0.2 6.2.3
    6.1.0 6.0.1 6.2.3
    6.1.0 6.0.0 6.2.3
  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:
    ./tools/sgadmin.sh -h <esHostname> -f sgconfig/sg_internal_users.yml -t internalusers -cacert ../../../../../etc/elasticsearch/certs/ca/chain-ca.pem -cert ../../../../../etc/elasticsearch/certs/admin-usr-clientCert.pem -key ../../../../../etc/elasticsearch/certs/admin-usr-private-key.pem -cn MaprMonitoring