原英文版地址: https://www.elastic.co/guide/en/elasticsearch/reference/7.7/security-api-change-password.html, 原文档版权归 www.elastic.co 所有
本地英文版地址: ../en/security-api-change-password.html
本地英文版地址: ../en/security-api-change-password.html
重要: 此版本不会发布额外的bug修复或文档更新。最新信息请参考 当前版本文档。
Change passwords APIedit
Changes the passwords of users in the native realm and built-in users.
Prerequisitesedit
-
Every user can change their own password. Users with the
manage_securityprivilege can change passwords of other users.
Descriptionedit
You can use the create user API to update everything
but a user’s username and password. This API changes a user’s password.
For more information about the native realm, see Realms and Native user authentication.
Path parametersedit
-
username - (Optional, string) The user whose password you want to change. If you do not specify this parameter, the password is changed for the current user.
Request bodyedit
-
password - (Required, string) The new password value.
Examplesedit
The following example updates the password for the jacknich user:
POST /_security/user/jacknich/_password
{
"password" : "s3cr3t"
}
A successful call returns an empty JSON structure.
{}