]> git.sur5r.net Git - openldap/blob - doc/man/man1/ldapmodify.1
afdaa0fa093805fcd97867e05b64ee0bddfcaa7d
[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 Lines that begin with "replica:" are matched against the LDAP server host
257 and port in use to decide if a particular replog record should be applied.
258 Any other lines that precede the "dn:" line are ignored.
259 The -F flag can be used to force
260 .I ldapmodify
261 to apply all of the replog changes, regardless of the presence or
262 absence of any "replica:" lines.
263 .LP
264 If no "changetype:" line is present, the default is "add" if the -a
265 flag is set (or if the program was invoked as
266 .I ldapmodify)
267 and "modify" otherwise.
268 .LP
269 If changetype is "modify" and no "add:", "replace:", or "delete:" lines
270 appear, the default is "replace" if the -r flag is set and "add"
271 otherwise.
272 .LP
273 Note that the above exceptions to the
274 .BR slapd.replog (5)
275 format allow
276 .BR ldif (5)
277 entries to be used as input to
278 .I ldapmodify
279 or
280 .I ldapadd.
281 .SH EXAMPLES
282 Assuming that the file
283 .B /tmp/entrymods
284 exists and has the contents:
285 .LP
286 .nf
287     dn: cn=Modify Me, dc=example, dc=com
288     changetype: modify
289     replace: mail
290     mail: modme@OpenLDAP.org
291     -
292     add: title
293     title: Grand Poobah
294     -
295     add: jpegPhoto
296     jpegPhoto:< file://tmp/modme.jpeg
297     -
298     delete: description
299     -
300 .fi
301 .LP
302 the command:
303 .LP
304 .nf
305     ldapmodify -b -r -f /tmp/entrymods
306 .fi
307 .LP
308 will replace the contents of the "Modify Me" entry's
309 .I mail
310 attribute with the value "modme@example.com", add a
311 .I title
312 of "Grand Poobah", and the contents of the file "/tmp/modme.jpeg"
313 as a
314 .IR jpegPhoto ,
315 and completely remove the
316 .I description
317 attribute.
318 .LP
319 Assuming that the file
320 .B /tmp/newentry
321 exists and has the contents:
322 .LP
323 .nf
324     dn: cn=Barbara Jensen, dc=example, dc=com
325     objectClass: person
326     cn: Barbara Jensen
327     cn: Babs Jensen
328     sn: Jensen
329     title: the world's most famous mythical manager
330     mail: bjensen@example.com
331     uid: bjensen
332 .LP
333 the command:
334 .LP
335 .nf
336     ldapadd -f /tmp/entrymods
337 .fi
338 .LP
339 will add a new entry for Babs Jensen, using the values from the
340 file
341 .B /tmp/newentry.
342 .LP
343 Assuming that the file
344 .B /tmp/newentry
345 exists and has the contents:
346 .LP
347 .nf
348     dn: cn=Barbara Jensen, dc=example, dc=com
349     changetype: delete
350 .LP
351 the command:
352 .LP
353 .nf
354     ldapmodify -f /tmp/entrymods
355 .fi
356 .LP
357 will remove Babs Jensen's entry.
358 .SH DIAGNOSTICS
359 Exit status is zero if no errors occur.  Errors result in a non-zero
360 exit status and a diagnostic message being written to standard error.
361 .SH "SEE ALSO"
362 .BR ldapadd (1),
363 .BR ldapdelete (1),
364 .BR ldapmodrdn (1),
365 .BR ldapsearch (1),
366 .BR ldap.conf (5),
367 .BR ldap (3),
368 .BR ldap_add (3),
369 .BR ldap_delete (3),
370 .BR ldap_modify (3),
371 .BR ldap_modrdn (3),
372 .BR slapd.replog (5)
373 .SH BUGS
374 There is no interactive mode, but there probably should be.
375 .SH AUTHOR
376 The OpenLDAP Project <http://www.openldap.org/>
377 .SH ACKNOWLEDGEMENTS
378 .B      OpenLDAP
379 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
380 .B      OpenLDAP
381 is derived from University of Michigan LDAP 3.3 Release.