PAM设置与pam_ldap

我正在运行Ubuntu 10.10并尝试使用pam_ldap设置pam。

该指南在http://wiki.debian.org/LDAP/PAM中说:

In order to globally enable LDAP authentication through PAM, configure /etc/pam_ldap.conf accordingly and edit the /etc/pam.d/common-* files so that they contain something like this: /etc/pam.d/common-account: account required pam_unix.so account sufficient pam_succeed_if.so uid < 1000 quiet account [default=bad success=ok user_unknown=ignore] pam_ldap.so account required pam_permit.so 

现在,以这个文件为例,我看到:

 # here are the per-package modules (the "Primary" block) account [success=2 new_authtok_reqd=done default=ignore] pam_unix.so account [success=1 default=ignore] pam_ldap.so # here's the fallback if no module succeeds account requisite pam_deny.so 

我的问题是,我是否删除了当前在该文件中的内容,将它们replace为指南中的内容 – 或者将指南中的内容附加到文件末尾?

您复制的第二个文件应该已经允许通过LDAP进行访问。

第一个规则将尝试通过标准的unix机制(passwd / shadow)进行身份validation。 如果失败,则调用第二条规则,并尝试使用pam_ldap进行身份validation。 如果失败,login被拒绝。

在一个侧面说明,在实施PAM时,不要忘记逐步testing。

确保您可以通过ldapsearch进行search,以validation您的/ etc / pam_ldap和/或/ etc / nss_ldapconfiguration是否正确。

同时确保getent passwd / getent组返回Unix和Ldap帐户,以validation您的/etc/nsswitch.confconfiguration是否正确。