[ Team LiB ] Previous Section Next Section

B.2 Slap Tools

The collection of slap tools included with OpenLDAP are provided to import and export data directly from the DB files used for supporting an OpenLDAP server.

B.2.1 slapadd(8c)

This tool reads LDIF entries from a file or standard input and writes the new records to a slapd database (see Table B-2).

Table B-2. Summary of slapadd command-line arguments

Option

Description

-c

Continues processing input in the event of errors.

-b suffix-n integer

Specify which database in the configuration file to use by the directory's suffix (-b) or by its location (-n) in the slapd.conf file (the first database listed is numbered 0). These options are mutually exclusive.

-d integer

Specifies which debugging information to log. See the loglevel parameter in slapd.conf for a listing of log levels.

-f filename

Specifies which configuration file to read.

-l filename

Specifies the LDIF file to use for input. In the absence of this option, slapadd reads data from standard input.

-v

Enables verbose mode.

B.2.2 slapcat(8c)

This tool reads records from a slapd database and writes them to a file or standard output (see Table B-3).

Table B-3. Summary of slapcat command-line arguments

Option

Description

-c

Continues processing input in the event of errors.

-b suffix-n integer

Specify which database in the configuration file to use by the directory's suffix (-b) or by its location (-n) in the slapd.conf file (the first database listed is numbered 0). These options are mutually exclusive.

-d integer

Specifies which debugging information to log. See the loglevel parameter in slapd.conf for a listing of log levels.

-f filename

Specifies which configuration file to read.

-l filename

Specifies the name of the file to which the LDIF entries should be written. In the absence of this option, slapcat writes data to standard output.

-v

Enables verbose mode.

B.2.3 slapindex(8c)

This tool regenerates the indexes in a slapd database (see Table B-4).

Table B-4. Summary of slapindex command-line arguments

Option

Description

-c

Continues processing input in the event of errors.

-b suffix-n integer

Specify which database in the configuration file to use by the directory's suffix (-b) or by its location (-n) in the slapd.conf file (the first database listed is numbered 0). These options are mutually exclusive.

-d integer

Specifies which debugging information to log. See the loglevel parameter in slapd.conf for a listing of log levels.

-f filename

Specifies which configuration file to read.

-v

Enables verbose mode.

B.2.4 slappasswd(8c)

This tool generates a password hash suitable for use as an Lq in slapd.conf (see Table B-5).

Table B-5. Summary of slappasswd command-line arguments

Option

Description

-c crypt-salt-format

Defines the format of the salt used when invoking the crypt( ) function to generate a password suitable for use with {CRYPT}. The string must be in the snprintf( ) format and must contain a single %s conversion.

-h hash

Defines the hash algorithm to use. Possible values are {CRYPT}, {MD5}, {SMD5}, {SSHA}, and {SHA}. The default is {SSHA}.

-s secret

Specifies the password to hash.

-u

Instructs slappasswd to generate password syntaxes for the userPassword attribute (the default) and is included for forward compatibility. No other syntaxes are currently supported.

-v

Enables verbose mode.

    [ Team LiB ] Previous Section Next Section