Exit Print View

Sun OpenDS Standard Edition 2.0 Administration Guide

Get PDF Book Print View
 

Document Information

Configuring the Directory Server

Configuring Security in the Directory Server

Managing Directory Data

Importing and Exporting Data

Populating a Stand-Alone Directory Server With Data

Importing Data Using import-ldif

To Import Data in Offline Mode

To Replace Existing Data During an Offline Import

To Append Imported Data to Existing Data

To Import Fractional Files

To Import Fractional Files by Using Filters

To Include or Exclude Attributes During Import

To Import a Compressed LDIF File

To Record Rejected or Skipped Entries During Import

To Import Data From a MakeLDIF Template

To Run an Import in Online Mode

To Schedule an Import

Exporting Data Using export-ldif

To Export Data to LDIF

To Export Partial Data

To Export Part of a Back End by Using Filters

To Include or Exclude Attributes During Export

To Export to LDIF and Then Compress the File

To Run an Export in Online Mode

To Schedule an Export

Importing and Exporting Entries With the Control Panel

To Import Entries With the Control Panel

To Export Entries to an LDIF File With the Control Panel

Creating MakeLDIF Template Files

The Template File Format

make-ldif Template File Tags

Defining Custom Tags

Backing Up and Restoring Data

Overview of the Backup and Restore Process

Backing Up Data

To Back Up All Back Ends

To Back Up All Back Ends with Encryption and Signed Hashes

To Perform an Incremental Backup on All Back Ends

To Back Up a Specific Back End

To Perform an Incremental Backup on a Specific Back End

To Schedule a Backup as a Task

Backing Up the Server Configuration

Backing Up for Disaster Recovery

To Back Up the Directory Server For Disaster Recovery

Restoring Data

To Restore a Back End

To Restore a Back End From Incremental Backups

To Schedule a Restore as a Task

To Restore the Configuration File

To Restore a Directory Server During Disaster Recovery

Restoring Replicated Directory Servers

Backing Up and Restoring Directory Data With the Control Panel

To Back Up Data With the Control Panel

To Restore Data With the Control Panel

Searching Directory Data

Overview of the ldapsearch Command

ldapsearch Location and Format

Understanding Search Criteria

ldapsearch Examples

To Return All Entries

To Search For a Specific User

To Search for Specific User Attributes

To Perform a Search With Base Scope

To Perform a Search With One-Level Scope

To Perform a Search With Subtree Scope

To Return Attribute Names Only

To Return User Attributes Only

To Return Base DNs Only

To Search For Specific Object Classes

To Return a Count of All Entries in the Directory

To Perform a Search With a Compound Filter

To Perform a Search Using a Filter File

To Limit the Number of Entries Returned in a Search

Using Advanced Search Features

Searching for Special Entries and Attributes

To Search for Operational Attributes

To Search the Root DSE Entry

To Search for ACI Attributes

To Search the Schema Entry

To Search the Configuration Entry

To Search the Monitoring Entry

Searching Over SSL

To Search Over SSL With Blind Trust

To Search Over SSL Using a Trust Store

To Search Over SSL With No Trust Store

To Search Over SSL Using a Keystore

To Search Using StartTLS

To Search Using SASL With DIGEST-MD5 Client Authentication

To Search Using SASL With the GSSAPI Mechanism

To Search Using SASL With the PLAIN Mechanism

Searching Using Controls

To View the Available Controls

To Search Using the Account Usability Request Control

To Search Using the Authorization Identity Request Control

To Search Using the Get Effective Rights Control

To Search Using the LDAP Assertion Control

To Search Using the LDAP Subentry Control

To Search Using the Manage DSA IT Control

To Search Using the Matched Values Filter Control

To Search Using the Password Policy Control

To Search Using the Persistent Search Control

To Search Using the Proxied Authorization Control

To Search Using the Server-Side Sort Control

To Search Using the Simple Paged Results Control

Searching Using the Virtual List View Control

To Search Using the Virtual List View Control

To Search Using Virtual List View With a Specific Target

To Search Using Virtual List View With a Known Total

Searching in Verbose Mode and With a Properties File

To Search in Verbose Mode

To Search Using a Properties File

Searching Internationalized Entries

Adding, Modifying, and Deleting Directory Data

Adding Directory Entries

To Create a Root Entry

To Add an Entry Using the --defaultAdd Option With ldapmodify

To Add Entries Using an LDIF Update Statement With ldapmodify

Adding Attributes

To Add an Attribute to an Entry

To Add an ACI Attribute

To Add an International Attribute

Modifying Directory Entries

To Modify an Attribute Value

To Modify an Attribute With Before and After Snapshots

To Delete an Attribute

To Change an RDN

To Move an Entry

Deleting Directory Entries

To Delete an Entry With ldapmodify

To Delete an Entry With ldapdelete

To Delete Multiple Entries by Using a DN File

Indexing Directory Data

Configuring Indexes on the Local DB Back End

To Create a New Local DB Index

Configuring VLV Indexes

To Create a New VLV Index

Managing Indexes With the Control Panel

To Display a List of Indexes

To Add an Index

To Add a VLV Index

To Delete an Index

To Verify Indexes

To Rebuild Indexes

Reducing Stored Data Size

To Enable or Disable Compact Encoding

To Enable or Disable Entry Compression

Managing Directory Data With the Control Panel

Managing Entries With the Control Panel

To Display A List of All Directory Entries

