新部署天翼云主機(jī),新建普通賬戶zkml,使用root密碼和zkml密碼都可以單獨正常登陸。普通賬戶登錄后su root輸入正確密碼提示如下錯誤:
測試
根據(jù)網(wǎng)絡(luò)查看su和passwd權(quán)限都是正確rws。
最后查詢到有人說需要將普通賬戶添加到wheel組才能使用,在root賬戶下修改
[root@ecs-98b1-0002 ~]# usermod -a -G wheel zkml
[root@ecs-98b1-0002 ~]# id zkml
uid=500(zkml) gid=500(zkml) groups=500(zkml),10(wheel)
gpasswd -d zkml wheel 刪除組中zkml用戶
正常切換
第二種解決方法:
因為安全認(rèn)證PAM原因?qū)е卤仨毷窃趙heel組才能是有su root。如果注銷也可以正常切換
#auth required pam_wheel.so use_uid
vi /etc/pam.d/su
#%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 #主要是此處導(dǎo)致,將此處注銷掉也可以
auth include system-auth
account sufficient pam_succeed_if.so uid = 0 use_uid quiet
account include system-auth
password include system-auth
session include system-auth
session optional pam_xauth.so
安全考慮不建議使用第二章方法