創建一個臨時的超級用戶TestSuper:
[root@cfeea elasticsearch]# ./bin/elasticsearch-users useradd TestSuper -r superuser
Enter new password:
Retype new password:
用這個用戶去修改elastic的密碼:
curl -XPUT -u TestSuper:123456 http://localhost:9200/_xpack/security/user/elastic/_password -H "Content-Type: application/json" -d '
{
"password": "q5f2qNfUJQyvZPIz57MZ"
}'