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