1 .TH LDAPMODIFY 1 "17 August 1999" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-1999 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
6 ldapmodify, ldapadd \- LDAP modify entry and LDAP add entry tools
26 .BI \-d \ debuglevel\fR]
34 .BI \-h \ ldaphost\fR]
36 .BI \-p \ ldapport\fR]
38 .BI \-P \ 2\fR\||\|\fI3\fR]
58 .BI \-d \ debuglevel\fR]
64 .BI \-h \ ldaphost\fR]
66 .BI \-p \ ldapport\fR]
71 is a shell-accessible interface to the
77 is implemented as a hard link to the ldapmodify tool. When invoked as
79 the -a (add new entry) flag is turned on automatically.
82 opens a connection to an LDAP server, binds, and modifies or adds entries.
83 The entry information is read from standard input or from \fIfile\fP through
84 the use of the -f option.
88 Add new entries. The default for
90 is to modify existing entries. If invoked as
92 this flag is always set.
95 Assume that any values that start with a `/' are binary values and that
96 the actual value is in a file whose path is specified in the place where
97 values normally appear.
100 Continuous operation mode. Errors are reported, but
102 will continue with modifications. The default is to exit after
106 Replace existing values by default.
109 Show what would be done, but don't actually modify entries. Useful for
110 debugging in conjunction with -v.
113 Use verbose mode, with many diagnostics written to standard output.
116 Use Kerberos authentication instead of simple authentication. It is
117 assumed that you already have a valid ticket granting ticket. You must
118 compile with KERBEROS defined for this option to have any effect.
121 Same as \-k, but only does step 1 of the kerberos bind. This is useful
122 when connecting to a slapd and there is no x500dsa.hostname principal
123 registered with your kerberos servers.
126 Force application of all changes regardless of the contents of input
127 lines that begin with
129 (by default, replica: lines are compared against the LDAP server host
130 and port in use to decide if a replog record should actually be applied).
133 Enable manage DSA IT control.
135 makes control critical.
138 Set the LDAP debugging level to \fIdebuglevel\fP.
140 must be compiled with LDAP_DEBUG defined for this option to have any effect.
143 Read the entry modification information from \fIfile\fP instead of from
147 Use \fIbinddn\fP to bind to the LDAP directory. \fIbinddn\fP should be
148 a string-represented DN as defined in RFC 1779.
151 Prompt for simple authentication.
152 This is used instead of specifying the password on the command line.
155 Use \fIpasswd\fP as the password for simple authentication.
158 Specify an alternate host on which the ldap server is running.
161 Specify an alternate TCP port where the ldap server is listening.
163 .BI \-P \ 2\fR\||\|\fI3
164 Specify the LDAP protocol version to use.
166 The contents of \fIfile\fP (or standard input if no \-f flag is given on
167 the command line) should conform to the format defined in
168 .BR slapd.replog (5),
169 with the exceptions noted below.
171 If the first line of a record consists of a decimal number (entry id),
174 Lines that begin with "replica:" are matched against the LDAP server host
175 and port in use to decide if a particular replog record should be applied.
176 Any other lines that precede the "dn:" line are ignored.
177 The -F flag can be used to force
179 to apply all of the replog changes, regardless of the presence or
180 absence of any "replica:" lines.
182 If no "changetype:" line is present, the default is "add" if the -a
183 flag is set (or if the program was invoked as
185 and "modify" otherwise.
187 If changetype is "modify" and no "add:", "replace:", or "delete:" lines
188 appear, the default is "replace" if the -r flag is set and "add"
191 Note that the above exceptions to the
195 entries to be used as input to
199 .SH ALTERNATIVE INPUT FORMAT
200 An alternative input format is supported for compatibility with older
203 This format consists of one or more entries separated by blank lines,
204 where each entry looks like:
207 Distinguished Name (DN)
212 where \fIattr\fP is the name of the attribute and \fIvalue\fP is the
215 By default, values are added. If the
218 given, the default is to replace existing values with the new one.
219 Note that it is permissible for a given attribute to appear more than
220 once (for example, to add more than one value for an attribute). Also
221 note that you can use a trailing `\\' to continue values across lines and
222 preserve newlines in the value itself (this is useful for modifying
223 QUIPU iattr attributes among others).
226 should be preceded by a \fB-\fP to remove a value. The `=' and
227 value should be omitted to remove an entire attribute.
230 should be preceded by a \fB+\fP to add a value in the presence of the
234 Assuming that the file
236 exists and has the contents:
239 dn: cn=Modify Me, dc=OpenLDAP, dc=Org
242 mail: modme@OpenLDAP.org
248 jpegPhoto:< file://tmp/modme.jpeg
257 ldapmodify -b -r -f /tmp/entrymods
260 will replace the contents of the "Modify Me" entry's
262 attribute with the value "modme@OpenLDAP.org", add a
264 of "Grand Poobah", and the contents of the file "/tmp/modme.jpeg"
267 and completely remove the
270 The same modifications as above can be performed using the older
275 cn=Modify Me, dc=OpenLDAP, dc=org
276 mail=modme@OpenLDAP.org
278 +jpegPhoto=/tmp/modme.jpeg
285 ldapmodify -b -r -f /tmp/entrymods
288 Assuming that the file
290 exists and has the contents:
293 dn: cn=Barbara Jensen, dc=OpenLDAP, dc=org
298 title: the world's most famous mythical manager
299 mail: bjensen@OpenLDAP.org
305 ldapadd -f /tmp/entrymods
308 will add a new entry for Babs Jensen, using the values from the
312 Assuming that the file
314 exists and has the contents:
317 dn: cn=Barbara Jensen, dc=OpenLDAP, dc=org
323 ldapmodify -f /tmp/entrymods
326 will remove Babs Jensen's entry.
328 Exit status is 0 if no errors occur. Errors result in a non-zero exit
329 status and a diagnostic message being written to standard error.
344 .IR "A String Representation of Distinguished Names",
347 ISODE Consortium, March 1995.
349 There is no interactive mode, but there probably should be.
352 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
354 is derived from University of Michigan LDAP 3.3 Release.