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

linux中wheel组的概念

2015-10-30 22:50 267 查看


                              linux中wheel组的概念

   qianghaohao(孤狼)

                         先来看看维基百科中对wheel组的一段描述:
                               Wheel group:
                                             
Modern Unix systems use user groups to control access privileges. The wheel group is a special user   group 
                           used on some Unix systems to control access to the su command,
which allows a user to masquerade as another 
                           user (usually the super
user).
                     中文翻译过来大体意思就是(翻译水平有限,有问题了请指正-_-):现代Unix系统使用用户组来控制访问特权。wheel组是一个很特殊
                     的用户组,它被一些Unix系统用来控制能否通过su命令来切换到超级用户(root用户)。
                              也就是说在wheel组中的成员有一些特殊的权限,我们可以通过把普通用户加入wheel组,然后配置相关的文件就可以使处在                               wheel 组的成员有特殊权限,而且可以用su命令来切换到root用户。为了加强系统的安全性,我们可以配置一些文件使得非wheel组的
                        成员无法用 su命令切换的root用户。这么做的好处是我们在需要root的权限才能操作时我们直接su切换到root即可,无需再次用root用                         户登陆,同时还能禁止其他非wheel组的成员通过su命令来切换到root用户,这样就加强了系统的安全性。
                               一.那么如何把想要设置的用户加入wheel组?接下来说说如何设置:
                                   vim /etc/group
                                  在wheel组的后面的成员列表里面添加进想要添加的用户名:wheel:x:10:root,qianghaohao        
                                           

 
 
                               
                           二. 接下来说说如何使得非wheel组的用户不能通过su命令切换到root用户:
                                 1. vim /etc/pam.d/su
                                     找到#auth            required        pam_wheel.so use_uid这一行去掉注释。
                                  2.vim /etc/login.defs
                                     在最后以行添加SU_WHEEL_ONLY yes
                                这时再非wheel组的成员用su命令切换到root时提示权限不够,而用wheel组的成员切换没任何问题。
                                       [xiao@localhost
qianghaohao]$ su root

                                        Password: 

                                        su: Permission denied

                            以上是我对linux中wheel组的个人理解,如有更加深入理解,希望多多交流!!!

                                                      
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息