使用 pam_ldap 设置 PAM

使用 pam_ldap 设置 PAM

我正在运行 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

我的问题是,我是否应该删除该文件中当前的内容,并用指南中的内容替换它们 - 或者将指南中的内容附加到文件末尾?

答案1

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

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

附注:在实施 PAM 时,不要忘记逐步进行测试。

确保您可以通过 ldapsearch 搜索以验证您的 /etc/pam_ldap 和/或 /etc/nss_ldap 是否配置正确。

还要确保 getent passwd / getent group 返回 Unix 和 Ldap 帐户,以验证您的 /etc/nsswitch.conf 是否配置正确。

相关内容