第 15 章 禁用匿名绑定

如果用户尝试连接 Directory 服务器而不提供任何凭证,则此操作被称为 anonymous bind。匿名绑定简化了搜索和读取操作,如在目录中查找电话号码,而无需用户首先进行身份验证。但是,匿名绑定也可能会造成安全隐患,因为没有帐户的用户可以访问数据。

警告

默认情况下,在 Directory 服务器中启用了匿名绑定来搜索和读取操作。这允许未授权访问用户条目以及配置条目,如根目录服务器条目(DSE)。

15.1. 使用命令行禁用匿名绑定

要提高安全性,您可以禁用匿名绑定。

流程

  • nsslapd-allow-anonymous-access 配置参数设置为 off

    # dsconf -D "cn=Directory Manager" ldap://server.example.com config replace nsslapd-allow-anonymous-access=off

验证

  • 运行搜索但不指定用户帐户:

    # ldapsearch -H ldap://server.example.com -b "dc=example,dc=com" -x
    ldap_bind: Inappropriate authentication (48)
    	additional info: Anonymous access is not allowed