入门

在一次处理su切换的问的时候出现一个问题,

[cheng1@localhost ~]$ su cheng2
密码:
su: 鉴定故障
[cheng1@localhost ~]$

试过很多次, 也是这样, 还找了很多文章, 那些哥们说的基本都是加sudo, 当然, 没效果。

后来查着查着发现su有一个wheel组和/etc/pam.d/su, 呃...

先看一下/etc/pam.d/su长什么样子

[root@localhost home]# cat -n /etc/pam.d/su
1 #%PAM-1.0
2 auth sufficient pam_rootok.so
3 # Uncomment the following line to implicitly trust users in the "wheel" group.
4 auth sufficient pam_wheel.so trust use_uid
5 # Uncomment the following line to require a user to be in the "wheel" group.
6 #auth required pam_wheel.so use_uid
7 auth substack system-auth
8 auth include postlogin
9 account sufficient pam_succeed_if.so uid = 0 use_uid quiet
10 account include system-auth
11 password include system-auth
12 session include system-auth
13 session include postlogin
14 session optional pam_xauth.so
[root@localhost home]#

第四行, 这家伙搞的鬼

下面引入Jan哥的一篇文章(非原创):Linux 中的 wheel 组和 staff 组

看了这个一切都明白了

就是服务器限制了su使用权限, 没办法, 也不能直接取消这个配置, 那么就直接把需要su的账号扔进wheel组里面

[root@localhost home]# usermod -G wheel cheng1
[root@localhost home]#

是G不是g, G是追加一个组, 而g是直接修改组, 区别很大

然后就一步达成了

[cheng1@localhost ~]$ su cheng2
[cheng2@localhost cheng1]$

区别出来了

[root@localhost home]# id cheng1 && id cheng2
uid=1002(cheng1) gid=1002(cheng1) 组=1002(cheng1),10(wheel)
uid=1003(cheng2) gid=1003(cheng2) 组=1003(cheng2)

初涉wheel 组的更多相关文章

  1. Linux 中的 wheel 组和 staff 组

    wheel 组的概念 wheel 组的概念继承自 UNIX.当服务器需要进行一些日常系统管理员无法执行的高级维护时,往往就要用到 root 权限:而“wheel” 组就是一个包含这些特殊权限的用户池: ...

  2. 检查是否使用PAM认证模块禁止wheel组之外的用户su为root

    编辑su文件(vi /etc/pam.d/su),在开头添加下面两行: auth sufficient pam_rootok.so 和 auth required pam_wheel.so group ...

  3. Linux中的Wheel组的作用

    原文:http://www.360doc.com/content/11/0505/10/4644186_114496525.shtml Linux中的Wheel组的作用(用自己的话翻译的) (原文) ...

  4. linux wheel组

    wheel 组的概念 wheel 组的概念继承自 UNIX.当服务器需要进行一些日常系统管理员无法执行的高级维护时,往往就要用到 root 权限:而“wheel” 组就是一个包含这些特殊权限的用户池: ...

  5. Linux/Unix 中 wheel 组的来源

    使用过 Linux/Unix 的朋友应该知道,将用户添加都 wheel用户组,让用户可以通过在命令在前加 sudo 临时获取 root 用户的权限.但是有没有朋友会想知道为何这个用户组要交 wheel ...

  6. 只允许wheel组到用户才能使用 su命令

    su只是切换到root用户, 不改变当前目录: su - 切换到root和改变目录到/root 修改用户到组: usermod gpasswd wheel组相当于windows的 Administra ...

  7. Mac 用户组:staff、 wheel、admin 的区别

    所有的用户都属于 staff 组, 只有具有管理员性质的用户位于 wheel 组中. wheel 是一个特殊的用户组,该组的用户可以使用 su 切换到 root,而 staff 组是所有普通用户的集合 ...

  8. wheel和staff分组

    1.只有属于wheel组的用户才可以用su登录为root 2. 具体设置步骤如下: 1)修改 /etc/pam.d/su 文件,找到"#auth required /lib/security ...

  9. linux中的staff和wheel

    linux中的staff和wheel wheel组就类似于一个管理员的组通常在UNIX下,即使我们是系统的管理员,也不推荐用root用户登录来进行系统管理.一般情况下 用普通用户登录,在需要root权 ...

随机推荐

  1. yii 1.x 添加 rules 验证url数组

    public function rules() { return CMap::mergeArray( parent::rules(),array( array('third_link', 'urlAr ...

  2. 出现errSecInternalComponent

    出现errSecInternalComponent Xcode签名机制(code signing mechanism) 的 bug, Xcode 中账号多了,就会产生很多过期的描述文件,Xcode 没 ...

  3. 技术Leader相关文章和思考

    参考文章: 你与优秀的技术Leader之间只差这一个“图谱” 如何成为优秀的技术主管?你要做到这三点

  4. UIPullRefreshFlash模块demo示例

    UIPullRefreshFlash 模块概述:UIPullRefreshFlash模块对引擎新推出的下拉刷新接口进行了一层封装,app可以通过此模块来实现带炫酷动画效果的下拉刷新功能.使用此模块,在 ...

  5. NLog的介绍使用

    https://www.cnblogs.com/zhangchengye/p/6297685.html

  6. @CreatedDate、@CreatedBy、@LastModifiedDate、@LastModifiedBy

    在spring jpa audit 中,在字段或者方法上使用注解@CreatedDate.@CreatedBy.@LastModifiedDate.@LastModifiedBy,当进行实体插入或者更 ...

  7. python 选课系统

    couser.py: import sys,osBASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))sys.pa ...

  8. MongoDB3.2新特性之文档验证

    官方参考: https://docs.mongodb.org/master/core/document-validation/ 文档验证是3.2的重要新特性,添加验证条件的情形无非两种,一是在创建集合 ...

  9. MySQL根据出生日期计算年龄

    以前使用mysql不是很多,对mysql的函数也不是很熟悉,遇到这个问题第一时间百度搜索,搜索到这两种方法,这两种方法是排在百度第一条的博客. 方法一 SELECT DATE_FORMAT(FROM_ ...

  10. 【Linux】Jenkins安装(一)

    摘要 本章介绍Jenkins的简单使用,关于Jenkins的安装,参照[Linux]Jenkins安装(一) 事例说明:在linux环境下,安装的jenkins,集成svn,tomcat的环境,项目是 ...