recursionldapldif

ldapdelete: invalid option -- 'r'


I have a problem in the execution of the recursive ldapdelete -r command, when I connect to an ldap virtual machine that I have as root and execute the command ldapdelete -r -h ip -p 389 -D "cn=admin,o=ms,c=fr" -w Ap201 -f /tmp/ldapContextes >> $reportFile 2>> $errorFile, it deletes all the entries in the ldap but if I connect with another bousr user and launch the same command I get the following error : ldapdelete: invalid option -- 'r'

I have thought that it is a problem of permissions for the boeusr user but when entering the binaries I have seen that ldapdelete has execution permissions for root, group and other users which means that boeusr has execution permissions but I don't understand why I get the message of mistake. anyone have any idea?

Thank you.


Solution

  • There is no -r option in ldapdelete, you can't recursively delete entries in ldap with this command.

    You have to specify each dn you want to remove one by one, and in the correct order (ie. you can't remove an entry which contains children).

    Check the solution I provided to the same kind of question here : How to remove all records from LDAP?