2018-09-25

How to edit openldap dynamic configuration via phpldapadmin

First you need to give your admin account access, usually only the acutual root-user on the system hast this permission.
Prepare the follwing foo.ldif:

dn: olcDatabase={0}config,cn=config
changetype: modify
replace: olcAccess
olcAccess: {0}to * by dn.exact=gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth manage by dn.exact=cn=admin,dc=example,dc=com manage by * break

and execute:

sudo ldapmodify ldapmodify -Y EXTERNAL -H ldapi:/// -f foo.ldif

after that, you need to edit the phpldapadmin config.php:

$servers->setValue('server','base',array('cn=config','dc=example,dc=org'));