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