]> git.sur5r.net Git - openldap/blob - doc/man/man1/ldapmodify.1
ITS#8573 allow all libldap options in tools -o option
[openldap] / doc / man / man1 / ldapmodify.1
1 .TH LDAPMODIFY 1 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2018 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 \-V [ V ]]
11 [\c
12 .BI \-d \ debuglevel\fR]
13 [\c
14 .BR \-n ]
15 [\c
16 .BR \-v ]
17 [\c
18 .BR \-a ]
19 [\c
20 .BR \-c ]
21 [\c
22 .BI \-f \ file\fR]
23 [\c
24 .BI \-S \ file\fR]
25 [\c
26 .BR \-M [ M ]]
27 [\c
28 .BR \-x ]
29 [\c
30 .BI \-D \ binddn\fR]
31 [\c
32 .BR \-W ]
33 [\c
34 .BI \-w \ passwd\fR]
35 [\c
36 .BI \-y \ passwdfile\fR]
37 [\c
38 .BI \-H \ ldapuri\fR]
39 [\c
40 .BI \-h \ ldaphost\fR]
41 [\c
42 .BI \-p \ ldapport\fR]
43 [\c
44 .BR \-P \ { 2 \||\| 3 }]
45 [\c
46 .BR \-e \ [ ! ] \fIext\fP [ =\fIextparam\fP ]]
47 [\c
48 .BR \-E \ [ ! ] \fIext\fP [ =\fIextparam\fP ]]
49 [\c
50 .BI \-o \ opt \fR[= optparam \fR]]
51 [\c
52 .BI \-O \ security-properties\fR]
53 [\c
54 .BR \-I ]
55 [\c
56 .BR \-Q ]
57 [\c
58 .BR \-N ]
59 [\c
60 .BI \-U \ authcid\fR]
61 [\c
62 .BI \-R \ realm\fR]
63 [\c
64 .BI \-X \ authzid\fR]
65 [\c
66 .BI \-Y \ mech\fR]
67 [\c
68 .BR \-Z [ Z ]]
69 .LP
70 .B ldapadd
71 [\c
72 .BR \-V [ V ]]
73 [\c
74 .BI \-d \ debuglevel\fR]
75 [\c
76 .BR \-n ]
77 [\c
78 .BR \-v ]
79 [\c
80 .BR \-c ]
81 [\c
82 .BI \-f \ file\fR]
83 [\c
84 .BI \-S \ file\fR]
85 [\c
86 .BR \-M [ M ]]
87 [\c
88 .BR \-x ]
89 [\c
90 .BI \-D \ binddn\fR]
91 [\c
92 .BR \-W ]
93 [\c
94 .BI \-w \ passwd\fR]
95 [\c
96 .BI \-y \ passwdfile\fR]
97 [\c
98 .BI \-H \ ldapuri\fR]
99 [\c
100 .BI \-h \ ldaphost\fR]
101 [\c
102 .BI \-p \ ldapport\fR]
103 [\c
104 .BR \-P \ { 2 \||\| 3 }]
105 [\c
106 .BR \-e \ [ ! ] \fIext\fP [ =\fIextparam\fP ]]
107 [\c
108 .BR \-E \ [ ! ] \fIext\fP [ =\fIextparam\fP ]]
109 [\c
110 .BI \-o \ opt \fR[= optparam \fR]]
111 [\c
112 .BI \-O \ security-properties\fR]
113 [\c
114 .BR \-I ]
115 [\c
116 .BR \-Q ]
117 [\c
118 .BR \-N ]
119 [\c
120 .BI \-U \ authcid\fR]
121 [\c
122 .BI \-R \ realm\fR]
123 [\c
124 .BI \-X \ authzid\fR]
125 [\c
126 .BI \-Y \ mech\fR]
127 [\c
128 .BR \-Z [ Z ]]
129 .SH DESCRIPTION
130 .B ldapmodify
131 is a shell-accessible interface to the
132 .BR ldap_add_ext (3),
133 .BR ldap_modify_ext (3),
134 .BR ldap_delete_ext (3)
135 and
136 .BR ldap_rename (3).
137 library calls.
138 .B ldapadd
139 is implemented as a hard link to the ldapmodify tool.  When invoked as
140 .B ldapadd
141 the \fB\-a\fP (add new entry) flag is turned on automatically.
142 .LP
143 .B ldapmodify
144 opens a connection to an LDAP server, binds, and modifies or adds entries.
145 The entry information is read from standard input or from \fIfile\fP through
146 the use of the \fB\-f\fP option.
147 .SH OPTIONS
148 .TP
149 .BR \-V [ V ]
150 Print version info.
151 If \fB\-VV\fP is given, only the version information is printed.
152 .TP
153 .BI \-d \ debuglevel
154 Set the LDAP debugging level to \fIdebuglevel\fP.
155 .B ldapmodify
156 must be compiled with LDAP_DEBUG defined for this option to have any effect.
157 .TP
158 .B \-n
159 Show what would be done, but don't actually modify entries.  Useful for
160 debugging in conjunction with \fB\-v\fP.
161 .TP
162 .B \-v
163 Use verbose mode, with many diagnostics written to standard output.
164 .TP
165 .B \-a
166 Add new entries.  The default for
167 .B ldapmodify
168 is to modify existing entries.  If invoked as
169 .BR ldapadd ,
170 this flag is always set.
171 .TP
172 .B \-c
173 Continuous operation mode.  Errors are reported, but
174 .B ldapmodify
175 will continue with modifications.  The default is to exit after
176 reporting an error.
177 .TP
178 .BI \-f \ file
179 Read the entry modification information from \fIfile\fP instead of from
180 standard input.
181 .TP
182 .BI \-S \ file
183 Add or change records which were skipped due to an error are written to \fIfile\fP 
184 and the error message returned by the server is added as a comment. Most useful in 
185 conjunction with \fB\-c\fP.
186 .TP
187 .BR \-M [ M ]
188 Enable manage DSA IT control.
189 .B \-MM
190 makes control critical.
191 .TP
192 .B \-x 
193 Use simple authentication instead of SASL.
194 .TP
195 .BI \-D \ binddn
196 Use the Distinguished Name \fIbinddn\fP to bind to the LDAP directory.
197 For SASL binds, the server is expected to ignore this value.
198 .TP
199 .B \-W
200 Prompt for simple authentication.
201 This is used instead of specifying the password on the command line.
202 .TP
203 .BI \-w \ passwd
204 Use \fIpasswd\fP as the password for simple authentication.
205 .TP
206 .BI \-y \ passwdfile
207 Use complete contents of \fIpasswdfile\fP as the password for
208 simple authentication.
209 .TP
210 .BI \-H \ ldapuri
211 Specify URI(s) referring to the ldap server(s); only the protocol/host/port
212 fields are allowed; a list of URI, separated by whitespace or commas
213 is expected.
214 .TP
215 .BI \-h \ ldaphost
216 Specify an alternate host on which the ldap server is running.
217 Deprecated in favor of \fB\-H\fP.
218 .TP
219 .BI \-p \ ldapport
220 Specify an alternate TCP port where the ldap server is listening.
221 Deprecated in favor of \fB\-H\fP.
222 .TP
223 .BR \-P \ { 2 \||\| 3 }
224 Specify the LDAP protocol version to use.
225 .TP
226 .BR \-e \ [ ! ] \fIext\fP [ =\fIextparam\fP ]
227 .TP
228 .BR \-E \ [ ! ] \fIext\fP [ =\fIextparam\fP ]
229
230 Specify general extensions with \fB\-e\fP and modify extensions with \fB\-E\fP.
231 \'\fB!\fP\' indicates criticality.
232
233 General extensions:
234 .nf
235   [!]assert=<filter>    (an RFC 4515 Filter)
236   !authzid=<authzid>    ("dn:<dn>" or "u:<user>")
237   [!]bauthzid           (RFC 3829 authzid control)
238   [!]chaining[=<resolve>[/<cont>]]
239   [!]manageDSAit
240   [!]noop
241   ppolicy
242   [!]postread[=<attrs>] (a comma-separated attribute list)
243   [!]preread[=<attrs>]  (a comma-separated attribute list)
244   [!]relax
245   sessiontracking[=<username>]
246   abandon,cancel,ignore (SIGINT sends abandon/cancel,
247   or ignores response; if critical, doesn't wait for SIGINT.
248   not really controls)
249 .fi
250
251 Modify extensions:
252 .nf
253   [!]txn[=abort|commit]
254 .fi
255 .TP
256 .BI \-o \ opt \fR[= optparam \fR]]
257
258 Specify any
259 .BR ldap.conf (5)
260 option or one of the following:
261 .nf
262   nettimeout=<timeout>  (in seconds, or "none" or "max")
263   ldif_wrap=<width>     (in columns, or "no" for no wrapping)
264 .fi
265
266 .TP
267 .BI \-O \ security-properties
268 Specify SASL security properties.
269 .TP
270 .B \-I
271 Enable SASL Interactive mode.  Always prompt.  Default is to prompt
272 only as needed.
273 .TP
274 .B \-Q
275 Enable SASL Quiet mode.  Never prompt.
276 .TP
277 .B \-N
278 Do not use reverse DNS to canonicalize SASL host name.
279 .TP
280 .BI \-U \ authcid
281 Specify the authentication ID for SASL bind. The form of the ID
282 depends on the actual SASL mechanism used.
283 .TP
284 .BI \-R \ realm
285 Specify the realm of authentication ID for SASL bind. The form of the realm
286 depends on the actual SASL mechanism used.
287 .TP
288 .BI \-X \ authzid
289 Specify the requested authorization ID for SASL bind.
290 .I authzid
291 must be one of the following formats:
292 .BI dn: "<distinguished name>"
293 or
294 .BI u: <username>
295 .TP
296 .BI \-Y \ mech
297 Specify the SASL mechanism to be used for authentication. If it's not
298 specified, the program will choose the best mechanism the server knows.
299 .TP
300 .BR \-Z [ Z ]
301 Issue StartTLS (Transport Layer Security) extended operation. If you use
302 .B \-ZZ\c
303 , the command will require the operation to be successful.
304 .SH INPUT FORMAT
305 The contents of \fIfile\fP (or standard input if no \fB\-f\fP flag is given on
306 the command line) must conform to the format defined in
307 .BR ldif (5)
308 (LDIF as defined in RFC 2849).
309 .SH EXAMPLES
310 Assuming that the file
311 .B /tmp/entrymods
312 exists and has the contents:
313 .LP
314 .nf
315     dn: cn=Modify Me,dc=example,dc=com
316     changetype: modify
317     replace: mail
318     mail: modme@example.com
319     \-
320     add: title
321     title: Grand Poobah
322     \-
323     add: jpegPhoto
324     jpegPhoto:< file:///tmp/modme.jpeg
325     \-
326     delete: description
327     \-
328 .fi
329 .LP
330 the command:
331 .LP
332 .nf
333     ldapmodify \-f /tmp/entrymods
334 .fi
335 .LP
336 will replace the contents of the "Modify Me" entry's
337 .I mail
338 attribute with the value "modme@example.com", add a
339 .I title
340 of "Grand Poobah", and the contents of the file "/tmp/modme.jpeg"
341 as a
342 .IR jpegPhoto ,
343 and completely remove the
344 .I description
345 attribute.
346 .LP
347 Assuming that the file
348 .B /tmp/newentry
349 exists and has the contents:
350 .LP
351 .nf
352     dn: cn=Barbara Jensen,dc=example,dc=com
353     objectClass: person
354     cn: Barbara Jensen
355     cn: Babs Jensen
356     sn: Jensen
357     title: the world's most famous mythical manager
358     mail: bjensen@example.com
359     uid: bjensen
360 .fi
361 .LP
362 the command:
363 .LP
364 .nf
365     ldapadd \-f /tmp/newentry
366 .fi
367 .LP
368 will add a new entry for Babs Jensen, using the values from the
369 file
370 .B /tmp/newentry.
371 .LP
372 Assuming that the file
373 .B /tmp/entrymods
374 exists and has the contents:
375 .LP
376 .nf
377     dn: cn=Barbara Jensen,dc=example,dc=com
378     changetype: delete
379 .fi
380 .LP
381 the command:
382 .LP
383 .nf
384     ldapmodify \-f /tmp/entrymods
385 .fi
386 .LP
387 will remove Babs Jensen's entry.
388 .SH DIAGNOSTICS
389 Exit status is zero if no errors occur.  Errors result in a non-zero
390 exit status and a diagnostic message being written to standard error.
391 .SH "SEE ALSO"
392 .BR ldapadd (1),
393 .BR ldapdelete (1),
394 .BR ldapmodrdn (1),
395 .BR ldapsearch (1),
396 .BR ldap.conf (5),
397 .BR ldap (3),
398 .BR ldap_add_ext (3),
399 .BR ldap_delete_ext (3),
400 .BR ldap_modify_ext (3),
401 .BR ldap_modrdn_ext (3),
402 .BR ldif (5).
403 .SH AUTHOR
404 The OpenLDAP Project <http://www.openldap.org/>
405 .SH ACKNOWLEDGEMENTS
406 .so ../Project