Go to main content

手册页部分 8:系统管理命令

退出打印视图

更新时间: 2022年7月27日 星期三
 
 

userdel(8)

名称

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"(用户管理)配置文件才能删除用户。

选项

支持以下选项:

–q qualifier

用于限定要删除哪些属性的主机或 netgroup 的名称。需要前缀 @ 来指示限定符是 netgroup 名称。仅当在 LDAP 名称服务中维护用户帐户时,–q 选项才有效。仅删除与限定符关联的属性。帐户和其他属性不受影响,除非省略此选项。在这种情况下,还将删除所有限定属性。

–r

从系统中删除用户的起始目录。该目录必须存在。成功执行此命令后,将无法再访问起始目录下的文件和目录。将删除为用户的起始目录所创建的 ZFS 数据集。将删除为用户添加的 auto_home 条目。

–S repository

The repository specifies which name service will be updated.有效的系统信息库包括 filesldap。缺省的系统信息库为 files。When the repository is ldap, both the LDAP server and client must be configured with enableShadowUpdate.See ldapclient(8) for details.

操作数

支持下列操作数:

login

要删除的现有登录名。

退出状态

将返回以下退出值:

0

成功完成。

2

无效的命令语法。将显示 userdel 命令的用法消息。

6

要删除的帐户不存在。

8

要删除的帐户正在使用中。

10

无法更新 /etc/group/etc/user_attr 文件,但登录项已从 /etc/passwd 文件中删除。

12

无法删除或修改起始目录。

文件

/etc/passwd

系统口令文件

/etc/shadow

包含用户的加密口令和相关信息的系统文件

/etc/group

包含组定义的系统文件

/etc/user_attr

包含附加用户属性的系统文件

属性

有关下列属性的说明,请参见 attributes(7)

属性类型
属性值
可用性
system/core-os

另请参见

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.