Reset User Password

This section provides guidance on resetting user passwords.

If a regular user forgets their password and is unable to log in to the KubeSphere web console, please refer to this document for instructions on how the administrator can change the user’s password.

If the platform administrator forgets their password, the following command needs to be executed on the host cluster to change the password for the specified account.

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

Please replace <USERNAME> in the command with the actual username and <YOURPASSWORD> with the new password.

Attention

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

Example:

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