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