您的位置:首页 > 运维架构 > Linux

[linux device driver]Chapter 03:Scull_load中涉及到的群组权限之staff\wheel

2015-03-18 09:37 330 查看
UID。User Identifier (UID) 是用户的数字标识符。

GID。Group Identifier (GID) 与 UID 相似,但是它与组相关联。GID 在 /etc/group 中定义。wheel和staff都是GID的概念。从/etc/group里可以找到wheel或者staff.

wheel 组的概念

  wheel 组的概念继承自 UNIX。当服务器需要进行一些日常系统管理员无法执行的高级维护时,往往就要用到 root 权限;而“wheel” 组就是一个包含这些特殊权限的用户池;也就是说,如果你不是“wheel”组的成员,就无法取得 root 权限进行一些特权的操作;

为什么需要 wheel 组?

  通常在UNIX下,即使我们是系统的管理员,也不推荐用 root 用户登录来进行系统管理。一般情况下用普通用户登录,在需要 root 权限执行一些操作时,再 su 登录成为 root 用户。但是,任何人只要知道了 root 的密码,就都可以通过 su 命令来登录为 root 用户——这无疑为系统带来了安全隐患。所以,将普通用户加入到 wheel 组,被加入的这个普通用户就成了管理员组内的用户,但如果不对一些相关的配置文件进行配置,这个管理员组内的用户与普通用户也没什么区别——就像警察下班后,没有带枪、穿这便衣和普通人(用户)一样,虽然他的的确确是警察。

如何把用户加入 wheel 组?

  前面说了,除了 root 用户,只有 wheel 组的成员有特权执行高级操作,那么怎么把用户提升成为 wheel 用户组成员呢?

  可以使用 vigr 来编辑 /etc/group 文件,将新的用户名追加到 wheel 组的末尾,就像这样:

  wheel::10:root,kc

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 组是所有普通用户的集合
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: