]> git.sur5r.net Git - openldap/blob - doc/man/man1/ldapmodify.1
e90049e59a15ba9a841504ce8ec64822fe44404d
[openldap] / doc / man / man1 / ldapmodify.1
1 .TH LDAPMODIFY 1 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2002 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 \-c ]
13 [\c
14 .BI \-S \ file\fR]
15 .[\c
16 .BR \-C ]
17 [\c
18 .BR \-n ]
19 [\c
20 .BR \-v ]
21 [\c
22 .BR \-k ]
23 [\c
24 .BR \-K ]
25 [\c
26 .BR \-M[M] ]
27 [\c
28 .BI \-d \ debuglevel\fR]
29 [\c
30 .BI \-D \ binddn\fR]
31 [\c
32 .BR \-W ]
33 [\c
34 .BI \-w \ passwd\fR]
35 [\c
36 .BI \-y \ passwdfile\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 \ authcid\fR]
53 [\c
54 .BI \-R \ realm\fR]
55 [\c
56 .BR \-x ]
57 [\c
58 .BI \-X \ authzid\fR]
59 [\c
60 .BI \-Y \ mech\fR]
61 [\c
62 .BR \-Z[Z] ]
63 [\c
64 .BI \-f \ file\fR]
65 .LP
66 .B ldapadd
67 [\c
68 .BR \-c ]
69 [\c
70 .BI \-S \ file\fR]
71 [\c
72 .BR \-C ]
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 \-y \ passwdfile\fR]
93 [\c
94 .BI \-h \ ldaphost\fR]
95 [\c
96 .BI \-p \ ldapport\fR]
97 [\c
98 .BI \-P \ 2\fR\||\|\fI3\fR]
99 [\c
100 .BR \-O \ security-properties ]
101 [\c
102 .BR \-I ]
103 [\c
104 .BR \-Q ]
105 [\c
106 .BI \-U \ authcid\fR]
107 [\c
108 .BI \-R \ realm\fR]
109 [\c
110 .BR \-x ]
111 [\c
112 .BI \-X \ authzid\fR]
113 [\c
114 .BI \-Y \ mech\fR]
115 [\c
116 .BR \-Z[Z] ]
117 [\c
118 .BI \-f \ file\fR]
119 .SH DESCRIPTION
120 .B ldapmodify
121 is a shell-accessible interface to the
122 .BR ldap_modify (3)
123 and
124 .BR ldap_add (3)
125 library calls.
126 .B ldapadd
127 is implemented as a hard link to the ldapmodify tool.  When invoked as
128 .B ldapadd
129 the -a (add new entry) flag is turned on automatically.
130 .LP
131 .B ldapmodify
132 opens a connection to an LDAP server, binds, and modifies or adds entries.
133 The entry information is read from standard input or from \fIfile\fP through
134 the use of the -f option.
135 .SH OPTIONS
136 .TP
137 .B \-a
138 Add new entries.  The default for
139 .B ldapmodify
140 is to modify existing entries.  If invoked as
141 .BR ldapadd ,
142 this flag is always set.
143 .TP
144 .B \-C
145 Automatically chase referrals.
146 .TP
147 .B \-c
148 Continuous operation mode.  Errors are reported, but
149 .B ldapmodify
150 will continue with modifications.  The default is to exit after
151 reporting an error.
152 .TP
153 .BI \-S \ file
154 Add or change records which where skipped due to an error are written to \fIfile\fP 
155 and the error message returned by the server is added as a comment. Most useful in 
156 conjunction with -c.
157 .TP
158 .B \-n
159 Show what would be done, but don't actually modify entries.  Useful for
160 debugging in conjunction with -v.
161 .TP
162 .B \-v
163 Use verbose mode, with many diagnostics written to standard output.
164 .TP
165 .B \-k
166 Use Kerberos IV authentication instead of simple authentication.  It is
167 assumed that you already have a valid ticket granting ticket.  You must
168 compile with Kerberos support for this option to have any effect.
169 .TP
170 .B \-K
171 Same as \-k, but only does step 1 of the Kerberos IV bind.  This is useful
172 when connecting to a slapd and there is no x500dsa.hostname principal
173 registered with your Kerberos Domain Controller(s).
174 .TP
175 .B \-F
176 Force application of all changes regardless of the contents of input
177 lines that begin with
178 .I replica:
179 (by default, replica: lines are compared against the LDAP server host
180 and port in use to decide if a replog record should actually be applied).
181 .TP
182 .B \-M[M]
183 Enable manage DSA IT control.
184 .B \-MM
185 makes control critical.
186 .TP
187 .BI \-d \ debuglevel
188 Set the LDAP debugging level to \fIdebuglevel\fP.
189 .B ldapmodify
190 must be compiled with LDAP_DEBUG defined for this option to have any effect.
191 .TP
192 .BI \-f \ file
193 Read the entry modification information from \fIfile\fP instead of from
194 standard input.
195 .TP
196 .B \-x 
197 Use simple authentication instead of SASL.
198 .TP
199 .BI \-D \ binddn
200 Use the Distinguished Name \fIbinddn\fP to bind to the LDAP directory.
201 .TP
202 .B \-W
203 Prompt for simple authentication.
204 This is used instead of specifying the password on the command line.
205 .TP
206 .BI \-w \ passwd
207 Use \fIpasswd\fP as the password for simple authentication.
208 .TP
209 .BI \-y \ passwdfile
210 Use complete contents of \fIpasswdfile\fP as the password for
211 simple authentication.
212 .TP
213 .BI \-H \ ldapuri
214 Specify URI(s) referring to the ldap server(s).
215 .TP
216 .BI \-h \ ldaphost
217 Specify an alternate host on which the ldap server is running.
218 Deprecated in favor of -H.
219 .TP
220 .BI \-p \ ldapport
221 Specify an alternate TCP port where the ldap server is listening.
222 Deprecated in favor of -H.
223 .TP
224 .BI \-P \ 2\fR\||\|\fI3
225 Specify the LDAP protocol version to use.
226 .TP
227 .BI \-O \ security-properties
228 Specify SASL security properties.
229 .TP
230 .B \-I
231 Enable SASL Interactive mode.  Always prompt.  Default is to prompt
232 only as needed.
233 .TP
234 .B \-Q
235 Enable SASL Quiet mode.  Never prompt.
236 .TP
237 .BI \-U \ authcid
238 Specify the authentication ID for SASL bind. The form of the ID
239 depends on the actual SASL mechanism used.
240 .TP
241 .BI \-R \ realm
242 Specify the realm of authentication ID for SASL bind. The form of the realm
243 depends on the actual SASL mechanism used.
244 .TP
245 .BI \-X \ authzid
246 Specify the requested authorization ID for SASL bind.
247 .I authzid
248 must be one of the following formats:
249 .B dn:\c
250 .I <distinguished name>
251 or
252 .B u:\c
253 .I <username>
254 .TP
255 .BI \-Y \ mech
256 Specify the SASL mechanism to be used for authentication. If it's not
257 specified, the program will choose the best mechanism the server knows.
258 .TP
259 .B \-Z[Z]
260 Issue StartTLS (Transport Layer Security) extended operation. If you use
261 .B \-ZZ\c
262 , the command will require the operation to be successful.
263 .SH INPUT FORMAT
264 The contents of \fIfile\fP (or standard input if no \-f flag is given on
265 the command line) should conform to the format defined in
266 .BR slapd.replog (5),
267 with the exceptions noted below.
268 .LP
269 Lines that begin with "replica:" are matched against the LDAP server host
270 and port in use to decide if a particular replog record should be applied.
271 Any other lines that precede the "dn:" line are ignored.
272 The -F flag can be used to force
273 .I ldapmodify
274 to apply all of the replog changes, regardless of the presence or
275 absence of any "replica:" lines.
276 .LP
277 If no "changetype:" line is present, the default is "add" if the -a
278 flag is set (or if the program was invoked as
279 .I ldapmodify)
280 and "modify" otherwise.
281 .LP
282 If changetype is "modify" and no "add:", "replace:", or "delete:" lines
283 appear, the default is "replace" for and "add"
284 .BR ldapmodify (1)
285 for
286 .BR ldapadd (1).
287 .LP
288 Note that the above exceptions to the
289 .BR slapd.replog (5)
290 format allow
291 .BR ldif (5)
292 entries to be used as input to
293 .I ldapmodify
294 or
295 .I ldapadd.
296 .SH EXAMPLES
297 Assuming that the file
298 .B /tmp/entrymods
299 exists and has the contents:
300 .LP
301 .nf
302     dn: cn=Modify Me,dc=example,dc=com
303     changetype: modify
304     replace: mail
305     mail: modme@OpenLDAP.org
306     -
307     add: title
308     title: Grand Poobah
309     -
310     add: jpegPhoto
311     jpegPhoto:< file://tmp/modme.jpeg
312     -
313     delete: description
314     -
315 .fi
316 .LP
317 the command:
318 .LP
319 .nf
320     ldapmodify -f /tmp/entrymods
321 .fi
322 .LP
323 will replace the contents of the "Modify Me" entry's
324 .I mail
325 attribute with the value "modme@example.com", add a
326 .I title
327 of "Grand Poobah", and the contents of the file "/tmp/modme.jpeg"
328 as a
329 .IR jpegPhoto ,
330 and completely remove the
331 .I description
332 attribute.
333 .LP
334 Assuming that the file
335 .B /tmp/newentry
336 exists and has the contents:
337 .LP
338 .nf
339     dn: cn=Barbara Jensen,dc=example,dc=com
340     objectClass: person
341     cn: Barbara Jensen
342     cn: Babs Jensen
343     sn: Jensen
344     title: the world's most famous mythical manager
345     mail: bjensen@example.com
346     uid: bjensen
347 .LP
348 the command:
349 .LP
350 .nf
351     ldapadd -f /tmp/entrymods
352 .fi
353 .LP
354 will add a new entry for Babs Jensen, using the values from the
355 file
356 .B /tmp/newentry.
357 .LP
358 Assuming that the file
359 .B /tmp/newentry
360 exists and has the contents:
361 .LP
362 .nf
363     dn: cn=Barbara Jensen,dc=example,dc=com
364     changetype: delete
365 .LP
366 the command:
367 .LP
368 .nf
369     ldapmodify -f /tmp/entrymods
370 .fi
371 .LP
372 will remove Babs Jensen's entry.
373 .SH DIAGNOSTICS
374 Exit status is zero if no errors occur.  Errors result in a non-zero
375 exit status and a diagnostic message being written to standard error.
376 .SH "SEE ALSO"
377 .BR ldapadd (1),
378 .BR ldapdelete (1),
379 .BR ldapmodrdn (1),
380 .BR ldapsearch (1),
381 .BR ldap.conf (5),
382 .BR ldap (3),
383 .BR ldap_add (3),
384 .BR ldap_delete (3),
385 .BR ldap_modify (3),
386 .BR ldap_modrdn (3),
387 .BR slapd.replog (5)
388 .SH AUTHOR
389 The OpenLDAP Project <http://www.openldap.org/>
390 .SH ACKNOWLEDGEMENTS
391 .B      OpenLDAP
392 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
393 .B      OpenLDAP
394 is derived from University of Michigan LDAP 3.3 Release.