Move everything from /var/adm to /var/log
[unleashed.git] / share / man / man1 / ldapmodify.1
blobf965d8a0ff2d539328fcf17e8681bed382d959e7
1 '\" te
2 .\" Copyright (C) 1990, Regents of the University of Michigan.  All Rights Reserved.
3 .\" Portions Copyright (C) 2004, Sun Microsystems, Inc. All Rights Reserved.
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH LDAPMODIFY 1 "Jan 15, 2004"
8 .SH NAME
9 ldapmodify, ldapadd \- ldap entry addition and modification tools
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fBldapmodify\fR [\fB-a\fR] [\fB-c\fR] [\fB-r\fR] [\fB-n\fR] [\fB-v\fR] [\fB-F\fR] [\fB-b\fR] [\fB-A\fR] [\fB-q\fR]
14      [\fB-H\fR] [\fB-?\fR] [\fB-E\fR] [\fB-J\fR] [\fB-Z\fR] [\fB-M\fR] [\fB-d\fR \fIdebuglevel\fR]
15      [\fB-D\fR \fIbindDN\fR] [\fB-j\fR \fIfilename\fR] [\fB-J\fR [:\fIcriticality\fR]]
16      [\fB-B\fR \fIbaseDN\fR] [\fB-V\fR \fIversion\fR] [\fB-Y\fR \fIproxyDN\fR] [\fB-O\fR \fIhopLimit\fR]
17      [\fB-i\fR \fIlocale\fR] [\fB-k\fR \fIpath\fR] [\fB-e\fR \fIerrorFile\fR] [\fB-P\fR \fIpath\fR]
18      [\fB-N\fR \fIcertificate\fR] [\fB-w\fR \fIpasswd\fR] [\fB-o\fR \fIattributename\fR=\fIvalue\fR]
19      [\fB-h\fR \fIldaphost\fR] [\fB-W\fR \fIpassword\fR] [\fB-p\fR \fIldapport\fR] [\fB-f\fR \fIfile\fR]
20      [\fB-l\fR \fInb-ldap-connections\fR]
21 .fi
23 .LP
24 .nf
25 \fBldapadd\fR [\fB-c\fR] [\fB-n\fR] [\fB-v\fR] [\fB-F\fR]
26      [ [\fB-b\fR] [\fB-A\fR] [\fB-q\fR] [\fB-H\fR] [\fB-?\fR] [\fB-E\fR] [\fB-J\fR] [\fB-Z\fR] [\fB-M\fR]\fB-d\fR \fIdebuglevel\fR]
27      [\fB-D\fR \fIbindDN\fR] [\fB-j\fR \fIfilename\fR] [\fB-B\fR \fIbaseDN\fR] [\fB-V\fR \fIversion\fR]
28      [\fB-Y\fR \fIproxyDN\fR] [\fB-O\fR \fIhopLimit\fR] [\fB-i\fR \fIlocale\fR] [\fB-k\fR \fIpath\fR]
29      [\fB-e\fR \fIerrorFile\fR] [\fB-P\fR \fIpath\fR] [\fB-N\fR \fIcertificate\fR] [\fB-w\fR \fIpasswd\fR]
30      [\fB-o\fR \fIattributename\fR=\fIvalue\fR] [\fB-h\fR \fIldaphost\fR] [\fB-W\fR \fIpassword\fR]
31      [\fB-p\fR \fIldapport\fR] [\fB-f\fR \fIfile\fR] [\fB-l\fR \fInb-ldap-connections\fR]
32 .fi
34 .SH DESCRIPTION
35 .sp
36 .LP
37 The \fBldapmodify\fR utility opens a connection to an \fBLDAP\fR server, binds
38 and modifies or adds entries. The entry information is read from standard input
39 or from \fIfile\fR, specified using the \fB-f\fR option. The \fBldapadd\fR
40 utility is implemented as a hard link to the \fBldapmodify\fR tool. When
41 invoked as \fBldapadd\fR, the \fB-a\fR (add new entry) option is turned on
42 automatically.
43 .sp
44 .LP
45 Both \fBldapadd\fR and \fBldapmodify\fR reject duplicate attribute-name/value
46 pairs for the same entry.
47 .SH OPTIONS
48 .sp
49 .LP
50 The following options are supported:
51 .sp
52 .ne 2
53 .na
54 \fB\fB-a\fR\fR
55 .ad
56 .sp .6
57 .RS 4n
58 Adds new entries. The default for \fBldapmodify\fR is to modify existing
59 entries. If invoked as \fBldapadd\fR, this option is always set.
60 .RE
62 .sp
63 .ne 2
64 .na
65 \fB\fB-A\fR\fR
66 .ad
67 .sp .6
68 .RS 4n
69 Non-ASCII mode: display non-ASCII values, in conjunction with the \fB-v\fR
70 option.
71 .RE
73 .sp
74 .ne 2
75 .na
76 \fB\fB-b\fR\fR
77 .ad
78 .sp .6
79 .RS 4n
80 Handle binary files. The \fBldapmodify\fR tool will scan every attribute value
81 in the input to determine whether it is a valid file reference. If the
82 reference is valid, it will use the contents of the file as the attribute's
83 value. This option is used to input binary data, such as a JPEG image, for an
84 attribute. For example, the corresponding LDIF input would be: "\fB jpegPhoto:
85 /tmp/photo.jpg\fR" The \fBldapmodify\fR tool also supports the LDIF \fB:<
86 \fIURL\fR\fR notation for directly including file contents.
87 .RE
89 .sp
90 .ne 2
91 .na
92 \fB\fB-B\fR\ \fIbaseDN\fR\fR
93 .ad
94 .sp .6
95 .RS 4n
96 Specify the base DN when performing additions, usually in double quotes
97 (\fB""\fR) for the shell. All entries will be placed under this suffix, thus
98 providing bulk import functionality.
99 .RE
102 .ne 2
104 \fB\fB-c\fR\fR
106 .sp .6
107 .RS 4n
108 Specifies continuous operation mode. Errors are reported, but \fBldapmodify\fR
109 and  \fBldapadd\fR continue with modifications. The default is to exit after
110 reporting an error.
114 .ne 2
116 \fB\fB-D\fR \fIbindDN\fR \fR
118 .sp .6
119 .RS 4n
120 Uses the distinguished name \fIbindDN\fR to bind to the directory.
124 .ne 2
126 \fB\fB-d\fR \fIdebuglevel\fR\fR
128 .sp .6
129 .RS 4n
130 Sets the \fBLDAP\fR debugging level. Useful levels of debugging for
131 \fBldapmodify\fR and \fBldapadd\fR are:
133 .ne 2
135 \fB\fB1\fR\fR
137 .RS 7n
138 Trace
142 .ne 2
144 \fB\fB2\fR\fR
146 .RS 7n
147 Packets
151 .ne 2
153 \fB\fB4\fR\fR
155 .RS 7n
156 Arguments
160 .ne 2
162 \fB\fB32\fR\fR
164 .RS 7n
165 Filters
169 .ne 2
171 \fB\fB128\fR\fR
173 .RS 7n
174 Access control
177 To request more than one category of debugging information, add the masks. For
178 example, to request trace and filter information, specify a \fIdebuglevel\fR of
183 .ne 2
185 \fB\fB-e\fR\ \fIerrorFile\fR\fR
187 .sp .6
188 .RS 4n
189 Invalid update statements in the input will be copied to the \fIerrorFile\fR
190 for debugging. Use with the \fB-c\fR option to correct errors when processing
191 large LDIF input.
195 .ne 2
197 \fB\fB-E\fR\fR
199 .sp .6
200 .RS 4n
201 Ask server to expose (report) bind identity by means of authentication response
202 control.
206 .ne 2
208 \fB\fB-F\fR\fR
210 .sp .6
211 .RS 4n
212 Forces application of all changes regardless of the content of input lines that
213 begin with \fBreplica:\fR. By default, \fBreplica:\fR lines are compared
214 against the \fBLDAP\fR server host and port in use to decide whether a replog
215 record should be applied.
219 .ne 2
221 \fB\fB-f\fR \fIfile\fR\fR
223 .sp .6
224 .RS 4n
225 Reads the entry modification information from \fIfile\fR instead of from
226 standard input.
230 .ne 2
232 \fB\fB-?\fR\fR
234 .sp .6
235 .RS 4n
236 Display the usage help text that briefly describes all options.
240 .ne 2
242 \fB\fB-H\fR\fR
244 .sp .6
245 .RS 4n
246 Display the usage help text that briefly describes all options.
250 .ne 2
252 \fB\fB-h\fR \fIldaphost\fR\fR
254 .sp .6
255 .RS 4n
256 Specifies an alternate host on which the LAPD server is running.
260 .ne 2
262 \fB\fB-i\fR \fIlocale\fR\fR
264 .sp .6
265 .RS 4n
266 Specify the character set to use for the \fB-f\fR \fILDIFfile\fR or standard
267 input. The default is the character set specified in the \fBLANG\fR environment
268 variable. You might choose to use this option to perform the conversion from
269 the specified character set to UTF8, thus overriding the \fBLANG\fR setting.
273 .ne 2
275 \fB\fB-j\fR \fIfilename\fR\fR
277 .sp .6
278 .RS 4n
279 Specify a file containing the password for the bind DN or the password for the
280 SSL client's key database. To protect the password, use this option in scripts
281 and place the password in a secure file. This option is mutually exclusive of
282 the \fB-w\fR and \fB-W\fR options.
286 .ne 2
288 \fB\fB-J\fR [:\fIcriticality\fR[:\fIvalue\fR|::\fIb64value\fR|\fIb64value\fR|:\fIfileurl\fR]]\fR
290 .sp .6
291 .RS 4n
292 Criticality is a boolean value (default is \fBfalse\fR).
296 .ne 2
298 \fB\fB-k\fR \fIpath\fR\fR
300 .sp .6
301 .RS 4n
302 Specify the path to a directory containing conversion routines. These routines
303 are used if you want to specify a locale that is not supported by default by
304 your directory server. This is for NLS support.
308 .ne 2
310 \fB\fB-l\fR\fI nb-ldap-connections\fR\fR
312 .sp .6
313 .RS 4n
314 Specifies the number of \fBLDAP\fR connections that \fBldapadd\fR or
315 \fBldapmodify\fR will open to process the modifications in the directory. The
316 default is one connection.
320 .ne 2
322 \fB\fB-M\fR\fR
324 .sp .6
325 .RS 4n
326 Manage smart referrals. When they are the target of the operation, modify the
327 entry containing the referral instead of the entry obtained by following the
328 referral.
332 .ne 2
334 \fB\fB-n\fR \fR
336 .sp .6
337 .RS 4n
338 Previews modifications, but makes no changes to entries. Useful in conjunction
339 with \fB-v\fR and \fB-d\fR for debugging.
343 .ne 2
345 \fB\fB-N\fR \fIcertificate\fR\fR
347 .sp .6
348 .RS 4n
349 Specify the certificate name to use for certificate-based client
350 authentication. For example: \fB-N\fR \fB"Directory-Cert"\fR.
354 .ne 2
356 \fB\fB-o\fR \fIattributename\fR=\fIvalue\fR\fR
358 .sp .6
359 .RS 4n
360 For SASL mechanisms and other options such as security properties, mode of
361 operation, authorization ID, authentication ID, and so forth.
363 The different attribute names and their values are as follows:
365 .ne 2
367 \fB\fBsecProp\fR=\fI"number"\fR\fR
369 .RS 20n
370 For defining SASL security properties.
374 .ne 2
376 \fB\fBrealm\fR=\fI"value"\fR\fR
378 .RS 20n
379 Specifies SASL realm (default is \fBrealm=none\fR).
383 .ne 2
385 \fB\fBauthzid\fR=\fI"value"\fR\fR
387 .RS 20n
388 Specify the authorization ID name for SASL bind.
392 .ne 2
394 \fB\fBauthid\fR=\fI"value"\fR\fR
396 .RS 20n
397 Specify the authentication ID for SASL bind.
401 .ne 2
403 \fB\fBmech\fR=\fI"value"\fR\fR
405 .RS 20n
406 Specifies the various SASL mechanisms.
412 .ne 2
414 \fB\fB-O\fR \fIhopLimit\fR\fR
416 .sp .6
417 .RS 4n
418 Specify the maximum number of referral hops to follow while finding an entry to
419 modify. By default, there is no limit.
423 .ne 2
425 \fB\fB-p\fR \fIldapport\fR \fR
427 .sp .6
428 .RS 4n
429 Specifies an alternate \fBTCP\fR port where the secure LDAP server is
430 listening.
434 .ne 2
436 \fB\fB-P\fR \fIpath\fR\fR
438 .sp .6
439 .RS 4n
440 Specify the path and filename of the client's certificate database. For
441 example:
443 .in +2
445 -P /home/uid/.netscape/cert7.db
447 .in -2
449 When using the command on the same host as the directory server, you can use
450 the server's own certificate database. For example:
452 .in +2
454 -P \fIinstallDir\fR/lapd-serverID/alias/cert7.db
456 .in -2
458 Use the \fB-P\fR option alone to specify server authentication only.
462 .ne 2
464 \fB\fB-r\fR \fR
466 .sp .6
467 .RS 4n
468 Replaces existing value with the specified value. This is the default for
469 \fBldapmodify\fR. When \fBldapadd\fR is called, or if the \fB-a\fR option is
470 specified, the \fB-r\fR option is ignored.
474 .ne 2
476 \fB\fB-v\fR \fR
478 .sp .6
479 .RS 4n
480 Uses verbose mode, with diagnostics written to standard output.
484 .ne 2
486 \fB\fB-V\fR \fIversion\fR\fR
488 .sp .6
489 .RS 4n
490 Specify the LDAP protocol version number to be used for the delete operation,
491 either 2 or 3. LDAP v3 is the default. Specify LDAP v2 when connecting to
492 servers that do not support v3.
496 .ne 2
498 \fB\fB-W\fR \fIpassword\fR\fR
500 .sp .6
501 .RS 4n
502 Specify the password for the client's key database given in the \fB-P\fR
503 option. This option is required for certificate-based client authentication.
504 Specifying \fIpassword\fR on the command line has security issues because the
505 password can be seen by others on the system by means of the \fBps\fR command.
506 Use the \fB-j\fR instead to specify the password from the file. This option is
507 mutually exclusive of \fB-j\fR.
511 .ne 2
513 \fB\fB-w\fR \fIpasswd\fR \fR
515 .sp .6
516 .RS 4n
517 Use \fIpasswd\fR as the password for authentication to the directory. When you
518 use \fB-w\fR\fI passwd\fR to specify the password to be used for
519 authentication, the password is visible to other users of the system by means
520 of the \fBps\fR command, in script files or in shell history. If you use either
521 the \fBldapmodify\fR command or the \fBldapadd\fR command without this option,
522 the command will prompt for the password and read it from standard in. When
523 used without the \fB-w\fR option, the password will not be visible to other
524 users.
528 .ne 2
530 \fB\fB-Y\fR \fIproxyid\fR\fR
532 .sp .6
533 .RS 4n
534 Specify the proxy DN (proxied authorization id) to use for the modify
535 operation, usually in double quotes ("") for the shell.
539 .ne 2
541 \fB\fB-Z\fR\fR
543 .sp .6
544 .RS 4n
545 Specify that SSL be used to provide certificate-based client authentication.
546 This option requires the \fB-N\fR and SSL password and any other of the SSL
547 options needed to identify the certificate and the key database.
550 .SH EXIT STATUS
553 The following exit values are returned:
555 .ne 2
557 \fB\fB0\fR \fR
559 .RS 13n
560 Successful completion.
564 .ne 2
566 \fBNon-zero \fR
568 .RS 13n
569 An error occurred. A diagnostic message is written to standard error.
572 .SH EXAMPLES
575 The format of the content of \fIfile\fR (or standard input if no \fB-f\fR
576 option is specified) is illustrated in the following examples.
578 \fBExample 1 \fRModifying an Entry
581 The file \fB/tmp/entrymods\fR contains the following modification instructions:
584 .in +2
586      dn: cn=Modify Me, o=XYZ, c=US
587     changetype: modify
588     replace: mail
589     mail: modme@atlanta.xyz.com
590     -
591     add: title
592     title: System Manager
593     -
594     add: jpegPhoto
595     jpegPhoto:< file:///tmp/modme.jpeg
596     -
597     delete: description
598     -
600 .in -2
604 The command:
607 .in +2
609 example% \fBldapmodify -r -f /tmp/entrymods\fR
611 .in -2
616 modifies the \fBModify Me\fR entry as follows:
618 .RS +4
621 The current value of the \fBmail\fR attribute is replaced with the value,
622 \fBmodme@atlanta.xyz.com\fR.
624 .RS +4
627 A \fBtitle\fR attribute with the value, \fBSystem Manager\fR, is added.
629 .RS +4
632 A \fBjpegPhoto\fR attribute is added, using the contents of the file,
633 \fB/tmp/modme.jpeg\fR, as the attribute value.
635 .RS +4
638 The \fBdescription\fR attribute is removed.
641 \fBExample 2 \fRCreating a New Entry
644 The file, \fB/tmp/newentry\fR, contains the following information for creating
645 a new entry:
648 .in +2
650     dn: cn=Ann Jones, o=XYZ, c=US
651     objectClass: person
652     cn: Ann Jones
653     cn: Annie Jones
654     sn: Jones
655     title: Director of Research and Development
656     mail: ajones@londonrd.xyz.us.com
657     uid: ajones
659 .in -2
663 The command
666 .in +2
668 example% \fBldapadd -f /tmp/newentry\fR
670 .in -2
675 adds a new entry for \fBAnn Jones\fR, using the information in the file.
678 \fBExample 3 \fRCreating a New Entry on an IPv6 Server
681 The file, \fB/tmp/newentry\fR, contains the following information for creating
682 a new entry: on an IPv6 server.
685 .in +2
687     dn: cn=Ann Jones, o=XYZ, c=US
688     objectClass: person
689     cn: Ann Jones
690     cn: Annie Jones
691     sn: Jones
692     title: Director of Research and Development
693     mail: ajones@londonrd.xyz.us.com
694     uid: ajones
696 .in -2
700 The command
703 .in +2
705 example% \fBldapadd -c -v -h '['fec0::111:a00:20ff:feaa:a364']':389 \e
706                          -D cn=Directory Manager -w secret \e
707                          -f /tmp/entry \fR
709 .in -2
714 adds a new entry for \fBDirectory Manager\fR, using the information in the
715 file.
718 \fBExample 4 \fRDeleting an Entry
721 The file, \fB/tmp/badentry\fR, contains the following information about an
722 entry to be deleted:
725 .in +2
727     dn: cn=Ann Jones, o=XYZ, c=US
728     changetype: delete
730 .in -2
734 The command:
737 .in +2
739 example% \fBldapmodify -f /tmp/badentry\fR
741 .in -2
746 removes Ann Jones' entry.
748 .SH ATTRIBUTES
751 See \fBattributes\fR(5) for a description of the following attributes:
756 box;
757 c | c
758 l | l .
759 ATTRIBUTE TYPE  ATTRIBUTE VALUE
760 Stability Level Evolving
763 .SH SEE ALSO
766 \fBldap\fR(1), \fBldapdelete\fR(1), \fBldaplist\fR(1), \fBldapmodrdn\fR(1),
767 \fBldapsearch\fR(1), \fBldapaddent\fR(8), \fBldap_cachemgr\fR(8),
768 \fBldap_get_option\fR(3LDAP), \fBldap_set_option\fR(3LDAP), \fBattributes\fR(5)