LDAPMODIFY(1) | User Commands | LDAPMODIFY(1) |
ldapmodify, ldapadd - ldap entry addition and modification tools
ldapmodify [-a] [-c] [-r] [-n] [-v] [-F] [-b] [-A] [-q]
[-H] [-?] [-E] [-J] [-Z] [-M] [-d debuglevel]
[-D bindDN] [-j filename] [-J [:criticality]]
[-B baseDN] [-V version] [-Y proxyDN] [-O hopLimit]
[-i locale] [-k path] [-e errorFile] [-P path]
[-N certificate] [-w passwd] [-o attributename=value]
[-h ldaphost] [-W password] [-p ldapport] [-f file]
[-l nb-ldap-connections]
ldapadd [-c] [-n] [-v] [-F]
[ [-b] [-A] [-q] [-H] [-?] [-E] [-J] [-Z] [-M]-d debuglevel]
[-D bindDN] [-j filename] [-B baseDN] [-V version]
[-Y proxyDN] [-O hopLimit] [-i locale] [-k path]
[-e errorFile] [-P path] [-N certificate] [-w passwd]
[-o attributename=value] [-h ldaphost] [-W password]
[-p ldapport] [-f file] [-l nb-ldap-connections]
The ldapmodify utility opens a connection to an LDAP server, binds and modifies or adds entries. The entry information is read from standard input or from file, specified using the -f option. The ldapadd utility is implemented as a hard link to the ldapmodify tool. When invoked as ldapadd, the -a (add new entry) option is turned on automatically.
Both ldapadd and ldapmodify reject duplicate attribute-name/value pairs for the same entry.
The following options are supported:
-a
-A
-b
-B baseDN
-c
-D bindDN
-d debuglevel
1
2
4
32
128
To request more than one category of debugging information, add the masks. For example, to request trace and filter information, specify a debuglevel of 33.
-e errorFile
-E
-F
-f file
-?
-H
-h ldaphost
-i locale
-j filename
-J [:criticality[:value|::b64value|b64value|:fileurl]]
-k path
-l nb-ldap-connections
-M
-n
-N certificate
-o attributename=value
The different attribute names and their values are as follows:
secProp="number"
realm="value"
authzid="value"
authid="value"
mech="value"
-O hopLimit
-p ldapport
-P path
-P /home/uid/.netscape/cert7.db
When using the command on the same host as the directory server, you can use the server's own certificate database. For example:
-P installDir/lapd-serverID/alias/cert7.db
Use the -P option alone to specify server authentication only.
-r
-v
-V version
-W password
-w passwd
-Y proxyid
-Z
The following exit values are returned:
0
Non-zero
The format of the content of file (or standard input if no -f option is specified) is illustrated in the following examples.
Example 1 Modifying an Entry
The file /tmp/entrymods contains the following modification instructions:
dn: cn=Modify Me, o=XYZ, c=US
changetype: modify
replace: mail
mail: modme@atlanta.example.com
-
add: title
title: System Manager
-
add: jpegPhoto
jpegPhoto:< file:///tmp/modme.jpeg
-
delete: description
-
The command:
example% ldapmodify -r -f /tmp/entrymods
modifies the Modify Me entry as follows:
Example 2 Creating a New Entry
The file, /tmp/newentry, contains the following information for creating a new entry:
dn: cn=Ann Jones, o=XYZ, c=US
objectClass: person
cn: Ann Jones
cn: Annie Jones
sn: Jones
title: Director of Research and Development
mail: ajones@londonrd.example.com
uid: ajones
The command
example% ldapadd -f /tmp/newentry
adds a new entry for Ann Jones, using the information in the file.
Example 3 Creating a New Entry on an IPv6 Server
The file, /tmp/newentry, contains the following information for creating a new entry: on an IPv6 server.
dn: cn=Ann Jones, o=XYZ, c=US
objectClass: person
cn: Ann Jones
cn: Annie Jones
sn: Jones
title: Director of Research and Development
mail: ajones@londonrd.example.com
uid: ajones
The command
example% ldapadd -c -v -h '['fec0::111:a00:20ff:feaa:a364']':389 \
-D cn=Directory Manager -w secret \
-f /tmp/entry
adds a new entry for Directory Manager, using the information in the file.
Example 4 Deleting an Entry
The file, /tmp/badentry, contains the following information about an entry to be deleted:
dn: cn=Ann Jones, o=XYZ, c=US
changetype: delete
The command:
example% ldapmodify -f /tmp/badentry
removes Ann Jones' entry.
See attributes(7) for a description of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Stability Level | Evolving |
ldap(1), ldapdelete(1), ldaplist(1), ldapmodrdn(1), ldapsearch(1), ldap_get_option(3LDAP), ldap_set_option(3LDAP), attributes(7), ldap_cachemgr(8), ldapaddent(8)
November 22, 2021 | OmniOS |