wheel和staff分组

时间:2021-02-07 01:35:13

1.只有属于wheel组的用户才可以用su登录为root

2. 具体设置步骤如下:

1)修改 /etc/pam.d/su 文件,找到“#auth required /lib/security/$ISA/pam_wheel.so use_uid ”这

一行,将行首的“#”去掉。

2)修改 /etc/login.defs 文件,在最后一行增加“SU_WHEEL_ONLY yes”语句。

然后,用“usermod -G wheel 用户名”将一个用户添加到wheel组中。

3.如果想删除用户

有几种方法:

临时关闭:在/etc/shadow文件中属于改用户行的第二个字段前面加上*就行,想恢复。就去掉*号

或者用如下命令关闭用户帐号:

passwd carlton -l

释放:

passwd carlton -u

永久性删除用户账号

userdel carlton

groupdel carlton

3.下面是英文介绍

The wheel group is used to control those people that can su to the root user (though this is made irrelevant by the sudo command).

All of
the users on your system will be in the staff group, so by changing
group ownership of files to staff the group permissions will apply to
all users. All of the administrators on your system will be in the wheel
group, so by changing group ownership of the files to wheel group
permissions will apply to all of the administrators, global permissions
will apply to any other users.

My advice is that, except for
files that you have created, you leave the group ownership and
permissions alone. Unix is very particular about file ownership and
permissions in certain areas and changing them only leads to trouble.

个人见解:wheel是一个特殊的可以使用su 切换到root 的用户组,而staff是所有普通用户的集合