Active Directory 和 linux nslcd 绑定而不扩展 AD 架构

Active directory and linux nslcd binding without extending the AD schema

我需要将 linux 客户端绑定到 Windows Server 2012 Active Directory。我有一个测试环境,我在其中成功地使用 samba-winbind-kerberos 和 nslcd,使用用户进行身份验证。然而,当使用 samba-winbind-kerberos 时,我能够在不扩展 AD 架构以包含 UNIX 属性(UID/GID、主目录、shell)的情况下实现这一点,因为 smb.conf 有一个idmap 选项,指定起始范围

idmap config *:range = 11000-20000

这将处理 UID/GID AD 用户的 unix 映射。

如果我不在 AD 中启用 UNIX 属性,我会在 nslcd 调试日志中收到一条错误消息,上面写着

uidNumber: missing

有没有什么方法可以在 nslcd/libnss_ldap 中使用相同的功能,这样我就不必在 Windows 服务器 2012 上扩展 AD 架构?我不喜欢在生产环境中使用 samba,因为它存在远程代码执行漏洞。

目前无法进行此操作。根据他们的文档,nslcd 没有可用的 id 映射,这需要您的 AD 架构扩展为具有 unix 属性。

使用 CentOS Linux 版本 7.4.1708(核心)和 nslcd 版本 0.8.13 针对 Windows 2016 AD,没有任何架构扩展,我能够配置它并使其在今天正常工作.

我主要关注 Serverfault 文章“LDAP authentication on CentOS 7”,不得不在 /etc/nslcd.conf 部分 Alternative mappings for Active Directoryreplace the SIDs in the objectSid mappings with the value for your domain 中使用。

至“Get SID by its objectSid using ldapsearch" I've used the linked script

其他映射设置为

filter passwd (&(objectClass=user)(objectClass=person)(!(objectClass=computer)))
map    passwd uid           sAMAccountName
map    passwd uidNumber     objectSid:<yourValue>
map    passwd gidNumber     primaryGroupID
map    passwd homeDirectory "/home/$sAMAccountName"
map    passwd gecos         displayName
map    passwd loginShell    "/bin/bash"
map     group gidNumber      primaryGroupID