Creating a Root Entry from the

see Section 4, “LDIF Update Statements”.

The ldapmodify and ldapdelete utilities read the statements that you enter in exactly the same way as if they were read from a file. When all of the input has been entered, enter the character that the shell recognizes as the end of file (EOF) escape sequence. The utility then begins operations based on the supplied inputs.

While the EOF escape sequence depends on the type of machine, the EOF escape sequence almost always control-D (^D).

For example, to input some LDIF update statements to ldapmodify, you would do the following:

ldapmodify -DbindDN -wpassword -hhostname

dn: cn=Barry Nixon, ou=people, dc=example,dc=com

changetype: modify

delete: telephonenumber

-

add: manager

manager: cn=Harry Cruise, ou=people, dc=example,dc=com ^D

When adding an entry from the command line or from LDIF, make sure that an entry representing a subtree is created before new entries are created under that branch. For example, to place an entry in a People subtree, create an entry representing that subtree before creating entries within the subtree. For example:

dn: dc=example,dc=com

dn: ou=People, dc=example,dc=com

...People subtree entries. ...

dn: ou=Group, dc=example,dc=com

...Group subtree entries. ...

2.2. Creating a Root Entry from the Command-Line

The ldapmodify command-line utility can be used to create a new root entry in a database. For example:

ldapmodify -a -D bindDN -w password

The ldapmodify utility binds to the server and prepares it to add an entry. The new root object can then be added, as follows:

dn: Suffix_Name

1The LDAP tools referenced in this guide are Mozilla LDAP, installed with Directory Server in the

/usr/lib/mozldap directory on Red Hat Enterprise Linux 5 i386; directories for other platforms are listed in Section 2, “LDAP Tool Locations”. However, Red Hat Enterprise Linux systems also include LDAP tools from OpenLDAP. It is possible to use the OpenLDAP commands as shown in the examples, but you must use the -xargument to disable SASL and allow simple authentication.

25

Page 45
Image 45
HP UX Red Hat Direry Server Software manual Creating a Root Entry from the Command-Line, See , Ldif Update Statements