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