我想更改我的新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 closed
pbrechler应该是一个有效的用户,但没有系统用户(我们不需要它)pipe理员也没有工作
olcAccess:{0} to attrs = userPassword,shadowLastChange由匿名auth通过自写由dn =“cn = admin,dc = example,dc = com”
olcAccess:{1} to attrs = uid,uidNumber,gidNumber by dn =“cn = admin,dc = example,dc = com”write by * read
olcAccess:{2}通过自写dn =“cn = admin,dc = example,dc = com”通过匿名authentication
olc{1} ... by * read可能by * auth取决于pam_ldapconfiguration以及客户端机器(而不是用户)如何/如果自己进行身份validation。
编辑为响应:
有效的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”被定义为数据库的rootdn,则不需要将其列在该数据库的olcAccess中。 一个dn总是可以写入数据库的所有attrs,它是rootdn。
尝试这个:
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
但是您可能会考虑2个安全隐患:第一个是access to attrs=userPassword,shadowLastChange by users read意味着用户可以读取影子密码并使用工具破解。 第二个是access to * by self write ,因此,用户可以将uidNumber和/或gidNumber更改为root。
所以我build议下面的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 * read