具有可变基本 DN 的 PAM 和 LDAP

具有可变基本 DN 的 PAM 和 LDAP

我有一个计算机网络,它们使用 LDAP 进行用户身份验证(免费 IPA v1.2)。我为 Web 门户的外部用户使用相同的 LDAP 服务器,但使用不同的 DN 子树。我刚刚添加了一个新的第三方 Web 应用程序,它使用 PAM 来验证用户身份,因此我添加了

auth      required       pam_ldap.so
account   required       pam_ldap.so

/etc/pam.d/new_webappPAM 配置文件。问题是,这使用/etc/ldap.conf看起来可以验证来自系统基本 DN(即可以使用用户名/密码 ssh 登录的用户),但我希望它使用不同的基本 DN:与网络门户用户。我曾希望/etc/pam_ldap.conf这能帮我解决这个问题,但没有成功。如果我能做类似的事情,那就太好了:

auth      required       pam_ldap.so conf /etc/ldap_web.conf

或者

auth      required       pam_ldap.so base "cn=accounts, cn=webportal, dc=example, dc=com"

我正在寻找有关如何解决此问题的建议。我能想到的唯一其他方法是编译一个pam_ldap.so查看替代配置文件的替代方案。

提前感谢关于此问题的任何反馈。

伊恩

这是我尝试使用以下用户登录时遇到的异常仅有的在网络门户 (web i/f) 上:

Apr 29 02:22:31 portal rserver[7341]: ERROR pam_authenticate failed: User not known to the 
underlying authentication module; LOGGED FROM: int server::pam_auth::
<unnamed>::PAMAuth::login(const std::string&, const std::string&)
/root/rstudio/src/cpp/server/ServerPAMAuth.cpp:201

当我尝试使用以下用户登录时出现此错误拥有系统账户:

Apr 29 02:22:48 portal rserver[7342]: ERROR pam_authenticate failed: Module is unknown;
LOGGED FROM: int server::pam_auth::<unnamed>::PAMAuth::login(const std::string&
const std::string&) /root/rstudio/src/cpp/server/ServerPAMAuth.cpp:201

答案1

您可以完全按照要求进行操作。使用:

auth        required       pam_ldap.so config=/etc/ldap_web.conf

查看手册页了解更多详情。

相关内容