]> git.sur5r.net Git - openldap/blob - doc/man/man1/ldapmodify.1
1165539b9fa0f90d6356f5889ae8c8590fc2d26f
[openldap] / doc / man / man1 / ldapmodify.1
1 .TH LDAPMODIFY 1 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2005 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 .BI \-S \ file\fR]
15 [\c
16 .BR \-n ]
17 [\c
18 .BR \-v ]
19 [\c
20 .BR \-M[M] ]
21 [\c
22 .BI \-d \ debuglevel\fR]
23 [\c
24 .BI \-D \ binddn\fR]
25 [\c
26 .BR \-W ]
27 [\c
28 .BI \-w \ passwd\fR]
29 [\c
30 .BI \-y \ passwdfile\fR]
31 [\c
32 .BI \-H \ ldapuri\fR]
33 [\c
34 .BI \-h \ ldaphost\fR]
35 [\c
36 .BI \-p \ ldapport\fR]
37 [\c
38 .BI \-P \ 2\fR\||\|\fI3\fR]
39 [\c
40 .BR \-O \ security-properties ]
41 [\c
42 .BR \-I ]
43 [\c
44 .BR \-Q ]
45 [\c
46 .BI \-U \ authcid\fR]
47 [\c
48 .BI \-R \ realm\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 .BI \-S \ file\fR]
65 [\c
66 .BR \-n ]
67 [\c
68 .BR \-v ]
69 [\c
70 .BR \-M[M] ]
71 [\c
72 .BI \-d \ debuglevel\fR]
73 [\c
74 .BI \-D \ binddn\fR]
75 [\c
76 .BR \-W ]
77 [\c
78 .BI \-w \ passwd\fR]
79 [\c
80 .BI \-y \ passwdfile\fR]
81 [\c
82 .BI \-h \ ldaphost\fR]
83 [\c
84 .BI \-p \ ldapport\fR]
85 [\c
86 .BI \-P \ 2\fR\||\|\fI3\fR]
87 [\c
88 .BR \-O \ security-properties ]
89 [\c
90 .BR \-I ]
91 [\c
92 .BR \-Q ]
93 [\c
94 .BI \-U \ authcid\fR]
95 [\c
96 .BI \-R \ realm\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 .BI \-S \ file
139 Add or change records which where skipped due to an error are written to \fIfile\fP 
140 and the error message returned by the server is added as a comment. Most useful in 
141 conjunction with -c.
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 \-F
151 Force application of all changes regardless of the contents of input
152 lines that begin with
153 .I replica:
154 (by default, replica: lines are compared against the LDAP server host
155 and port in use to decide if a replog record should actually be applied).
156 .TP
157 .B \-M[M]
158 Enable manage DSA IT control.
159 .B \-MM
160 makes control critical.
161 .TP
162 .BI \-d \ debuglevel
163 Set the LDAP debugging level to \fIdebuglevel\fP.
164 .B ldapmodify
165 must be compiled with LDAP_DEBUG defined for this option to have any effect.
166 .TP
167 .BI \-f \ file
168 Read the entry modification information from \fIfile\fP instead of from
169 standard input.
170 .TP
171 .B \-x 
172 Use simple authentication instead of SASL.
173 .TP
174 .BI \-D \ binddn
175 Use the Distinguished Name \fIbinddn\fP to bind to the LDAP directory.
176 .TP
177 .B \-W
178 Prompt for simple authentication.
179 This is used instead of specifying the password on the command line.
180 .TP
181 .BI \-w \ passwd
182 Use \fIpasswd\fP as the password for simple authentication.
183 .TP
184 .BI \-y \ passwdfile
185 Use complete contents of \fIpasswdfile\fP as the password for
186 simple authentication.
187 .TP
188 .BI \-H \ ldapuri
189 Specify URI(s) referring to the ldap server(s); only the protocol/host/port
190 fields are allowed; a list of URI, separated by whitespace or commas
191 is expected.
192 .TP
193 .BI \-h \ ldaphost
194 Specify an alternate host on which the ldap server is running.
195 Deprecated in favor of -H.
196 .TP
197 .BI \-p \ ldapport
198 Specify an alternate TCP port where the ldap server is listening.
199 Deprecated in favor of -H.
200 .TP
201 .BI \-P \ 2\fR\||\|\fI3
202 Specify the LDAP protocol version to use.
203 .TP
204 .BI \-O \ security-properties
205 Specify SASL security properties.
206 .TP
207 .B \-I
208 Enable SASL Interactive mode.  Always prompt.  Default is to prompt
209 only as needed.
210 .TP
211 .B \-Q
212 Enable SASL Quiet mode.  Never prompt.
213 .TP
214 .BI \-U \ authcid
215 Specify the authentication ID for SASL bind. The form of the ID
216 depends on the actual SASL mechanism used.
217 .TP
218 .BI \-R \ realm
219 Specify the realm of authentication ID for SASL bind. The form of the realm
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 ldif (1)
244 (LDIF as defined RFC 2849), or
245 .BR slapd.replog (5)
246 (an extended form of LDIF)
247 with the exceptions noted below.
248 .LP
249 Lines that begin with "replica:" are matched against the LDAP server host
250 and port in use to decide if a particular replog record should be applied.
251 Any other lines that precede the "dn:" line are ignored.
252 The -F flag can be used to force
253 .I ldapmodify
254 to apply all of the replog changes, regardless of the presence or
255 absence of any "replica:" lines.
256 .LP
257 If no "changetype:" line is present, the default is "add" if the -a
258 flag is set (or if the program was invoked as
259 .I ldapadd)
260 and "modify" otherwise.
261 .LP
262 If changetype is "modify" and no "add:", "replace:", or "delete:" lines
263 appear, the default is "replace" for
264 .BR ldapmodify (1)
265 and "add" for
266 .BR ldapadd (1).
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@example.com
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 -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/newentry
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/entrymods
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 ldif (5),
368 .BR slapd.replog (5)
369 .SH AUTHOR
370 The OpenLDAP Project <http://www.openldap.org/>
371 .SH ACKNOWLEDGEMENTS
372 .B OpenLDAP
373 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
374 .B OpenLDAP
375 is derived from University of Michigan LDAP 3.3 Release.