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"
9 ldapmodify, ldapadd \- ldap entry addition and modification tools
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]
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]
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
45 Both \fBldapadd\fR and \fBldapmodify\fR reject duplicate attribute-name/value
46 pairs for the same entry.
50 The following options are supported:
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.
69 Non-ASCII mode: display non-ASCII values, in conjunction with the \fB-v\fR
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.
92 \fB\fB-B\fR\ \fIbaseDN\fR\fR
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.
108 Specifies continuous operation mode. Errors are reported, but \fBldapmodify\fR
109 and \fBldapadd\fR continue with modifications. The default is to exit after
116 \fB\fB-D\fR \fIbindDN\fR \fR
120 Uses the distinguished name \fIbindDN\fR to bind to the directory.
126 \fB\fB-d\fR \fIdebuglevel\fR\fR
130 Sets the \fBLDAP\fR debugging level. Useful levels of debugging for
131 \fBldapmodify\fR and \fBldapadd\fR are:
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
185 \fB\fB-e\fR\ \fIerrorFile\fR\fR
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
201 Ask server to expose (report) bind identity by means of authentication response
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.
221 \fB\fB-f\fR \fIfile\fR\fR
225 Reads the entry modification information from \fIfile\fR instead of from
236 Display the usage help text that briefly describes all options.
246 Display the usage help text that briefly describes all options.
252 \fB\fB-h\fR \fIldaphost\fR\fR
256 Specifies an alternate host on which the LAPD server is running.
262 \fB\fB-i\fR \fIlocale\fR\fR
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.
275 \fB\fB-j\fR \fIfilename\fR\fR
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.
288 \fB\fB-J\fR [:\fIcriticality\fR[:\fIvalue\fR|::\fIb64value\fR|\fIb64value\fR|:\fIfileurl\fR]]\fR
292 Criticality is a boolean value (default is \fBfalse\fR).
298 \fB\fB-k\fR \fIpath\fR\fR
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.
310 \fB\fB-l\fR\fI nb-ldap-connections\fR\fR
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.
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
338 Previews modifications, but makes no changes to entries. Useful in conjunction
339 with \fB-v\fR and \fB-d\fR for debugging.
345 \fB\fB-N\fR \fIcertificate\fR\fR
349 Specify the certificate name to use for certificate-based client
350 authentication. For example: \fB-N\fR \fB"Directory-Cert"\fR.
356 \fB\fB-o\fR \fIattributename\fR=\fIvalue\fR\fR
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:
367 \fB\fBsecProp\fR=\fI"number"\fR\fR
370 For defining SASL security properties.
376 \fB\fBrealm\fR=\fI"value"\fR\fR
379 Specifies SASL realm (default is \fBrealm=none\fR).
385 \fB\fBauthzid\fR=\fI"value"\fR\fR
388 Specify the authorization ID name for SASL bind.
394 \fB\fBauthid\fR=\fI"value"\fR\fR
397 Specify the authentication ID for SASL bind.
403 \fB\fBmech\fR=\fI"value"\fR\fR
406 Specifies the various SASL mechanisms.
414 \fB\fB-O\fR \fIhopLimit\fR\fR
418 Specify the maximum number of referral hops to follow while finding an entry to
419 modify. By default, there is no limit.
425 \fB\fB-p\fR \fIldapport\fR \fR
429 Specifies an alternate \fBTCP\fR port where the secure LDAP server is
436 \fB\fB-P\fR \fIpath\fR\fR
440 Specify the path and filename of the client's certificate database. For
445 -P /home/uid/.netscape/cert7.db
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:
454 -P \fIinstallDir\fR/lapd-serverID/alias/cert7.db
458 Use the \fB-P\fR option alone to specify server authentication only.
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.
480 Uses verbose mode, with diagnostics written to standard output.
486 \fB\fB-V\fR \fIversion\fR\fR
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.
498 \fB\fB-W\fR \fIpassword\fR\fR
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.
513 \fB\fB-w\fR \fIpasswd\fR \fR
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
530 \fB\fB-Y\fR \fIproxyid\fR\fR
534 Specify the proxy DN (proxied authorization id) to use for the modify
535 operation, usually in double quotes ("") for the shell.
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.
553 The following exit values are returned:
560 Successful completion.
569 An error occurred. A diagnostic message is written to standard error.
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:
586 dn: cn=Modify Me, o=XYZ, c=US
589 mail: modme@atlanta.xyz.com
592 title: System Manager
595 jpegPhoto:< file:///tmp/modme.jpeg
609 example% \fBldapmodify -r -f /tmp/entrymods\fR
616 modifies the \fBModify Me\fR entry as follows:
621 The current value of the \fBmail\fR attribute is replaced with the value,
622 \fBmodme@atlanta.xyz.com\fR.
627 A \fBtitle\fR attribute with the value, \fBSystem Manager\fR, is added.
632 A \fBjpegPhoto\fR attribute is added, using the contents of the file,
633 \fB/tmp/modme.jpeg\fR, as the attribute value.
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
650 dn: cn=Ann Jones, o=XYZ, c=US
655 title: Director of Research and Development
656 mail: ajones@londonrd.xyz.us.com
668 example% \fBldapadd -f /tmp/newentry\fR
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.
687 dn: cn=Ann Jones, o=XYZ, c=US
692 title: Director of Research and Development
693 mail: ajones@londonrd.xyz.us.com
705 example% \fBldapadd -c -v -h '['fec0::111:a00:20ff:feaa:a364']':389 \e
706 -D cn=Directory Manager -w secret \e
714 adds a new entry for \fBDirectory Manager\fR, using the information in the
718 \fBExample 4 \fRDeleting an Entry
721 The file, \fB/tmp/badentry\fR, contains the following information about an
727 dn: cn=Ann Jones, o=XYZ, c=US
739 example% \fBldapmodify -f /tmp/badentry\fR
746 removes Ann Jones' entry.
751 See \fBattributes\fR(5) for a description of the following attributes:
759 ATTRIBUTE TYPE ATTRIBUTE VALUE
760 Stability Level Evolving
766 \fBldap\fR(1), \fBldapdelete\fR(1), \fBldaplist\fR(1), \fBldapmodrdn\fR(1),
767 \fBldapsearch\fR(1), \fBldapaddent\fR(1M), \fBldap_cachemgr\fR(1M),
768 \fBldap_get_option\fR(3LDAP), \fBldap_set_option\fR(3LDAP), \fBattributes\fR(5)