入门

在一次处理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. EF Core 小坑:DbContextPool 会引起数据库连接池连接耗尽

    DbContextPool 是 ASP.NET Core 2.1 引入的新特性,可以节省创建 DbContext 实例的开销,但没有想到其中藏着一个小坑. 最近有一个 ASP.NET Core 项目持 ...

  2. JAVA基础积累

    1.ajax同步和异步的区别: 同步是指一个线程要等待上一个线程执行完才能开始执行,同步可以看做是一个单线程操作,只要客户端请求了,在服务器没有反馈信息之前是一个线程阻塞状态.异步是一个线程在执行中, ...

  3. Idea使用说明

    快捷键 ctrl + alt + b : 查找接口的实现类 ctrl + h : 查找类或接口的继承关系 double shift : 搜索任何地方 ctrl + shift + n : 查找文件 c ...

  4. 通过Ajax方式上传文件(input file),使用FormData进行Ajax请求

    <script type="text/jscript"> $(function () { $("#btn_uploadimg").click(fun ...

  5. 微信小程序样式旋转

    相关文档:http://www.w3school.com.cn/cssref/pr_transform.asp index.wxss文件 注意:如果是web前端,要注意浏览器的兼容性 .x1{ wid ...

  6. 循环结构 : while .. for

    # ###循环结构 : while .. for ''' while 循环 可以提高代码的效率,减少代码的冗余 while 条件表达式: code1 code2 如果条件表达式成立,返回True , ...

  7. 【LeetCode每天一题】Minimum Path Sum(最短路径和)

    Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which ...

  8. git----------如何安装gitlab,使用步骤。

    1.配置yum源        vim /etc/yum.repos.d/gitlab-ce.repo 2.复制以下内容到打开的文件中: [gitlab-ce]     name=Gitlab CE ...

  9. JavaScript 对象部署 Iterator 接口

    const name = { first:"hello", last:"world", fullname: "hello world" } ...

  10. JavaScript命名规范基础及系统注意事项

    前端代码中的自定义变量命名           命名方法:     1.驼峰 2.下划线连接           对于文件名,我们一般采用小写字母+下划线的形式     为什么?因为在window下a ...