]> git.sur5r.net Git - openldap/blob - doc/man/man1/ldapmodify.1
Add sasl-host directive
[openldap] / doc / man / man1 / ldapmodify.1
1 .TH LDAPMODIFY 1 "20 August 2000" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2000 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
5 .SH NAME
6 ldapmodify, ldapadd \- LDAP modify entry and LDAP add entry tools
7 .SH SYNOPSIS
8 .B ldapmodify
9 [\c
10 .BR \-a ]
11 [\c
12 .BR \-b ]
13 [\c
14 .BR \-c ]
15 [\c
16 .BR \-C ]
17 [\c
18 .BR \-r ]
19 [\c
20 .BR \-n ]
21 [\c
22 .BR \-v ]
23 [\c
24 .BR \-k ]
25 [\c
26 .BR \-K ]
27 [\c
28 .BR \-M[M] ]
29 [\c
30 .BI \-d \ debuglevel\fR]
31 [\c
32 .BI \-D \ binddn\fR]
33 [\c
34 .BR \-W ]
35 [\c
36 .BI \-w \ passwd\fR]
37 [\c
38 .BI \-H \ ldapuri\fR]
39 [\c
40 .BI \-h \ ldaphost\fR]
41 [\c
42 .BI \-p \ ldapport\fR]
43 [\c
44 .BI \-P \ 2\fR\||\|\fI3\fR]
45 [\c
46 .BR \-O \ security-properties ]
47 [\c
48 .BR \-I ]
49 [\c
50 .BR \-Q ]
51 [\c
52 .BI \-U \ username\fR]
53 [\c
54 .BR \-x ]
55 [\c
56 .BI \-X \ authzid\fR]
57 [\c
58 .BI \-Y \ mech\fR]
59 [\c
60 .BR \-Z[Z] ]
61 [\c
62 .BI \-f \ file\fR]
63 .LP
64 .B ldapadd
65 [\c
66 .BR \-b ]
67 [\c
68 .BR \-c ]
69 [\c
70 .BR \-C ]
71 [\c
72 .BR \-r ]
73 [\c
74 .BR \-n ]
75 [\c
76 .BR \-v ]
77 [\c
78 .BR \-k ]
79 [\c
80 .BR \-K ]
81 [\c
82 .BR \-M[M] ]
83 [\c
84 .BI \-d \ debuglevel\fR]
85 [\c
86 .BI \-D \ binddn\fR]
87 [\c
88 .BR \-W ]
89 [\c
90 .BI \-w \ passwd\fR]
91 [\c
92 .BI \-h \ ldaphost\fR]
93 [\c
94 .BI \-p \ ldapport\fR]
95 [\c
96 .BI \-P \ 2\fR\||\|\fI3\fR]
97 [\c
98 .BR \-E[E] ]
99 [\c
100 .BR \-I[I] ]
101 [\c
102 .BI \-U \ username\fR]
103 [\c
104 .BI \-X \ authzid\fR]
105 [\c
106 .BI \-Y \ mech\fR]
107 [\c
108 .BR \-Z[Z] ]
109 [\c
110 .BI \-f \ file\fR]
111 .SH DESCRIPTION
112 .B ldapmodify
113 is a shell-accessible interface to the
114 .BR ldap_modify (3)
115 and
116 .BR ldap_add (3)
117 library calls.
118 .B ldapadd
119 is implemented as a hard link to the ldapmodify tool.  When invoked as
120 .B ldapadd
121 the -a (add new entry) flag is turned on automatically.
122 .LP
123 .B ldapmodify
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.
127 .SH OPTIONS
128 .TP
129 .B \-a
130 Add new entries.  The default for
131 .B ldapmodify
132 is to modify existing entries.  If invoked as
133 .BR ldapadd ,
134 this flag is always set.
135 .TP
136 .B \-b
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.
140 .TP
141 .B \-C
142 Automatically chase referrals.
143 .TP
144 .B \-c
145 Continuous operation mode.  Errors are reported, but
146 .B ldapmodify
147 will continue with modifications.  The default is to exit after
148 reporting an error.
149 .TP
150 .B \-r
151 Replace existing values by default.
152 .TP
153 .B \-n
154 Show what would be done, but don't actually modify entries.  Useful for
155 debugging in conjunction with -v.
156 .TP
157 .B \-v
158 Use verbose mode, with many diagnostics written to standard output.
159 .TP
160 .B \-k
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.
164 .TP
165 .B \-K
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.
169 .TP
170 .B \-F
171 Force application of all changes regardless of the contents of input
172 lines that begin with
173 .I replica:
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).
176 .TP
177 .B \-M[M]
178 Enable manage DSA IT control.
179 .B \-MM
180 makes control critical.
181 .TP
182 .BI \-d \ debuglevel
183 Set the LDAP debugging level to \fIdebuglevel\fP.
184 .B ldapmodify
185 must be compiled with LDAP_DEBUG defined for this option to have any effect.
186 .TP
187 .BI \-f \ file
188 Read the entry modification information from \fIfile\fP instead of from
189 standard input.
190 .TP
191 .B \-x 
192 Use simple authentication instead of SASL.
193 .TP
194 .BI \-D \ binddn
195 Use the Distinguished Name \fIbinddn\fP to bind to the LDAP directory.
196 .TP
197 .B \-W
198 Prompt for simple authentication.
199 This is used instead of specifying the password on the command line.
200 .TP
201 .BI \-w \ passwd
202 Use \fIpasswd\fP as the password for simple authentication.
203 .TP
204 .BI \-H \ ldapuri
205 Specify URI(s) referring to the ldap server(s).
206 .TP
207 .BI \-h \ ldaphost
208 Specify an alternate host on which the ldap server is running.
209 Deprecated in favor of -H.
210 .TP
211 .BI \-p \ ldapport
212 Specify an alternate TCP port where the ldap server is listening.
213 Deprecated in favor of -H.
214 .TP
215 .BI \-P \ 2\fR\||\|\fI3
216 Specify the LDAP protocol version to use.
217 .TP
218 .BI \-O \ security-properties
219 Specify SASL security properties.
220 .TP
221 .B \-I
222 Enable SASL Interactive mode.  Always prompt.  Default is to prompt
223 only as needed.
224 .TP
225 .B \-Q
226 Enable SASL Quiet mode.  Never prompt.
227 .TP
228 .BI \-U \ username
229 Specify the username for SASL bind. The syntax of the username depends on the
230 actual SASL mechanism used.
231 .TP
232 .BI \-X \ authzid
233 Specify the requested authorization ID for SASL bind.
234 .I authzid
235 must be one of the following formats:
236 .B dn:\c
237 .I <distinguished name>
238 or
239 .B u:\c
240 .I <username>
241 .TP
242 .BI \-Y \ mech
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.
245 .TP
246 .B \-Z[Z]
247 Issue StartTLS (Transport Layer Security) extended operation. If you use
248 .B \-ZZ\c
249 , the command will require the operation to be successful.
250 .SH INPUT FORMAT
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.
255 .LP
256 If the first line of a record consists of a decimal number (entry id),
257 it is ignored.
258 .LP
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
263 .I ldapmodify
264 to apply all of the replog changes, regardless of the presence or
265 absence of any "replica:" lines.
266 .LP
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
269 .I ldapmodify)
270 and "modify" otherwise.
271 .LP
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"
274 otherwise.
275 .LP
276 Note that the above exceptions to the
277 .BR slapd.replog (5)
278 format allow
279 .BR ldif (5)
280 entries to be used as input to
281 .I ldapmodify
282 or
283 .I ldapadd.
284 .SH ALTERNATIVE INPUT FORMAT
285 An alternative input format is supported for compatibility with older
286 versions of
287 .I ldapmodify.
288 This format consists of one or more entries separated by blank lines,
289 where each entry looks like:
290 .LP
291 .nf
292     Distinguished Name (DN)
293     attr=value
294     [attr=value ...]
295 .fi
296 .LP
297 where \fIattr\fP is the name of the attribute and \fIvalue\fP is the
298 value.
299 .LP
300 By default, values are added.  If the
301 .RI \- r
302 command line flag is
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).
309 .LP
310 .I attr
311 should be preceded by a \fB-\fP to remove a value.  The `=' and
312 value should be omitted to remove an entire attribute.
313 .LP
314 .I attr
315 should be preceded by a \fB+\fP to add a value in the presence of the
316 \-r flag.
317 .LP
318 .SH EXAMPLES
319 Assuming that the file
320 .B /tmp/entrymods
321 exists and has the contents:
322 .LP
323 .nf
324     dn: cn=Modify Me, dc=example, dc=com
325     changetype: modify
326     replace: mail
327     mail: modme@OpenLDAP.org
328     -
329     add: title
330     title: Grand Poobah
331     -
332     add: jpegPhoto
333     jpegPhoto:< file://tmp/modme.jpeg
334     -
335     delete: description
336     -
337 .fi
338 .LP
339 the command:
340 .LP
341 .nf
342     ldapmodify -b -r -f /tmp/entrymods
343 .fi
344 .LP
345 will replace the contents of the "Modify Me" entry's
346 .I mail
347 attribute with the value "modme@example.com", add a
348 .I title
349 of "Grand Poobah", and the contents of the file "/tmp/modme.jpeg"
350 as a
351 .IR jpegPhoto ,
352 and completely remove the
353 .I description
354 attribute.
355 The same modifications as above can be performed using the older
356 .I ldapmodify
357 input format:
358 .LP
359 .nf
360     cn=Modify Me, dc=example, dc=com
361     mail=modme@example.com
362     +title=Grand Poobah
363     +jpegPhoto=/tmp/modme.jpeg
364     -description
365 .fi
366 .LP
367 and the command:
368 .LP
369 .nf
370     ldapmodify -b -r -f /tmp/entrymods
371 .fi
372 .LP
373 Assuming that the file
374 .B /tmp/newentry
375 exists and has the contents:
376 .LP
377 .nf
378     dn: cn=Barbara Jensen, dc=example, dc=com
379     objectClass: person
380     cn: Barbara Jensen
381     cn: Babs Jensen
382     sn: Jensen
383     title: the world's most famous mythical manager
384     mail: bjensen@example.com
385     uid: bjensen
386 .LP
387 the command:
388 .LP
389 .nf
390     ldapadd -f /tmp/entrymods
391 .fi
392 .LP
393 will add a new entry for Babs Jensen, using the values from the
394 file
395 .B /tmp/newentry.
396 .LP
397 Assuming that the file
398 .B /tmp/newentry
399 exists and has the contents:
400 .LP
401 .nf
402     dn: cn=Barbara Jensen, dc=example, dc=com
403     changetype: delete
404 .LP
405 the command:
406 .LP
407 .nf
408     ldapmodify -f /tmp/entrymods
409 .fi
410 .LP
411 will remove Babs Jensen's entry.
412 .SH DIAGNOSTICS
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.
415 .SH "SEE ALSO"
416 .BR ldapadd (1),
417 .BR ldapdelete (1),
418 .BR ldapmodrdn (1),
419 .BR ldapsearch (1),
420 .BR ldap.conf (5),
421 .BR ldap (3),
422 .BR ldap_add (3),
423 .BR ldap_delete (3),
424 .BR ldap_modify (3),
425 .BR ldap_modrdn (3),
426 .BR slapd.replog (5)
427 .SH BUGS
428 There is no interactive mode, but there probably should be.
429 .SH AUTHOR
430 The OpenLDAP Project <http://www.openldap.org/>
431 .SH ACKNOWLEDGEMENTS
432 .B      OpenLDAP
433 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
434 .B      OpenLDAP
435 is derived from University of Michigan LDAP 3.3 Release.