LinuxCommandLibrary

ldapadd

adds entries to an LDAP directory

TLDR

Add entry from LDIF file

$ ldapadd -x -D "[cn=admin,dc=example,dc=com]" -W -f [entry.ldif]
copy
Add with simple bind
$ ldapadd -x -H ldap://[server] -D "[binddn]" -w "[password]" -f [file.ldif]
copy
Add using SASL
$ ldapadd -Y EXTERNAL -H ldapi:/// -f [file.ldif]
copy
Verbose output
$ ldapadd -v -x -D "[binddn]" -W -f [file.ldif]
copy
Dry run
$ ldapadd -n -x -D "[binddn]" -W -f [file.ldif]
copy

SYNOPSIS

ldapadd [options] [-f file]

DESCRIPTION

ldapadd adds entries to an LDAP directory. It reads LDIF (LDAP Data Interchange Format) files containing new entries to add to the directory.
ldapadd is equivalent to ldapmodify -a. It connects to the LDAP server, binds with credentials, and adds the specified entries.

PARAMETERS

-x

Simple authentication.
-D binddn
Bind DN.
-W
Prompt for password.
-w password
Password (insecure).
-H URI
LDAP server URI.
-f file
LDIF file.
-c
Continue on errors.
-n
Dry run (no changes).
-v
Verbose output.
-Y mechanism
SASL mechanism.

LDIF EXAMPLE

$ dn: uid=jdoe,ou=users,dc=example,dc=com
objectClass: inetOrgPerson
uid: jdoe
cn: John Doe
sn: Doe
mail: jdoe@example.com
copy

CAVEATS

Requires appropriate permissions. LDIF syntax must be correct. Parent entries must exist. Use -W instead of -w for security.

HISTORY

ldapadd is part of OpenLDAP, a free implementation of LDAP. OpenLDAP was started by Kurt Zeilenga in 1998 as a continuation of the University of Michigan LDAP project.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community