我想更改我的新LDAP服务器的设置,只允许服务器的用户读取条目,而不是匿名的。目前,我的olcAccess如下所示:
olcAccess: {0} to attrs=userPassword,shadowLastChange by self write by anonymous auth by dn="cn=admin,dc=example,dc=com" write by * none
olcAccess: {1} to * by self write by dn="cn=admin,dc=example,dc=com" write by * read我试图像这样改变它:
olcAccess: {0}to attrs=userPassword,shadowLastChange by self write by anonymous auth by dn="cn=admin,dc=example,dc=com" write by * none
olcAccess: {1} to * by self write by dn="cn=admin,dc=exampme,dc=com" write by users read但这让我根本无法进入。有人能帮我吗?
谢谢
更新:这是userxxx提到的更改之后读取的日志。
Sep 30 10:47:21 j16354 slapd[11805]: conn=1437 fd=28 ACCEPT from IP=87.149.169.6:64121 (IP=0.0.0.0:389)
Sep 30 10:47:21 j16354 slapd[11805]: conn=1437 op=0 do_bind: invalid dn (pbrechler)
Sep 30 10:47:21 j16354 slapd[11805]: conn=1437 op=0 RESULT tag=97 err=34 text=invalid DN
Sep 30 10:47:21 j16354 slapd[11805]: conn=1437 op=1 UNBIND
Sep 30 10:47:21 j16354 slapd[11805]: conn=1437 fd=28 closed
Sep 30 10:47:21 j16354 slapd[11805]: conn=1438 fd=28 ACCEPT from IP=87.149.169.6:64122 (IP=0.0.0.0:389)
Sep 30 10:47:21 j16354 slapd[11805]: conn=1438 op=0 do_bind: invalid dn (pbrechler)
Sep 30 10:47:21 j16354 slapd[11805]: conn=1438 op=0 RESULT tag=97 err=34 text=invalid DN
Sep 30 10:47:21 j16354 slapd[11805]: conn=1438 op=1 UNBIND
Sep 30 10:47:21 j16354 slapd[11805]: conn=1438 fd=28 closedpbrechler应该是一个有效的用户,但是没有系统用户(我们不需要),admin也不工作
发布于 2011-09-29 20:01:49
olcAccess:{0}到attrs=userPassword,shadowLastChange用匿名方式写dn="cn=admin,dc=example,dc=com“,由* none olcAccess:{1}to attrs=uid,uidNumber,gidNumber by dn="cn=admin,dc=example,dc=com”写,由* read olcAccess:{2}to *由cn=admin写成,由匿名用户写
olc{1} ... by * read可能是by * auth,这取决于pam_ldap的配置以及客户机机器(而不是用户)如何进行身份验证。
编辑为响应:
有效的dns看起来像uid=username,ou=users,dc=sub,dc=domain,dc=tld。
username不是一个有效的dn语法,而且从来都不是。
olcAccess无法改变这一点。
( SASL /olcAuthzRegexp可以做各种有趣的事情,但是没有提供足够的细节来知道系统是否使用SASL。)
如果这台机器只使用ldap进行对话,您可以将它限制在本地主机(或者套接字,也就是ldapi,如果客户端软件支持它)。dn命名规则仍然适用。
另外,如果dn="cn=admin,dc=example,dc=com“被定义为数据库的根,则不需要在数据库的olcAccess中列出它。dn始终具有对数据库中的所有write的写访问权。
发布于 2011-09-29 14:56:46
试试这个:
access to attrs=userPassword,shadowLastChange
by self write
by anonymous auth
by dn="cn=admin,dc=example,dc=com" write
by users read
by * none
access to *
by self write
by dn="cn=admin,dc=example,dc=com" write
by * read但是您可能会考虑两个安全风险:第一个是access to attrs=userPassword,shadowLastChange by users read,这意味着用户可以读取影子密码并使用工具破解。第二个是access to * by self write,因此用户可以将uidNumber和/或gidNumber更改为根。
因此,我建议以下ACL:
access to attrs=userPassword,shadowLastChange
by self write
by anonymous auth
by dn="cn=admin,dc=example,dc=com" write
by users none
access to *
by dn="cn=admin,dc=example,dc=com" write
by * readhttps://serverfault.com/questions/316838
复制相似问题