]> git.sur5r.net Git - openldap/blob - doc/man/man1/ldapmodify.1
fix indent
[openldap] / doc / man / man1 / ldapmodify.1
1 .TH LDAPMODIFY 1 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2007 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_add_ext (3),
111 .BR ldap_modify_ext (3),
112 .BR ldap_delete_ext (3)
113 and
114 .BR ldap_rename (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 Continuous operation mode.  Errors are reported, but
136 .B ldapmodify
137 will continue with modifications.  The default is to exit after
138 reporting an error.
139 .TP
140 .BI \-S \ file
141 Add or change records which where skipped due to an error are written to \fIfile\fP 
142 and the error message returned by the server is added as a comment. Most useful in 
143 conjunction with -c.
144 .TP
145 .B \-n
146 Show what would be done, but don't actually modify entries.  Useful for
147 debugging in conjunction with -v.
148 .TP
149 .B \-v
150 Use verbose mode, with many diagnostics written to standard output.
151 .TP
152 .B \-F
153 Force application of all changes regardless of the contents of input
154 lines that begin with
155 .I replica:
156 (by default, replica: lines are compared against the LDAP server host
157 and port in use to decide if a replog record should actually be applied).
158 .TP
159 .B \-M[M]
160 Enable manage DSA IT control.
161 .B \-MM
162 makes control critical.
163 .TP
164 .BI \-d \ debuglevel
165 Set the LDAP debugging level to \fIdebuglevel\fP.
166 .B ldapmodify
167 must be compiled with LDAP_DEBUG defined for this option to have any effect.
168 .TP
169 .BI \-f \ file
170 Read the entry modification information from \fIfile\fP instead of from
171 standard input.
172 .TP
173 .B \-x 
174 Use simple authentication instead of SASL.
175 .TP
176 .BI \-D \ binddn
177 Use the Distinguished Name \fIbinddn\fP to bind to the LDAP directory.
178 .TP
179 .B \-W
180 Prompt for simple authentication.
181 This is used instead of specifying the password on the command line.
182 .TP
183 .BI \-w \ passwd
184 Use \fIpasswd\fP as the password for simple authentication.
185 .TP
186 .BI \-y \ passwdfile
187 Use complete contents of \fIpasswdfile\fP as the password for
188 simple authentication.
189 .TP
190 .BI \-H \ ldapuri
191 Specify URI(s) referring to the ldap server(s); only the protocol/host/port
192 fields are allowed; a list of URI, separated by whitespace or commas
193 is expected.
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 \-R \ realm
221 Specify the realm of authentication ID for SASL bind. The form of the realm
222 depends on the actual SASL mechanism used.
223 .TP
224 .BI \-X \ authzid
225 Specify the requested authorization ID for SASL bind.
226 .I authzid
227 must be one of the following formats:
228 .B dn:\c
229 .I <distinguished name>
230 or
231 .B u:\c
232 .I <username>
233 .TP
234 .BI \-Y \ mech
235 Specify the SASL mechanism to be used for authentication. If it's not
236 specified, the program will choose the best mechanism the server knows.
237 .TP
238 .B \-Z[Z]
239 Issue StartTLS (Transport Layer Security) extended operation. If you use
240 .B \-ZZ\c
241 , the command will require the operation to be successful.
242 .SH INPUT FORMAT
243 The contents of \fIfile\fP (or standard input if no \-f flag is given on
244 the command line) should conform to the format defined in
245 .BR ldif (1)
246 (LDIF as defined RFC 2849), or
247 .BR slapd.replog (5)
248 (an extended form of LDIF)
249 with the exceptions noted below.
250 .LP
251 Lines that begin with "replica:" are matched against the LDAP server host
252 and port in use to decide if a particular replog record should be applied.
253 Any other lines that precede the "dn:" line are ignored.
254 The -F flag can be used to force
255 .I ldapmodify
256 to apply all of the replog changes, regardless of the presence or
257 absence of any "replica:" lines.
258 .LP
259 If no "changetype:" line is present, the default is "add" if the -a
260 flag is set (or if the program was invoked as
261 .I ldapadd)
262 and "modify" otherwise.
263 .LP
264 If changetype is "modify" and no "add:", "replace:", or "delete:" lines
265 appear, the default is "replace" for
266 .BR ldapmodify (1)
267 and "add" for
268 .BR ldapadd (1).
269 .LP
270 Note that the above exceptions to the
271 .BR slapd.replog (5)
272 format allow
273 .BR ldif (5)
274 entries to be used as input to
275 .I ldapmodify
276 or
277 .I ldapadd.
278 .SH EXAMPLES
279 Assuming that the file
280 .B /tmp/entrymods
281 exists and has the contents:
282 .LP
283 .nf
284     dn: cn=Modify Me,dc=example,dc=com
285     changetype: modify
286     replace: mail
287     mail: modme@example.com
288     -
289     add: title
290     title: Grand Poobah
291     -
292     add: jpegPhoto
293     jpegPhoto:< file:///tmp/modme.jpeg
294     -
295     delete: description
296     -
297 .fi
298 .LP
299 the command:
300 .LP
301 .nf
302     ldapmodify -f /tmp/entrymods
303 .fi
304 .LP
305 will replace the contents of the "Modify Me" entry's
306 .I mail
307 attribute with the value "modme@example.com", add a
308 .I title
309 of "Grand Poobah", and the contents of the file "/tmp/modme.jpeg"
310 as a
311 .IR jpegPhoto ,
312 and completely remove the
313 .I description
314 attribute.
315 .LP
316 Assuming that the file
317 .B /tmp/newentry
318 exists and has the contents:
319 .LP
320 .nf
321     dn: cn=Barbara Jensen,dc=example,dc=com
322     objectClass: person
323     cn: Barbara Jensen
324     cn: Babs Jensen
325     sn: Jensen
326     title: the world's most famous mythical manager
327     mail: bjensen@example.com
328     uid: bjensen
329 .LP
330 the command:
331 .LP
332 .nf
333     ldapadd -f /tmp/newentry
334 .fi
335 .LP
336 will add a new entry for Babs Jensen, using the values from the
337 file
338 .B /tmp/newentry.
339 .LP
340 Assuming that the file
341 .B /tmp/entrymods
342 exists and has the contents:
343 .LP
344 .nf
345     dn: cn=Barbara Jensen,dc=example,dc=com
346     changetype: delete
347 .LP
348 the command:
349 .LP
350 .nf
351     ldapmodify -f /tmp/entrymods
352 .fi
353 .LP
354 will remove Babs Jensen's entry.
355 .SH DIAGNOSTICS
356 Exit status is zero if no errors occur.  Errors result in a non-zero
357 exit status and a diagnostic message being written to standard error.
358 .SH "SEE ALSO"
359 .BR ldapadd (1),
360 .BR ldapdelete (1),
361 .BR ldapmodrdn (1),
362 .BR ldapsearch (1),
363 .BR ldap.conf (5),
364 .BR ldap (3),
365 .BR ldap_add_ext (3),
366 .BR ldap_delete_ext (3),
367 .BR ldap_modify_ext (3),
368 .BR ldap_modrdn_ext (3),
369 .BR ldif (5),
370 .BR slapd.replog (5)
371 .SH AUTHOR
372 The OpenLDAP Project <http://www.openldap.org/>
373 .SH ACKNOWLEDGEMENTS
374 .so ../Project