#创建用户
具有平台管理员角色的用户可以通过平台界面创建本地用户并为其分配角色。
#目录
#步骤
- 在左侧导航栏中,点击 Users > User Management
- 点击 Create User
- 配置以下参数:
| 参数 | 描述 |
|---|---|
| Password Type | 选择密码生成方式: Random:系统生成安全随机密码 Custom:用户手动输入密码 |
| Password | 根据所选类型输入或生成密码。 密码要求: - 长度:8-32 个字符 - 必须包含字母和数字 - 必须包含特殊字符( ~!@#$%^&*() -_=+?)密码字段功能: - 点击眼睛图标显示/隐藏密码 - 点击复制图标复制密码 |
| Mailbox | 用户邮箱地址: - 必须唯一 - 可作为登录用户名 - 与用户名关联 |
| Validity Period | 设置用户账号有效期: 选项: - Permanent:无限期 - Custom:通过时间范围下拉框设置起止时间 |
| Roles | 为用户分配一个或多个角色 |
| Continue Creating | 切换开关控制创建后行为: - 开启:跳转到新用户创建页面 - 关闭:显示用户详情页面 |
- 点击 Create
NOTE
用户创建成功后:
- 若“Continue Creating”开启,将跳转到创建新用户页面
- 若关闭,将显示已创建用户的详情页面
#通过 YAML 创建用户
您可以在 global 集群中提交以下 YAML 来创建用户。
apiVersion: auth.alauda.io/v1
kind: User
metadata:
labels:
auth.cpaas.io/user.connector_id: "" # Connector ID for external authentication (leave empty for local users)
auth.cpaas.io/user.connector_type: "" # Connector type for external authentication (leave empty for local users)
auth.cpaas.io/user.email: c18c9911faaac4e1051a599b88c62af2 # MD5 hash of the username (spec.email)
auth.cpaas.io/user.state: active # User state; must match spec.state
auth.cpaas.io/user.username: "" # User display name; must match spec.username
auth.cpaas.io/user.valid: "true" # Whether the user is valid; must match spec.valid
name: c18c9911faaac4e1051a599b88c62af2 # Name of the User resource; MD5 hash of spec.email
spec:
connector_name: "" # Name of the external authentication connector (leave empty for local users)
connector_type: "" # Type of the external authentication connector (leave empty for local users)
email: leizhuaaa # User identifier; can be an email address or any unique string
is_admin: false # Whether the user is an initial admin user; must be set to false
state: active # User account state: active or inactive
username: "" # Display name for the user
valid: true # Whether the user account is valid; should be set to true