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