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