解决方法:
1、先检查su命令权限是否正确,执行如下命令
如果现实如图,则说明权限方面没问题,若您的执行结果与我的不一样,需调整权限。ll /etc/pam.d/su
2、执行如下命令将 /etc/pam.d/su中的“session include system-auth”这一行即可,如下。[root@blog-tag-gg ~]# ll /etc/pam.d/su
-rw-r--r-- 1 root root 540 2月 3 2021 /etc/pam.d/su
将su文件复制备份
vi编辑 /etc/pam.d/su 文件将如图所示注释(前面加#表示注释)cp /etc/pam.d/su /etc/pam.d/su_bak
注释后在登录即可正常切换。#%PAM-1.0
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
文章评论 本文章有个评论