我有一个django应用程序,用户应该可以根据系统的影子数据库登录.据我所知,我发现this登录后端使用了python-pam.安装前者使登录工作在我的本地机器(Arch linux)上,它不在我想运行应用程序的服务器上(Debian Squeeze).
问题是,我不知道如何挖掘错误.身份验证只返回false,我找不到系统上PAM库的任何日志文件.你会从哪里开始挖掘?
更新:我发现pam使用/var/log/auth.log.尝试登录时出现以下内容. (oli是我的用户名):
Jan 4 15:09:13 pc13620 python: pam_tally(login:auth): unknown option: pam_faildelay.so
Jan 4 15:09:13 pc13620 python: pam_tally(login:auth): unknown option: delay=3000000
Jan 4 15:09:13 pc13620 python: pam_tally(login:auth): Error opening /var/log/faillog for update
Jan 4 15:09:13 pc13620 unix_chkpwd[8070]: check pass; user unknown
Jan 4 15:09:13 pc13620 unix_chkpwd[8070]: password check failed for user (oli)
Jan 4 15:09:13 pc13620 python: pam_unix(login:auth): authentication failure; logname= uid=33 euid=33 tty= ruser= rhost= user=oli
Jan 4 15:09:13 pc13620 unix_chkpwd[8071]: check pass; user unknown
Jan 4 15:09:13 pc13620 unix_chkpwd[8071]: password check failed for user (oli)
解决方法:
我通过从debian backports安装libpam-unix2并将以下行插入/etc/pam.d/login来解决它:
session required pam_unix2.so
auth required pam_unix2.so nullok
account required pam_unix2.so