This section describes how to reset a user password.

If a regular user forgets their password and cannot log in to the KubeSphere web console, please refer to this document to have an administrator change the user’s password.

If a platform administrator forgets their password, execute the following command on the host cluster to modify the password for the specified account.

kubectl patch users <USERNAME> -p '{"spec":{"password":"<YOURPASSWORD>"}}' --type='merge' && kubectl annotate users <USERNAME> iam.kubesphere.io/password-encrypted-
Note

Replace <USERNAME> in the command with the actual username, and <YOURPASSWORD> with the actual new password.

Attention

The new password <YOURPASSWORD> must meet the password requirements. The password must contain at least one digit, one lowercase letter, one uppercase letter, and one special character (~!@#$%^&*()-_=+|[{}];:'",<.>/? or space), and be 8 to 64 characters in length.

Example:

kubectl patch users admin -p '{"spec":{"password":"P@88w0rd"}}' --type='merge' && kubectl annotate users admin iam.kubesphere.io/password-encrypted-