尝试安装 PAM 模块(我的第一个模块)后,我遇到了这个问题。我最终将其删除,因为模块损坏,导致用户无法访问系统。现在的情况是,即使删除它,我也无法访问它。
我该如何解决 PAM 的这个故障?
May 2 08:39:28 host sshd[14687]: Received disconnect from 00.000.00.000: 11:
May 2 08:39:56 host sshd[14798]: PAM unable to dlopen(/lib64/security/pam_sepermit.so#015): /lib64/security/pam_sepermit.so#015: cannot open shared object file: No such file or directory
May 2 08:39:56 host sshd[14798]: PAM adding faulty module: /lib64/security/pam_sepermit.so#015
May 2 08:39:56 host sshd[14798]: PAM _pam_load_conf_file: unable to open /etc/pam.d/password-auth#015
May 2 08:39:56 host sshd[14798]: PAM unable to dlopen(/lib64/security/pam_nologin.so#015): /lib64/security/pam_nologin.so#015: cannot open shared object file: No such file or directory
May 2 08:39:56 host sshd[14798]: PAM adding faulty module: /lib64/security/pam_nologin.so#015
May 2 08:39:56 host sshd[14798]: PAM _pam_load_conf_file: unable to open /etc/pam.d/password-auth#015
May 2 08:39:56 host sshd[14798]: PAM _pam_load_conf_file: unable to open /etc/pam.d/password-auth#015
May 2 08:39:56 host sshd[14798]: PAM unable to dlopen(/lib64/security/pam_loginuid.so#015): /lib64/security/pam_loginuid.so#015: cannot open shared object file: No such file or directory
May 2 08:39:56 host sshd[14798]: PAM adding faulty module: /lib64/security/pam_loginuid.so#015
May 2 08:39:56 host sshd[14798]: PAM unable to dlopen(/lib64/security/pam_namespace.so#015): /lib64/security/pam_namespace.so#015: cannot open shared object file: No such file or directory
May 2 08:39:56 host sshd[14798]: PAM adding faulty module: /lib64/security/pam_namespace.so#015
May 2 08:39:56 host sshd[14798]: PAM _pam_load_conf_file: unable to open /etc/pam.d/password-auth#015
May 2 08:39:56 host sshd[14798]: Failed password for root from 00.000.00.000 port 55835 ssh2
答案1
每个未找到的文件名#015
末尾都有一个。这不正常。由于八进制数015
是回车符 (CR) 的 ASCII 码,所以在我看来,你可能/etc/pam.d
以某种方式编辑了里面的某个文件,使其进入 DOS/Windows 模式(行末为 CRLF,而不是 Linux/Unix 的 LF 行末)。
\015
您需要启动救援模式并从备份中恢复损坏的文件。您也可以使用命令删除角色tr
。