A.5. Adding Entries

There are two ways to add entries using LDAP client tools:
  • ldapadd
  • ldapmodify -a
Both ldapmodify -a and ldapadd are exactly the same; the only difference is that with ldapmodify, the -a option explicitly states that it is an add operation. With ldapadd, the -a option is implied.
The example using ldamodify -a is given in Section 3.2.4.1, “Adding Entries Using ldapmodify”. To add entries using ldapadd, use the same options and format as ldamodify -a:
ldapadd -D "cn=directory manager" -w secret -p 389 -h server.example.com -x -f new.ldif


ldapadd -D "cn=directory manager" -w secret -p 389 -h server.example.com -x

dn: uid=jsmith,ou=people,dc=example,dc=com
objectclass: inetOrgPerson
objectclass: person
objectclass: top
uid: jsmith
sn: Smith
givenname: John
mail: jsmith@example.com
cn: John Smith