]> git.sur5r.net Git - openldap/blob - doc/man/man1/ldapmodify.1
Update copyright statements
[openldap] / doc / man / man1 / ldapmodify.1
1 .TH LDAPMODIFY 1 "20 August 2001" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2002 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 and "add"
259 .BR ldapmodify (1)
260 for
261 .BR ldapadd (1).
262 .LP
263 Note that the above exceptions to the
264 .BR slapd.replog (5)
265 format allow
266 .BR ldif (5)
267 entries to be used as input to
268 .I ldapmodify
269 or
270 .I ldapadd.
271 .SH EXAMPLES
272 Assuming that the file
273 .B /tmp/entrymods
274 exists and has the contents:
275 .LP
276 .nf
277     dn: cn=Modify Me,dc=example,dc=com
278     changetype: modify
279     replace: mail
280     mail: modme@OpenLDAP.org
281     -
282     add: title
283     title: Grand Poobah
284     -
285     add: jpegPhoto
286     jpegPhoto:< file://tmp/modme.jpeg
287     -
288     delete: description
289     -
290 .fi
291 .LP
292 the command:
293 .LP
294 .nf
295     ldapmodify -f /tmp/entrymods
296 .fi
297 .LP
298 will replace the contents of the "Modify Me" entry's
299 .I mail
300 attribute with the value "modme@example.com", add a
301 .I title
302 of "Grand Poobah", and the contents of the file "/tmp/modme.jpeg"
303 as a
304 .IR jpegPhoto ,
305 and completely remove the
306 .I description
307 attribute.
308 .LP
309 Assuming that the file
310 .B /tmp/newentry
311 exists and has the contents:
312 .LP
313 .nf
314     dn: cn=Barbara Jensen,dc=example,dc=com
315     objectClass: person
316     cn: Barbara Jensen
317     cn: Babs Jensen
318     sn: Jensen
319     title: the world's most famous mythical manager
320     mail: bjensen@example.com
321     uid: bjensen
322 .LP
323 the command:
324 .LP
325 .nf
326     ldapadd -f /tmp/entrymods
327 .fi
328 .LP
329 will add a new entry for Babs Jensen, using the values from the
330 file
331 .B /tmp/newentry.
332 .LP
333 Assuming that the file
334 .B /tmp/newentry
335 exists and has the contents:
336 .LP
337 .nf
338     dn: cn=Barbara Jensen,dc=example,dc=com
339     changetype: delete
340 .LP
341 the command:
342 .LP
343 .nf
344     ldapmodify -f /tmp/entrymods
345 .fi
346 .LP
347 will remove Babs Jensen's entry.
348 .SH DIAGNOSTICS
349 Exit status is zero if no errors occur.  Errors result in a non-zero
350 exit status and a diagnostic message being written to standard error.
351 .SH "SEE ALSO"
352 .BR ldapadd (1),
353 .BR ldapdelete (1),
354 .BR ldapmodrdn (1),
355 .BR ldapsearch (1),
356 .BR ldap.conf (5),
357 .BR ldap (3),
358 .BR ldap_add (3),
359 .BR ldap_delete (3),
360 .BR ldap_modify (3),
361 .BR ldap_modrdn (3),
362 .BR slapd.replog (5)
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.