报错如下:
原因:su 的PAM配置文件中有auth required pam_wheel.so use_uid根据上一句的说明可以知道要使用su命令则该用户必须在wheel用户组中,而我的普通用户没有在wheel用户组中。有两种方法可以解决这个问题,一是注释该行,二是将普通用户加入wheel组。[[email protected]]$ su root
Password:
su: Permission denied
解决方法:
编辑:/etc/pam.d/su 文件,将“auth required pam_wheel.so use_uid” 这行注释掉。(对比了一下原版系统这条默认是注释的)
[yyc@Test-H-Centos8 pam.d]$ cat su
#%PAM-1.0
auth required pam_env.so
auth sufficient pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth sufficient pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
#auth required pam_wheel.so use_uid
auth substack system-auth
auth include postlogin
account sufficient pam_succeed_if.so uid = 0 use_uid quiet
account include system-auth
password include system-auth
session include system-auth
session include postlogin
session optional pam_xauth.so
文章评论 本文章有个评论