Variation on the same theme, I tried it out, works:
LDAP security tips at SysadminTalk
Summary:
1) Create a file, let's call it disable_anon_frontend.ldif
with the following content:
dn: olcDatabase={-1}frontend,cn=config
add: olcRequires
olcRequires: authc
2) Create another file called disable_anon_backend.ldif
with the following content:
dn: olcDatabase={1}hdb,cn=config
add: olcRequires
olcRequires: authc
3) Then on the server, modify the LDAP by issuing the following commands:
sudo ldapmodify -Q -Y EXTERNAL -H ldapi:/// -f disable_anon_frontend.ldif
sudo ldapmodify -Q -Y EXTERNAL -H ldapi:/// -f disable_anon_backend.ldif
4) Check by executing the following anon query: ldapsearch -x -LLL -H ldap:/// -b dc=example,dc=domain,dc=com dn
(use your dc=...
settings as applicable).
If you see the error message below, then anonymous access has been successfully disabled:
Server is unwilling to perform (53)
Additional information: authentication required
Good luck!