使用以下过程创建有或没有管理员角色的用户。
hostname:> configuration users
hostname:configuration users> type username
有关用户类型的说明以及有关设置用户名值的帮助,请参见了解用户和角色。
如果指定 directory 作为用户类型,则会立即配置用户,因为最低必需属性(UID 和密码)来自 NIS、LDAP 或 AD。
hostname:configuration users> directory NISorLDAPorAD-username hostname:configuration users>
如果指定 local、data 或 nologin 作为用户类型,系统会提示您设置属性。
hostname:configuration users> local username hostname:configuration users username (uncommitted)>
hostname:configuration users username (uncommitted)> get Properties: logname = username type = local uid = (unset) fullname = (unset) initial_password = (unset) require_annotation = false
对于 local、data 和 nologin 类型,需要用户 ID。如果您未显式设置 uid,则自动分配 uid。有关设置 uid 值的帮助,请参见管理用户属性中的“用户属性”。
对于 local 和 data 类型,必须设置 initial_password。
此时将列出新用户。
默认情况下,类型为 local 或 directory 的用户具有 basic 角色。
configuration roles 中列出的角色可供选择。
hostname:configuration users username> set roles=basic,additional_role roles = basic,additional_role (uncommitted)
hostname:configuration users username> exceptions
使用 Tab 补齐功能查看可能的过滤器值列表。
请注意,这些授权还可用于排除在某个角色中授予此用户的授权。如果您分配的授权与在某个角色中授予的相同授权相比,具有更有限的(更窄过滤)范围,则此用户将只具有更有限范围的授权。
要创建与现有用户类型相同且分配了相同角色和授权的新用户,请使用 clone 命令。在 configuration users 中,输入 clone existing-user-name new-user-name。设置新用户的 fullname。如果正在克隆的用户类型为 local 或 data,则设置密码。