使用slapd.conf,您可以全局禁用匿名绑定,并要求使用以下静态指令进行身份validation:
disallow bind_anon require authc
我怎样才能达到相同的全局设置,但使用新的cn =configuration实时configuration方法?
不是Quanta的ACL是坏事,而是回答你的问题:
的ldapmodify
dn:cn = config
changetype:修改
添加:olcDisallows
olcDisallows:bind_anon
–dn:olcDatabase = { – 1}前端,cn = config
changetype:修改
添加:olcRequires
olcRequires:authc
请注意,ldapmodify对(尾随)空格敏感,所以直接复制粘贴将不起作用(并且可能无法正确validation您的身份)。 此外,您使用的DN将需要写入访问cn =configuration数据库。
SysadminTalk上的LDAP安全提示可以解决同一主题上的变化,我尝试了一下
概要:
1)创build一个文件,我们将其称为disable_anon_frontend.ldif
,内容如下:
dn: olcDatabase={-1}frontend,cn=config add: olcRequires olcRequires: authc
2)用以下内容创build另一个名为disable_anon_backend.ldif
文件:
dn: olcDatabase={1}hdb,cn=config add: olcRequires olcRequires: authc
3)然后在服务器上,通过发出以下命令来修改LDAP:
sudo ldapmodify -Q -Y EXTERNAL -H ldapi:/// -f disable_anon_frontend.ldif sudo ldapmodify -Q -Y EXTERNAL -H ldapi:/// -f disable_anon_backend.ldif
4)通过执行以下匿名查询来检查: ldapsearch -x -LLL -H ldap:/// -b dc=example,dc=domain,dc=com dn
(根据需要使用dc=...
设置)。
如果您看到下面的错误消息,则匿名访问已成功禁用:
Server is unwilling to perform (53) Additional information: authentication required
祝你好运!
我没有testing,但尝试这样的事情:
dn: olcDatabase={1}hdb,cn=config add: olcAccess olcAccess: to attrs=userPassword by dn="cn=admin,dc=example,dc=com" write by self write by * none olcAccess: to dn.base="" by users read by * none olcAccess: to * by dn="cn=admin,dc=example,dc=com" write by * none