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