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