10.2. 配置 Directory Server 以复制帐户锁定属性
如果您使用帐户锁定策略或密码策略,它更新 passwordRetryCount、retryCountResetTime 或 accountUnlockTime 属性,请将 Directory 服务器配置为复制这些属性,以便在所有服务器中相同。
在复制拓扑中的所有供应商上执行这个步骤。
先决条件
- 已配置了帐户锁定策略或更新一个或多个上述属性的密码策略。
- 您可以在复制环境中使用目录服务器。
流程
启用密码策略属性的复制:
dsconf -D "cn=Directory Manager" ldap://server.example.com pwpolicy set --pwdisglobal="on"
# dsconf -D "cn=Directory Manager" ldap://server.example.com pwpolicy set --pwdisglobal="on"Copy to Clipboard Copied! Toggle word wrap Toggle overflow 如果使用 fractional replication,显示从复制中排除的属性列表:
dsconf -D "cn=Directory Manager" ldap://server.example.com repl-agmt get --suffix "dc=example,dc=com" example-agreement | grep "nsDS5ReplicatedAttributeList"
# dsconf -D "cn=Directory Manager" ldap://server.example.com repl-agmt get --suffix "dc=example,dc=com" example-agreement | grep "nsDS5ReplicatedAttributeList"Copy to Clipboard Copied! Toggle word wrap Toggle overflow 使用默认设置,不会显示任何输出,Directory 服务器复制帐户锁定属性。但是,如果命令返回排除的属性列表,如以下示例所示,请验证属性列表:
nsDS5ReplicatedAttributeList: (objectclass=*) $ EXCLUDE accountUnlockTime passwordRetryCount retryCountResetTime example1 example2
nsDS5ReplicatedAttributeList: (objectclass=*) $ EXCLUDE accountUnlockTime passwordRetryCount retryCountResetTime example1 example2Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在本例中,
accountUnlockTime,passwordRetryCount, 和retryCountResetTimelockout 策略属性不包括在复制中,以及其他两个属性。如果上一命令的输出列出了任何帐户锁定属性,请将部分复制设置更新为仅包含除 lockout 策略属性以外的属性:
dsconf -D "cn=Directory Manager" ldap://server.example.com repl-agmt set --suffix "dc=example,dc=com" --frac-list "example1 example2" example-agreement
# dsconf -D "cn=Directory Manager" ldap://server.example.com repl-agmt set --suffix "dc=example,dc=com" --frac-list "example1 example2" example-agreementCopy to Clipboard Copied! Toggle word wrap Toggle overflow
验证
尝试以用户身份使用无效密码执行搜索:
ldapsearch -H ldap://server.example.com -D "uid=example,ou=People,dc=example,dc=com" -w "invalid-password" -b "dc=example,dc=com" -x
# ldapsearch -H ldap://server.example.com -D "uid=example,ou=People,dc=example,dc=com" -w "invalid-password" -b "dc=example,dc=com" -x ldap_bind: Invalid credentials (49)Copy to Clipboard Copied! Toggle word wrap Toggle overflow 显示用户的
passwordRetryCount属性:ldapsearch -H ldap://server.example.com -D "cn=Directory Manager" -W -b "uid=example,ou=People,dc=example,dc=com" -x passwordRetryCount
# ldapsearch -H ldap://server.example.com -D "cn=Directory Manager" -W -b "uid=example,ou=People,dc=example,dc=com" -x passwordRetryCount ... dn: uid=example,ou=People,dc=example,dc=com passwordRetryCount: 1Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
在复制拓扑的不同服务器上运行上一命令。如果
passwordRetryCount属性的值相同,Directory 服务器会复制该属性。