CentOS 7,本地终端用户登录报错:Login Incorrect,但SSH可正常登录。

查看Log:

May 25 15:20:42 centos login: PAM unable to dlopen(/lib/security/pam_limits.so): /lib/security/pam_limits.so: cannot open shared object file: No such file or directory

May 25 15:20:42 centos login: PAM adding faulty module: /lib/security/pam_limits.so

May 25 15:20:45 centos unix_chkpwd[2707]: password check failed for user (root)

May 25 15:20:45 centos login: pam_unix(login:auth): authentication failure; logname=LOGIN uid=0 euid=0 tty=tty2 ruser= rhost=  user=root

May 25 15:20:45 centos login: pam_succeed_if(login:auth): requirement "uid >= 1000" not met by user "root"

May 25 15:20:47 centos login: FAILED LOGIN 1 FROM tty2 FOR root, Authentication failure

确认:/lib/security/pam_limits.so

结果:-bash: cd: /lib/security: No such file or directory

正确文件:/lib64/security/pam_limits.so


问题原因:链接库路径错误


解决方法:修正/etc/pam.d/login文件

将session required /lib/security/pam_limits.so

修正为session required /lib64/security/pam_limits.so