]> git.sur5r.net Git - openldap/blob - doc/man/man1/ldapmodify.1
fc181f71f87ded44127ba464fb639ca84b36a8a7
[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 \-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 Automatically chase referrals.
134 .TP
135 .B \-c
136 Continuous operation mode.  Errors are reported, but
137 .B ldapmodify
138 will continue with modifications.  The default is to exit after
139 reporting an error.
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 IV 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 IV bind.  This is useful
155 when connecting to a slapd and there is no x500dsa.hostname principal
156 registered with your Kerberos Domain Controller(s).
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" for
259 and "add"
260 .BR ldapmodify (1)
261 for
262 .BR ldapadd (1).
263 .LP
264 Note that the above exceptions to the
265 .BR slapd.replog (5)
266 format allow
267 .BR ldif (5)
268 entries to be used as input to
269 .I ldapmodify
270 or
271 .I ldapadd.
272 .SH EXAMPLES
273 Assuming that the file
274 .B /tmp/entrymods
275 exists and has the contents:
276 .LP
277 .nf
278     dn: cn=Modify Me, dc=example, dc=com
279     changetype: modify
280     replace: mail
281     mail: modme@OpenLDAP.org
282     -
283     add: title
284     title: Grand Poobah
285     -
286     add: jpegPhoto
287     jpegPhoto:< file://tmp/modme.jpeg
288     -
289     delete: description
290     -
291 .fi
292 .LP
293 the command:
294 .LP
295 .nf
296     ldapmodify -f /tmp/entrymods
297 .fi
298 .LP
299 will replace the contents of the "Modify Me" entry's
300 .I mail
301 attribute with the value "modme@example.com", add a
302 .I title
303 of "Grand Poobah", and the contents of the file "/tmp/modme.jpeg"
304 as a
305 .IR jpegPhoto ,
306 and completely remove the
307 .I description
308 attribute.
309 .LP
310 Assuming that the file
311 .B /tmp/newentry
312 exists and has the contents:
313 .LP
314 .nf
315     dn: cn=Barbara Jensen, dc=example, dc=com
316     objectClass: person
317     cn: Barbara Jensen
318     cn: Babs Jensen
319     sn: Jensen
320     title: the world's most famous mythical manager
321     mail: bjensen@example.com
322     uid: bjensen
323 .LP
324 the command:
325 .LP
326 .nf
327     ldapadd -f /tmp/entrymods
328 .fi
329 .LP
330 will add a new entry for Babs Jensen, using the values from the
331 file
332 .B /tmp/newentry.
333 .LP
334 Assuming that the file
335 .B /tmp/newentry
336 exists and has the contents:
337 .LP
338 .nf
339     dn: cn=Barbara Jensen, dc=example, dc=com
340     changetype: delete
341 .LP
342 the command:
343 .LP
344 .nf
345     ldapmodify -f /tmp/entrymods
346 .fi
347 .LP
348 will remove Babs Jensen's entry.
349 .SH DIAGNOSTICS
350 Exit status is zero if no errors occur.  Errors result in a non-zero
351 exit status and a diagnostic message being written to standard error.
352 .SH "SEE ALSO"
353 .BR ldapadd (1),
354 .BR ldapdelete (1),
355 .BR ldapmodrdn (1),
356 .BR ldapsearch (1),
357 .BR ldap.conf (5),
358 .BR ldap (3),
359 .BR ldap_add (3),
360 .BR ldap_delete (3),
361 .BR ldap_modify (3),
362 .BR ldap_modrdn (3),
363 .BR slapd.replog (5)
364 .SH BUGS
365 There is no interactive mode, but there probably should be.
366 .SH AUTHOR
367 The OpenLDAP Project <http://www.openldap.org/>
368 .SH ACKNOWLEDGEMENTS
369 .B      OpenLDAP
370 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
371 .B      OpenLDAP
372 is derived from University of Michigan LDAP 3.3 Release.