1 .TH LDAPMODIFY 1 "20 August 2000" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-2000 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
6 ldapmodify, ldapadd \- LDAP modify entry and LDAP add entry tools
30 .BI \-d \ debuglevel\fR]
40 .BI \-h \ ldaphost\fR]
42 .BI \-p \ ldapport\fR]
44 .BI \-P \ 2\fR\||\|\fI3\fR]
46 .BR \-O \ security-properties ]
52 .BI \-U \ username\fR]
84 .BI \-d \ debuglevel\fR]
92 .BI \-h \ ldaphost\fR]
94 .BI \-p \ ldapport\fR]
96 .BI \-P \ 2\fR\||\|\fI3\fR]
102 .BI \-U \ username\fR]
104 .BI \-X \ authzid\fR]
113 is a shell-accessible interface to the
119 is implemented as a hard link to the ldapmodify tool. When invoked as
121 the -a (add new entry) flag is turned on automatically.
124 opens a connection to an LDAP server, binds, and modifies or adds entries.
125 The entry information is read from standard input or from \fIfile\fP through
126 the use of the -f option.
130 Add new entries. The default for
132 is to modify existing entries. If invoked as
134 this flag is always set.
137 Assume that any values that start with a `/' are binary values and that
138 the actual value is in a file whose path is specified in the place where
139 values normally appear.
142 Automatically chase referrals.
145 Continuous operation mode. Errors are reported, but
147 will continue with modifications. The default is to exit after
151 Replace existing values by default.
154 Show what would be done, but don't actually modify entries. Useful for
155 debugging in conjunction with -v.
158 Use verbose mode, with many diagnostics written to standard output.
161 Use Kerberos authentication instead of simple authentication. It is
162 assumed that you already have a valid ticket granting ticket. You must
163 compile with Kerberos support for this option to have any effect.
166 Same as \-k, but only does step 1 of the Kerberos bind. This is useful
167 when connecting to a slapd and there is no x500dsa.hostname principal
168 registered with your Kerberos servers.
171 Force application of all changes regardless of the contents of input
172 lines that begin with
174 (by default, replica: lines are compared against the LDAP server host
175 and port in use to decide if a replog record should actually be applied).
178 Enable manage DSA IT control.
180 makes control critical.
183 Set the LDAP debugging level to \fIdebuglevel\fP.
185 must be compiled with LDAP_DEBUG defined for this option to have any effect.
188 Read the entry modification information from \fIfile\fP instead of from
192 Use simple authentication instead of SASL.
195 Use the Distinguished Name \fIbinddn\fP to bind to the LDAP directory.
198 Prompt for simple authentication.
199 This is used instead of specifying the password on the command line.
202 Use \fIpasswd\fP as the password for simple authentication.
205 Specify URI(s) referring to the ldap server(s).
208 Specify an alternate host on which the ldap server is running.
209 Deprecated in favor of -H.
212 Specify an alternate TCP port where the ldap server is listening.
213 Deprecated in favor of -H.
215 .BI \-P \ 2\fR\||\|\fI3
216 Specify the LDAP protocol version to use.
218 .BI \-O \ security-properties
219 Specify SASL security properties.
222 Enable SASL Interactive mode. Always prompt. Default is to prompt
226 Enable SASL Quiet mode. Never prompt.
229 Specify the username for SASL bind. The syntax of the username depends on the
230 actual SASL mechanism used.
233 Specify the requested authorization ID for SASL bind.
235 must be one of the following formats:
237 .I <distinguished name>
243 Specify the SASL mechanism to be used for authentication. If it's not
244 specified, the program will choose the best mechanism the server knows.
247 Issue StartTLS (Transport Layer Security) extended operation. If you use
249 , the command will require the operation to be successful.
251 The contents of \fIfile\fP (or standard input if no \-f flag is given on
252 the command line) should conform to the format defined in
253 .BR slapd.replog (5),
254 with the exceptions noted below.
256 If the first line of a record consists of a decimal number (entry id),
259 Lines that begin with "replica:" are matched against the LDAP server host
260 and port in use to decide if a particular replog record should be applied.
261 Any other lines that precede the "dn:" line are ignored.
262 The -F flag can be used to force
264 to apply all of the replog changes, regardless of the presence or
265 absence of any "replica:" lines.
267 If no "changetype:" line is present, the default is "add" if the -a
268 flag is set (or if the program was invoked as
270 and "modify" otherwise.
272 If changetype is "modify" and no "add:", "replace:", or "delete:" lines
273 appear, the default is "replace" if the -r flag is set and "add"
276 Note that the above exceptions to the
280 entries to be used as input to
284 .SH ALTERNATIVE INPUT FORMAT
285 An alternative input format is supported for compatibility with older
288 This format consists of one or more entries separated by blank lines,
289 where each entry looks like:
292 Distinguished Name (DN)
297 where \fIattr\fP is the name of the attribute and \fIvalue\fP is the
300 By default, values are added. If the
303 given, the default is to replace existing values with the new one.
304 Note that it is permissible for a given attribute to appear more than
305 once (for example, to add more than one value for an attribute). Also
306 note that you can use a trailing `\\' to continue values across lines and
307 preserve newlines in the value itself (this is useful for modifying
308 QUIPU iattr attributes among others).
311 should be preceded by a \fB-\fP to remove a value. The `=' and
312 value should be omitted to remove an entire attribute.
315 should be preceded by a \fB+\fP to add a value in the presence of the
319 Assuming that the file
321 exists and has the contents:
324 dn: cn=Modify Me, dc=example, dc=com
327 mail: modme@OpenLDAP.org
333 jpegPhoto:< file://tmp/modme.jpeg
342 ldapmodify -b -r -f /tmp/entrymods
345 will replace the contents of the "Modify Me" entry's
347 attribute with the value "modme@example.com", add a
349 of "Grand Poobah", and the contents of the file "/tmp/modme.jpeg"
352 and completely remove the
355 The same modifications as above can be performed using the older
360 cn=Modify Me, dc=example, dc=com
361 mail=modme@example.com
363 +jpegPhoto=/tmp/modme.jpeg
370 ldapmodify -b -r -f /tmp/entrymods
373 Assuming that the file
375 exists and has the contents:
378 dn: cn=Barbara Jensen, dc=example, dc=com
383 title: the world's most famous mythical manager
384 mail: bjensen@example.com
390 ldapadd -f /tmp/entrymods
393 will add a new entry for Babs Jensen, using the values from the
397 Assuming that the file
399 exists and has the contents:
402 dn: cn=Barbara Jensen, dc=example, dc=com
408 ldapmodify -f /tmp/entrymods
411 will remove Babs Jensen's entry.
413 Exit status is zero if no errors occur. Errors result in a non-zero
414 exit status and a diagnostic message being written to standard error.
428 There is no interactive mode, but there probably should be.
430 The OpenLDAP Project <http://www.openldap.org/>
433 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
435 is derived from University of Michigan LDAP 3.3 Release.