website/content/zh/docs/v4.1/05-users-and-roles/01-users/07-reset-user-password.adoc
zhuxiujuan28 45d7975e2b add 4.1 docs
Signed-off-by: zhuxiujuan28 <562873187@qq.com>
2024-09-10 16:49:57 +08:00

42 lines
1.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "重置用户密码"
linkTitle: "重置用户密码"
keywords: "Kubernetes, {ks_product}, 访问控制, 用户, 重置密码"
description: "介绍如何重置用户密码。"
weight: 07
---
本节介绍如何重置用户密码。
若普通用户忘记密码,无法登录{ks_product_left} Web 控制台请参阅link:../06-change-the-password-of-a-user[此文档],由管理员修改用户密码即可。
若平台管理员忘记密码,需在 host 集群执行以下命令修改指定帐户的密码。
[,bash]
----
kubectl patch users <USERNAME> -p '{"spec":{"password":"<YOURPASSWORD>"}}' --type='merge' && kubectl annotate users <USERNAME> iam.kubesphere.io/password-encrypted-
----
[.admon.note,cols="a"]
|===
|说明
|
请将命令中的 <USERNAME> 修改为实际的用户名,将 <YOURPASSWORD> 修改为实际的新密码。
|===
[.admon.attention,cols="a"]
|===
|注意
|
新密码 <YOURPASSWORD> 必须符合密码要求。密码必须包含至少一个数字、一个小写字母、一个大写字母和一个特殊字符(~!@#$%^&*()-_=+\|[{}];:'",<.>/? 或空格),长度为 8 到 64 个字符。
|===
示例:
[,bash]
----
kubectl patch users admin -p '{"spec":{"password":"P@88w0rd"}}' --type='merge' && kubectl annotate users admin iam.kubesphere.io/password-encrypted-
----