To Add a New Entry With the Control Panel

To Add a New Entry From an LDIF Specification With the Control Panel

To Change the Values of an Entry's Attributes With the Control Panel

To Delete an Entry With the Control Panel

Managing Base DNs With the Control Panel

Adding a New Base DN

Deleting a Base DN

Copying an Entry's DN to the Clipboard

Managing Users

To Reset a User's Password

To Create a Group

To Add a User to a Group

Deleting a Back End With the Control Panel

To Delete a Back End With the Control Panel

Selecting a View of Entry Data

To Select a View of Entry Data

Ensuring Attribute Value Uniqueness

Overview of the Unique Attribute Plug-In

Configuring the Unique Attribute Plug-In Using dsconfig

To Ensure Uniqueness of the Value of the uid Attribute

To Ensure Uniqueness of the Value of Any Other Attribute

Replication and the Unique Attribute Plug-In

Configuring Virtual Attributes

To List the Existing Virtual Attributes

To Create a New Virtual Attribute

To Enable or Disable a Virtual Attribute

To Display the Configuration of a Virtual Attribute

To Change the Configuration of a Virtual Attribute

Configuring Referrals

Configuring LDAP URLs

To Create a Referral

To Modify a Referral

To Delete a Referral

Controlling Access To Data

Replicating Data

Managing Users and Groups

Directory Server Monitoring

Improving Performance

Advanced Administration

Adding Directory Entries

You can add one or more entries to a directory server by using the ldapmodify command. ldapmodify opens a connection to the directory server, binds to it, and performs the modification to the database (in this case, an "add") as specified by the command-line options.

ldapmodify enables you to add entries in one of two ways:


Note - Any newly added entry must conform to the directory's schema. If you add any entry that does not conform to the schema, the server responds with an Object Class Violation error. You can view the details of the error in the errors log.


To Create a Root Entry

The root entry is the topmost entry in the directory and must contain the naming context, or root suffix. You can set up the root entry when you first install the directory server using the graphical user interface (GUI) or the command-line. If you install the directory without any data, create a root entry using the ldapmodify command with the --defaultAdd option.

  1. Create the root entry using ldapmodify.
    $ ldapmodify --hostname localhost --port 1389 --defaultAdd \
      --bindDN "cn=Directory Manager" --bindPassword password
    dn: dc=example,dc=com
    objectclass: domain
    objectclass: top
    dc: example
    (Press Ctrl-D on Unix, Linux)
    (Press Ctrl-Z on Windows), then press ENTER.
    
    Processing ADD request for dc=example,dc=com
    ADD operation successful for DN dc=example,dc=com

    Note - The --bindDN and --bindPassword options specify the bind DN and password, respectively, of the user with permissions to add new entiries. You can provide the clear-text version of the password. The server encrypts this value and store only the encrypted one. Be sure to limit read permissions to protect clear passwords that appear in LDIF files. To avoid this security issue, use SSL or startTLS.


  2. Verify the change by using the ldapsearch command.
    $ ldapsearch --hostname localhost --port 1389 --baseDN "dc=example,dc=com" \
      --searchScope base --bindDN "cn=Directory Manager" --bindPassword password \
      "(objectclass=*)"
    dn: dc=example,dc=com
    objectClass: domain
    objectClass: top
    dc: example

To Add an Entry Using the --defaultAdd Option With ldapmodify

  1. Create your directory entry in LDIF format.

    Before you add an entry, ensure that the suffix to which you want to add the entry exists in your database (for example, ou=People,dc=example,dc=com).

    For this example, create an input file called new.ldif with the following contents:

    dn: uid=Marcia Garza,ou=People,dc=example,dc=com
    cn: Marcia Garza
    sn: Garza
    givenName: Marcia
    objectClass: top
    objectClass: person
    objectClass: organizationalPerson
    objectClass: inetOrgPerson
    ou: Accounting
    ou: People
    l: Santa Clara
    uid: mgarza
    mail: mgarza@example.com
    roomnumber: 5484
    userpassword: donuts
  2. Add the entry using ldapmodify with the --defaultAdd option.
    $ ldapmodify --hostname localhost --port 1389 --bindDN "cn=Directory Manager" \
      --bindPassword password --defaultAdd --filename /tmp/new.ldif

To Add Entries Using an LDIF Update Statement With ldapmodify

  1. Create the entry in LDIF format with the changetype:add element.

    Make sure that there are no trailing spaces after add. If a space exists after add, the server base-64 encodes the value to represent the space, which can cause problems.

    For this example, create an input LDIF file named new.ldif.

    dn: uid=Marcia Garza,ou=People,dc=example,dc=com
    changetype: add
    cn: Marcia Garza
    sn: Garza
    givenName: Marcia
    objectClass: top
    objectClass: person
    objectClass: organizationalPerson
    objectClass: inetOrgPerson
    ou: Accounting
    ou: People
    l: Santa Clara
    uid: mgarza
    mail: mgarza@example.com
    roomnumber: 5484
    userpassword: donuts
  2. Add the entry using ldapmodify.

    Do not include the -a option as the changetype attribute specifies the action.

    $ ldapmodify --hostname localhost --port 1389 --bindDN "cn=Directory Manager" \
      --bindPassword password --filename /tmp/new.ldif
    
    Processing ADD request for uid=Marcia Garza,ou=People,dc=example,dc=com
    ADD operation successful for DN uid=Marcia Garza,ou=People,dc=example,dc=com