必须在 nsswitch.conf 中添加哪些内容才能显示 AD 用户和组?

必须在 nsswitch.conf 中添加哪些内容才能显示 AD 用户和组?

这是后续这个问题

我有一台 CentOS 7 机器,它加入了域 FOOBAR。可以通过以下方式成功获取存储在 AD 中的用户信息

id [email protected]

但是,getent passwd并且getent group不显示 AD 中定义的用户和组。

这些是以下相关行/etc/nsswitch.conf

passwd:     files sss
shadow:     files sss
group:      files sss

那里需要添加什么?

答案1

正如 @Doug O'Neal 在评论中所建议的,有必要设置

enumerate = true

/etc/sssd/sssd.conf

现在getent passwd显示getent groupAD 中定义的所有用户和组。

请注意,通常不推荐此选项。从man sssd.conf

(...)
    enumerate (bool)
       Determines if a domain can be enumerated. This parameter can have one of the
       following values:

       TRUE = Users and groups are enumerated

       FALSE = No enumerations for this domain

       Default: FALSE

       Note: Enabling enumeration has a moderate performance impact on SSSD while enumeration
       is running. It may take up to several minutes after SSSD startup to fully complete 
       enumerations. During this time, individual requests for information will go directly
       to LDAP, though it may be slow, due to the heavy enumeration processing. Saving a large 
       number of entries to cache after the enumeration completes might also be CPU intensive
       as the memberships have to be recomputed.

       While the first enumeration is running, requests for the complete user or group lists
       may return no results until it completes.

       Further, enabling enumeration may increase the time necessary to detect network
       disconnection, as longer timeouts are required to ensure that enumeration
       lookups are completed successfully. For more information, refer to the man pages for 
       the specific id_provider in use.

       For the reasons cited above, enabling enumeration is not recommended, especially in 
       large environments.
(...)

相关内容