在Apache中,仅对通过以下两项测试的用户提供访问权限的最佳方式是:
我已经进行了第二次测试,但现在我需要禁止一些有效的LDAP用户。请注意,我无法创建一个AD组来表示我的黑/白名单。
答案 0 :(得分:0)
我已设法使用
配置看起来像是:
<Location /blacklisted >
AuthType Basic
AuthName "PAM"
AuthBasicProvider ldap
Require valid-user
AuthLDAPURL ldap://ldap.example.com/?sAMAccountName?sub
AuthzLDAPAuthoritative off
AuthLDAPBindDN bindUser@example.com
AuthLDAPBindPassword verySecurePasswd
Order allow,deny
Deny from 192.168.1
Allow from all
</Location>
但是,如果我想将LDAP用户名而不是IP地址列入黑名单,我仍然不知道这是否可行。 (Covener似乎暗示一些复杂的配置可以做到,但我还没有尝试过。)