RHEL 6.1字符界面无法登录SSH却能登录
1.具体版本:
2.具体现象:
每次输入用户名密码登录之后又跳到这个界面。但是用ssh却可以登录。
3.查看日志
[root@localhost ~]# tail -f /var/log/secure Feb 6 09:21:13 localhost login: PAM adding faulty module: /lib/security/pam_limits.so Feb 6 09:21:16 localhost login: pam_unix(login:session): session opened for user oracle by LOGIN(uid=0) Feb 6 09:21:16 localhost login: Module is unknown Feb 6 09:34:25 localhost login: pam_unix(login:session): session opened for user root by LOGIN(uid=0) Feb 6 09:34:25 localhost login: ROOT LOGIN ON tty1 Feb 6 09:39:27 localhost login: pam_unix(login:session): session closed for user root Feb 6 09:40:30 localhost 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 Feb 6 09:40:30 localhost login: PAM adding faulty module: /lib/security/pam_limits.so Feb 6 09:40:32 localhost login: pam_unix(login:session): session opened for user root by LOGIN(uid=0) Feb 6 09:40:32 localhost login: Module is unknown
找不到目录/lib/security/pam_limits.so
百度了一下在64位机器下应该是/lib64/security/pam_limits.so,于是修改/etc/pam.d/login
4.修改/etc/pam.d/login,修改之后
[root@localhost ~]# cat /etc/pam.d/login #%PAM-1.0 auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so auth include system-auth account required pam_nologin.so account include system-auth password include system-auth # pam_selinux.so close should be the first session rule session required pam_selinux.so close session required pam_loginuid.so session optional pam_console.so # pam_selinux.so open should only be followed by sessions to be executed in the user context #session required /lib/security/pam_limits.so session required /lib64/security/pam_limits.so session required pam_selinux.so open session required pam_namespace.so session optional pam_keyinit.so force revoke session include system-auth -session optional pam_ck_connector.so
5.修改之后重新登录