Panduan
Perintah mengganti password user sendiri
curl -u <user> -XPUT \
'http://localhost:9200/_xpack/security/user/_password?pretty' \
-H 'Content-Type: application/json' -d'
{ "password": "<password>" }'
Contoh mengganti password user sendiri
curl -u elastic -XPUT \
'http://localhost:9200/_xpack/security/user/_password?pretty' \
-H 'Content-Type: application/json' -d'
{ "password": "sangatrahasia" }'
Contoh output
[root@rocky ~]# curl -u elastic -XPUT \
> 'http://localhost:9200/_xpack/security/user/_password?pretty' \
> -H 'Content-Type: application/json' -d'
> { "password": "sangatrahasia" }'
Enter host password for user 'elastic':
{ }
Perintah mengganti password user lain (Admin)
curl -u <user_admin> -XPUT \
'http://localhost:9200/_xpack/security/user/<user_lain>/_password?pretty' \
-H 'Content-Type: application/json' -d'
{ "password": "<password>" }'
Contoh mengganti password user lain (Admin)
curl -u elastic -XPUT \
'http://localhost:9200/_xpack/security/user/kibana/_password?pretty' \
-H 'Content-Type: application/json' -d'
{ "password": "inipasswordkibana" }'
Contoh output
[root@rocky ~]# curl -u elastic -XPUT \
> 'http://localhost:9200/_xpack/security/user/kibana/_password?pretty' \
> -H 'Content-Type: application/json' -d'
> { "password": "inipasswordkibana" }'
Enter host password for user 'elastic':
{ }
Referensi