Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am following these instructions to install OpenLDAP on Debian 6.0.

The instructions tell me to run slapindex as root, but it sounds like Debian does not like the idea:

Runnig as root!
There's a fair chance slapd will fail to start.
Check file permissions!

Google leads me to a discussion that suggests running slapindex as openldap. I find it strange as slapindex is not in the $PATH of openldap.

Which user should I run slapindex as?
If not root, why is slapindex in /usr/sbin?

share|improve this question
up vote 1 down vote accepted

You sure can use both root and openldap as user running slapindex, but if you do it as root, please don't forget to change the OpenLDAP data directory permissions back to openldap:openldap if you do so. For example,

chown -R openldap:openldap /var/lib/ldap/

Why slapindex is under /usr/sbin, I don't know. Perhaps because it is a very powerful and potentially dangerous tool which should be used those capable of being root, anyway.

share|improve this answer
It's probably in /usr/sbin because it is an administrative tool that requires specific permissions (though not necessarily root, obviously) to run. Displaying it in the hypothetical list of "user" commands, such as with tab completion in bash, would be silly. – Falcon Momot Aug 14 '13 at 7:40

If not root, why is slapindex in /usr/sbin?

According to the FHS (Filesystem Hierarchy Standard) /usr/sbin are used for Non-essential system binaries, e.g., daemons for various network-services.

On CentOS, after executing slapindex as root you should change owner of the index in /var/lib/ldap to the ldap user, which is by default ldap. You could try to use su instead

# su - <ldap_user> -s /bin/bash /usr/sbin/slapindex
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.