]> git.sur5r.net Git - openldap/blob - doc/man/man1/ldapmodify.1
Happy new year (belated)
[openldap] / doc / man / man1 / ldapmodify.1
1 .TH LDAPMODIFY 1 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2014 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 general options.
259
260 General options:
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 .TP
266 .BI \-O \ security-properties
267 Specify SASL security properties.
268 .TP
269 .B \-I
270 Enable SASL Interactive mode.  Always prompt.  Default is to prompt
271 only as needed.
272 .TP
273 .B \-Q
274 Enable SASL Quiet mode.  Never prompt.
275 .TP
276 .B \-N
277 Do not use reverse DNS to canonicalize SASL host name.
278 .TP
279 .BI \-U \ authcid
280 Specify the authentication ID for SASL bind. The form of the ID
281 depends on the actual SASL mechanism used.
282 .TP
283 .BI \-R \ realm
284 Specify the realm of authentication ID for SASL bind. The form of the realm
285 depends on the actual SASL mechanism used.
286 .TP
287 .BI \-X \ authzid
288 Specify the requested authorization ID for SASL bind.
289 .I authzid
290 must be one of the following formats:
291 .BI dn: "<distinguished name>"
292 or
293 .BI u: <username>
294 .TP
295 .BI \-Y \ mech
296 Specify the SASL mechanism to be used for authentication. If it's not
297 specified, the program will choose the best mechanism the server knows.
298 .TP
299 .BR \-Z [ Z ]
300 Issue StartTLS (Transport Layer Security) extended operation. If you use
301 .B \-ZZ\c
302 , the command will require the operation to be successful.
303 .SH INPUT FORMAT
304 The contents of \fIfile\fP (or standard input if no \fB\-f\fP flag is given on
305 the command line) must conform to the format defined in
306 .BR ldif (5)
307 (LDIF as defined in RFC 2849).
308 .SH EXAMPLES
309 Assuming that the file
310 .B /tmp/entrymods
311 exists and has the contents:
312 .LP
313 .nf
314     dn: cn=Modify Me,dc=example,dc=com
315     changetype: modify
316     replace: mail
317     mail: modme@example.com
318     \-
319     add: title
320     title: Grand Poobah
321     \-
322     add: jpegPhoto
323     jpegPhoto:< file:///tmp/modme.jpeg
324     \-
325     delete: description
326     \-
327 .fi
328 .LP
329 the command:
330 .LP
331 .nf
332     ldapmodify \-f /tmp/entrymods
333 .fi
334 .LP
335 will replace the contents of the "Modify Me" entry's
336 .I mail
337 attribute with the value "modme@example.com", add a
338 .I title
339 of "Grand Poobah", and the contents of the file "/tmp/modme.jpeg"
340 as a
341 .IR jpegPhoto ,
342 and completely remove the
343 .I description
344 attribute.
345 .LP
346 Assuming that the file
347 .B /tmp/newentry
348 exists and has the contents:
349 .LP
350 .nf
351     dn: cn=Barbara Jensen,dc=example,dc=com
352     objectClass: person
353     cn: Barbara Jensen
354     cn: Babs Jensen
355     sn: Jensen
356     title: the world's most famous mythical manager
357     mail: bjensen@example.com
358     uid: bjensen
359 .fi
360 .LP
361 the command:
362 .LP
363 .nf
364     ldapadd \-f /tmp/newentry
365 .fi
366 .LP
367 will add a new entry for Babs Jensen, using the values from the
368 file
369 .B /tmp/newentry.
370 .LP
371 Assuming that the file
372 .B /tmp/entrymods
373 exists and has the contents:
374 .LP
375 .nf
376     dn: cn=Barbara Jensen,dc=example,dc=com
377     changetype: delete
378 .fi
379 .LP
380 the command:
381 .LP
382 .nf
383     ldapmodify \-f /tmp/entrymods
384 .fi
385 .LP
386 will remove Babs Jensen's entry.
387 .SH DIAGNOSTICS
388 Exit status is zero if no errors occur.  Errors result in a non-zero
389 exit status and a diagnostic message being written to standard error.
390 .SH "SEE ALSO"
391 .BR ldapadd (1),
392 .BR ldapdelete (1),
393 .BR ldapmodrdn (1),
394 .BR ldapsearch (1),
395 .BR ldap.conf (5),
396 .BR ldap (3),
397 .BR ldap_add_ext (3),
398 .BR ldap_delete_ext (3),
399 .BR ldap_modify_ext (3),
400 .BR ldap_modrdn_ext (3),
401 .BR ldif (5).
402 .SH AUTHOR
403 The OpenLDAP Project <http://www.openldap.org/>
404 .SH ACKNOWLEDGEMENTS
405 .so ../Project