美文网首页linux
【sudo】sudo: PAM authentication e

【sudo】sudo: PAM authentication e

作者: Bogon | 来源:发表于2022-05-24 00:06 被阅读0次

是否使用PAM认证模块禁止wheel组之外用户su为root

# vim  /etc/pam.d/su
auth sufficient pam_rootok.so 
auth required pam_wheel.so group=wheel 

这表明只有wheel组的成员可以使用su命令成为root用户。
可以把用户添加到wheel组,以使它可以使用su命令成为root用户。
添加方法为:

# usermod  -G wheel username
$ sudo su - root
sudo: PAM account management error: Module is unknown

解决方法:

 # chattr -i /etc/passwd
 # chattr -i /etc/shadow
 # chattr -i /etc/group
 # chattr -i  /etc/gshadow
 # usermod  -G wheel username
 # ln -s /lib64/security/pam_tally2.so /lib64/security/pam_tally.so

参考

sudo 命令的两个错误解决
https://blog.csdn.net/wojiuwangla/article/details/119112521

无法添加用户,报“useradd: cannot open /etc/passwd”问题解决过程记录 https://www.shuzhiduo.com/A/o75Nk3gXdW/

CentOS 7.7 - sudo: PAM account management error: Permission denied
https://unix.stackexchange.com/questions/609748/centos-7-7-sudo-pam-account-management-error-permission-denied

相关文章

网友评论

    本文标题:【sudo】sudo: PAM authentication e

    本文链接:https://www.haomeiwen.com/subject/dgyrprtx.html