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|:\
293 Criticality is a boolean value (default is \fBfalse\fR).
299 \fB\fB-k\fR \fIpath\fR\fR
303 Specify the path to a directory containing conversion routines. These routines
304 are used if you want to specify a locale that is not supported by default by
305 your directory server. This is for NLS support.
311 \fB\fB-l\fR\fI nb-ldap-connections\fR\fR
315 Specifies the number of \fBLDAP\fR connections that \fBldapadd\fR or
316 \fBldapmodify\fR will open to process the modifications in the directory. The
317 default is one connection.
327 Manage smart referrals. When they are the target of the operation, modify the
328 entry containing the referral instead of the entry obtained by following the
339 Previews modifications, but makes no changes to entries. Useful in conjunction
340 with \fB-v\fR and \fB-d\fR for debugging.
346 \fB\fB-N\fR \fIcertificate\fR\fR
350 Specify the certificate name to use for certificate-based client
351 authentication. For example: \fB-N\fR \fB"Directory-Cert"\fR.
357 \fB\fB-o\fR \fIattributename\fR=\fIvalue\fR\fR
361 For SASL mechanisms and other options such as security properties, mode of
362 operation, authorization ID, authentication ID, and so forth.
364 The different attribute names and their values are as follows:
368 \fB\fBsecProp\fR=\fI"number"\fR\fR
371 For defining SASL security properties.
377 \fB\fBrealm\fR=\fI"value"\fR\fR
380 Specifies SASL realm (default is \fBrealm=none\fR).
386 \fB\fBauthzid\fR=\fI"value"\fR\fR
389 Specify the authorization ID name for SASL bind.
395 \fB\fBauthid\fR=\fI"value"\fR\fR
398 Specify the authentication ID for SASL bind.
404 \fB\fBmech\fR=\fI"value"\fR\fR
407 Specifies the various SASL mechanisms.
415 \fB\fB-O\fR \fIhopLimit\fR\fR
419 Specify the maximum number of referral hops to follow while finding an entry to
420 modify. By default, there is no limit.
426 \fB\fB-p\fR \fIldapport\fR \fR
430 Specifies an alternate \fBTCP\fR port where the secure LDAP server is
437 \fB\fB-P\fR \fIpath\fR\fR
441 Specify the path and filename of the client's certificate database. For
446 -P /home/uid/.netscape/cert7.db
450 When using the command on the same host as the directory server, you can use
451 the server's own certificate database. For example:
455 -P \fIinstallDir\fR/lapd-serverID/alias/cert7.db
459 Use the \fB-P\fR option alone to specify server authentication only.
469 Replaces existing value with the specified value. This is the default for
470 \fBldapmodify\fR. When \fBldapadd\fR is called, or if the \fB-a\fR option is
471 specified, the \fB-r\fR option is ignored.
481 Uses verbose mode, with diagnostics written to standard output.
487 \fB\fB-V\fR \fIversion\fR\fR
491 Specify the LDAP protocol version number to be used for the delete operation,
492 either 2 or 3. LDAP v3 is the default. Specify LDAP v2 when connecting to
493 servers that do not support v3.
499 \fB\fB-W\fR \fIpassword\fR\fR
503 Specify the password for the client's key database given in the \fB-P\fR
504 option. This option is required for certificate-based client authentication.
505 Specifying \fIpassword\fR on the command line has security issues because the
506 password can be seen by others on the system by means of the \fBps\fR command.
507 Use the \fB-j\fR instead to specify the password from the file. This option is
508 mutually exclusive of \fB-j\fR.
514 \fB\fB-w\fR \fIpasswd\fR \fR
518 Use \fIpasswd\fR as the password for authentication to the directory. When you
519 use \fB-w\fR\fI passwd\fR to specify the password to be used for
520 authentication, the password is visible to other users of the system by means
521 of the \fBps\fR command, in script files or in shell history. If you use either
522 the \fBldapmodify\fR command or the \fBldapadd\fR command without this option,
523 the command will prompt for the password and read it from standard in. When
524 used without the \fB-w\fR option, the password will not be visible to other
531 \fB\fB-Y\fR \fIproxyid\fR\fR
535 Specify the proxy DN (proxied authorization id) to use for the modify
536 operation, usually in double quotes ("") for the shell.
546 Specify that SSL be used to provide certificate-based client authentication.
547 This option requires the \fB-N\fR and SSL password and any other of the SSL
548 options needed to identify the certificate and the key database.
554 The following exit values are returned:
561 Successful completion.
570 An error occurred. A diagnostic message is written to standard error.
576 The format of the content of \fIfile\fR (or standard input if no \fB-f\fR
577 option is specified) is illustrated in the following examples.
579 \fBExample 1 \fRModifying an Entry
582 The file \fB/tmp/entrymods\fR contains the following modification instructions:
587 dn: cn=Modify Me, o=XYZ, c=US
590 mail: modme@atlanta.xyz.com
593 title: System Manager
596 jpegPhoto:< file:///tmp/modme.jpeg
610 example% \fBldapmodify -r -f /tmp/entrymods\fR
617 modifies the \fBModify Me\fR entry as follows:
622 The current value of the \fBmail\fR attribute is replaced with the value,
623 \fBmodme@atlanta.xyz.com\fR.
628 A \fBtitle\fR attribute with the value, \fBSystem Manager\fR, is added.
633 A \fBjpegPhoto\fR attribute is added, using the contents of the file,
634 \fB/tmp/modme.jpeg\fR, as the attribute value.
639 The \fBdescription\fR attribute is removed.
642 \fBExample 2 \fRCreating a New Entry
645 The file, \fB/tmp/newentry\fR, contains the following information for creating
651 dn: cn=Ann Jones, o=XYZ, c=US
656 title: Director of Research and Development
657 mail: ajones@londonrd.xyz.us.com
669 example% \fBldapadd -f /tmp/newentry\fR
676 adds a new entry for \fBAnn Jones\fR, using the information in the file.
679 \fBExample 3 \fRCreating a New Entry on an IPv6 Server
682 The file, \fB/tmp/newentry\fR, contains the following information for creating
683 a new entry: on an IPv6 server.
688 dn: cn=Ann Jones, o=XYZ, c=US
693 title: Director of Research and Development
694 mail: ajones@londonrd.xyz.us.com
706 example% \fBldapadd -c -v -h '['fec0::111:a00:20ff:feaa:a364']':389 \e
707 -D cn=Directory Manager -w secret \e
715 adds a new entry for \fBDirectory Manager\fR, using the information in the
719 \fBExample 4 \fRDeleting an Entry
722 The file, \fB/tmp/badentry\fR, contains the following information about an
728 dn: cn=Ann Jones, o=XYZ, c=US
740 example% \fBldapmodify -f /tmp/badentry\fR
747 removes Ann Jones' entry.
752 See \fBattributes\fR(5) for a description of the following attributes:
760 ATTRIBUTE TYPE ATTRIBUTE VALUE
761 Stability Level Evolving
767 \fBldap\fR(1), \fBldapdelete\fR(1), \fBldaplist\fR(1), \fBldapmodrdn\fR(1),
768 \fBldapsearch\fR(1), \fBldapaddent\fR(1M), \fBldap_cachemgr\fR(1M),
769 \fBldap_get_option\fR(3LDAP), \fBldap_set_option\fR(3LDAP), \fBattributes\fR(5)