Symas OpenLDAP Knowledge Base

Sample ldapadd Command Breakdown

The command:

    ldapadd -x -D "cn=Manager,dc=sample,dc=com" -W -f example.ldif

ldapadd is installed to /usr/local/bin and that should be in your command path ($PATH).

The -x option tells the command to use simple (user and password) authentication instead of SASL. Running from the command line you generally are using simple BIND (authentication).

The -D option tells ldapadd what directory user is trying to add data. The command BINDs (logs in as) that user. Here we are logging in as the “root user” of the directory: “cn=Manager,dc=sample,dc=com”.

The -W option tells ldapadd to prompt us for the password. The -w option lets you put the password right into the command. We recommend keeping the habit of using -W.

The -f option specifies that the LDIF input is coming from a file and provides the file name.