userdel, roledel - delete a user or role login account from the system
userdel [-r] [-S repository] [-q qualifier] username
userdel -S ldap [-q qualifier] default@
roledel [-r] [-S repository] [-q qualifier] rolename
The userdel or roledel utility deletes a user (or role) account from the local files or specified name-service repository and optionally removes the account home directory from the file system.
对于使用 –S ldap 创建的帐户,可以通过使用特殊值 default@ 作为登录名来删除限定或未限定用户属性的缺省值。
管理员必须具有 "User Management"(用户管理)配置文件才能删除用户。
支持以下选项:
用于限定要删除哪些属性的主机或 netgroup 的名称。需要前缀 @ 来指示限定符是 netgroup 名称。仅当在 LDAP 名称服务中维护用户帐户时,–q 选项才有效。仅删除与限定符关联的属性。帐户和其他属性不受影响,除非省略此选项。在这种情况下,还将删除所有限定属性。
从系统中删除用户的起始目录。该目录必须存在。成功执行此命令后,将无法再访问起始目录下的文件和目录。将删除为用户的起始目录所创建的 ZFS 数据集。将删除为用户添加的 auto_home 条目。
The repository specifies which name service will be updated.有效的系统信息库包括 files 和 ldap。缺省的系统信息库为 files。When the repository is ldap, both the LDAP server and client must be configured with enableShadowUpdate.See ldapclient(8) for details.
支持下列操作数:
要删除的现有登录名。
将返回以下退出值:
成功完成。
无效的命令语法。将显示 userdel 命令的用法消息。
要删除的帐户不存在。
要删除的帐户正在使用中。
无法更新 /etc/group 或 /etc/user_attr 文件,但登录项已从 /etc/passwd 文件中删除。
无法删除或修改起始目录。
系统口令文件
包含用户的加密口令和相关信息的系统文件
包含组定义的系统文件
包含附加用户属性的系统文件
有关下列属性的说明,请参见 attributes(7):
|
auths(1), passwd(1), profiles(1), roles(1), passwd(5), prof_attr(5), shadow(5), user_attr(5), attributes(7), rbac(7), groupadd(8), groupdel(8), groupmod(8), logins(8), roleadd(8), rolemod(8), useradd(8), usermod(8)
Managing User Accounts and User Environments in Oracle Solaris 11.4
Working With Oracle Solaris 11.4 Directory and Naming Services: LDAP
These utilities delete an account definition that is in the group, passwd, shadow, and user_attr databases in the files or ldap repository.