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]
82 .BI \-d \ debuglevel\fR]
90 .BI \-h \ ldaphost\fR]
92 .BI \-p \ ldapport\fR]
94 .BI \-P \ 2\fR\||\|\fI3\fR]
100 .BI \-U \ username\fR]
102 .BI \-X \ authzid\fR]
111 is a shell-accessible interface to the
117 is implemented as a hard link to the ldapmodify tool. When invoked as
119 the -a (add new entry) flag is turned on automatically.
122 opens a connection to an LDAP server, binds, and modifies or adds entries.
123 The entry information is read from standard input or from \fIfile\fP through
124 the use of the -f option.
128 Add new entries. The default for
130 is to modify existing entries. If invoked as
132 this flag is always set.
135 Assume that any values that start with a `/' are binary values and that
136 the actual value is in a file whose path is specified in the place where
137 values normally appear.
140 Automatically chase referrals.
143 Continuous operation mode. Errors are reported, but
145 will continue with modifications. The default is to exit after
149 Replace existing values by default.
152 Show what would be done, but don't actually modify entries. Useful for
153 debugging in conjunction with -v.
156 Use verbose mode, with many diagnostics written to standard output.
159 Use Kerberos authentication instead of simple authentication. It is
160 assumed that you already have a valid ticket granting ticket. You must
161 compile with KERBEROS defined for this option to have any effect.
164 Same as \-k, but only does step 1 of the kerberos bind. This is useful
165 when connecting to a slapd and there is no x500dsa.hostname principal
166 registered with your kerberos servers.
169 Force application of all changes regardless of the contents of input
170 lines that begin with
172 (by default, replica: lines are compared against the LDAP server host
173 and port in use to decide if a replog record should actually be applied).
176 Enable manage DSA IT control.
178 makes control critical.
181 Set the LDAP debugging level to \fIdebuglevel\fP.
183 must be compiled with LDAP_DEBUG defined for this option to have any effect.
186 Read the entry modification information from \fIfile\fP instead of from
190 Use simple authentication instead of SASL.
193 Use the Distinguished Name \fIbinddn\fP to bind to the LDAP directory.
196 Prompt for simple authentication.
197 This is used instead of specifying the password on the command line.
200 Use \fIpasswd\fP as the password for simple authentication.
203 Specify URI(s) referring to the ldap server(s).
206 Specify an alternate host on which the ldap server is running.
207 Deprecated in favor of -H.
210 Specify an alternate TCP port where the ldap server is listening.
211 Deprecated in favor of -H.
213 .BI \-P \ 2\fR\||\|\fI3
214 Specify the LDAP protocol version to use.
216 .BI \-O \ security-properties
217 Specify SASL security properties.
220 Enable SASL Interactive mode. Always prompt. Default is to prompt
224 Enable SASL Quiet mode. Never prompt.
227 Specify the username for SASL bind. The syntax of the username depends on the
228 actual SASL mechanism used.
231 Specify the requested authorization ID for SASL bind.
233 must be one of the following formats:
235 .I <distinguished name>
241 Specify the SASL mechanism to be used for authentication. If it's not
242 specified, the program will choose the best mechanism the server knows.
245 Issue StartTLS (Transport Layer Security) extended operation. If you use
247 , the command will require the operation to be successful.
249 The contents of \fIfile\fP (or standard input if no \-f flag is given on
250 the command line) should conform to the format defined in
251 .BR slapd.replog (5),
252 with the exceptions noted below.
254 If the first line of a record consists of a decimal number (entry id),
257 Lines that begin with "replica:" are matched against the LDAP server host
258 and port in use to decide if a particular replog record should be applied.
259 Any other lines that precede the "dn:" line are ignored.
260 The -F flag can be used to force
262 to apply all of the replog changes, regardless of the presence or
263 absence of any "replica:" lines.
265 If no "changetype:" line is present, the default is "add" if the -a
266 flag is set (or if the program was invoked as
268 and "modify" otherwise.
270 If changetype is "modify" and no "add:", "replace:", or "delete:" lines
271 appear, the default is "replace" if the -r flag is set and "add"
274 Note that the above exceptions to the
278 entries to be used as input to
282 .SH ALTERNATIVE INPUT FORMAT
283 An alternative input format is supported for compatibility with older
286 This format consists of one or more entries separated by blank lines,
287 where each entry looks like:
290 Distinguished Name (DN)
295 where \fIattr\fP is the name of the attribute and \fIvalue\fP is the
298 By default, values are added. If the
301 given, the default is to replace existing values with the new one.
302 Note that it is permissible for a given attribute to appear more than
303 once (for example, to add more than one value for an attribute). Also
304 note that you can use a trailing `\\' to continue values across lines and
305 preserve newlines in the value itself (this is useful for modifying
306 QUIPU iattr attributes among others).
309 should be preceded by a \fB-\fP to remove a value. The `=' and
310 value should be omitted to remove an entire attribute.
313 should be preceded by a \fB+\fP to add a value in the presence of the
317 Assuming that the file
319 exists and has the contents:
322 dn: cn=Modify Me, dc=example, dc=com
325 mail: modme@OpenLDAP.org
331 jpegPhoto:< file://tmp/modme.jpeg
340 ldapmodify -b -r -f /tmp/entrymods
343 will replace the contents of the "Modify Me" entry's
345 attribute with the value "modme@example.com", add a
347 of "Grand Poobah", and the contents of the file "/tmp/modme.jpeg"
350 and completely remove the
353 The same modifications as above can be performed using the older
358 cn=Modify Me, dc=example, dc=com
359 mail=modme@example.com
361 +jpegPhoto=/tmp/modme.jpeg
368 ldapmodify -b -r -f /tmp/entrymods
371 Assuming that the file
373 exists and has the contents:
376 dn: cn=Barbara Jensen, dc=example, dc=com
381 title: the world's most famous mythical manager
382 mail: bjensen@example.com
388 ldapadd -f /tmp/entrymods
391 will add a new entry for Babs Jensen, using the values from the
395 Assuming that the file
397 exists and has the contents:
400 dn: cn=Barbara Jensen, dc=example, dc=com
406 ldapmodify -f /tmp/entrymods
409 will remove Babs Jensen's entry.
411 Exit status is zero if no errors occur. Errors result in a non-zero
412 exit status and a diagnostic message being written to standard error.
426 There is no interactive mode, but there probably should be.
428 The OpenLDAP Project <http://www.openldap.org/>
431 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
433 is derived from University of Michigan LDAP 3.3 Release.