[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Adding Initial Entries via ldapadd and ldif file


you must first create a dcObject for your directory, which in your case would be:

dn: dc=pvpsc,dc=com
objectClass: dcObject
objectClass: organization
dc: pvpsc
o: Description

If you insert that with ldapadd first, then you can create the rest.

Hope that helps,


On Thu, 4 Aug 2005, Peter Stickney wrote:

OpenLdap is up and running. I am now having a problem adding the initial groups and a member of a group via ldapadd and an ldif file.
Below are slapd.conf, the ldif file and the output of ldapadd. Help is greatly appreciated.


----- slapd.conf ----
include         /usr/local/openldap/etc/openldap/schema/core.schema
include         /usr/local/openldap/etc/openldap/schema/cosine.schema
include         /usr/local/openldap/etc/openldap/schema/inetorgperson.schema
include         /usr/local/openldap/etc/openldap/schema/nis.schema
include         /usr/local/openldap/etc/openldap/schema/misc.schema

allow bind_v2
pidfile         /usr/local/openldap/var/run/slapd.pid
argsfile        /usr/local/openldap/var/run/slapd.args

database        bdb
suffix          "dc=pvpsc,dc=com"
rootdn          "cn=Manager,dc=pvpsc,dc=com"
rootpw          {SSHA}OFtABbCu+5cCmBFIo38TMD4jSopvhppI
directory       /usr/local/openldap/var/openldap-data
index   objectClass     eq

------ ldif file --------

dn: ou=People,dc=pvpsc,dc=com
ou: People
objectClass: top
objectClass: organizationalUnit
description: Parent object of all UNIX accounts

dn: ou=Groups,dc=pvpsc,dc=com
ou: Groups
objectClass: top
objectClass: organizationalUnit
description: Parent object of all UNIX groups

dn: cn=pstickney,ou=People,dc=pvpsc,dc=com
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: inetLocalMailRecipient
objectClass: shadowAccount
uid: pstickney
sn: Stickney
givenName: Peter
cn: pstickney
userPassword:: p455\^/0rD
loginShell: /bin/bash
uidNumber: 1000
gidNumber: 100
homeDirectory: /home/pstickney
gecos: Peter Stickney,IT,x105
mail: pstickney@pvpsc.com
telephoneNumber: x105
labeledURI: http://www.pvpsc.com
description: peters openldap
homePostalAddress: 123 main street
displayName: Peter M. Stickney
homePhone: 401-555-1234
title: Network Admin

dn: cn=staff,ou=Groups,dc=linuxlaboratory,dc=org
objectClass: posixGroup
objectClass: top
cn: staff
gidNumber: 100
memberUid: pstickney

root@kodos:/usr/local/openldap/bin# ./ldapadd -x -W -D 'cn=Manager,dc=pvpsc,dc=com' -f ../ldif/pvpsc.ldif -c
Enter LDAP Password:
adding new entry "ou=People,dc=pvpsc,dc=com"
ldap_add: No such object (32)

adding new entry "ou=Groups,dc=pvpsc,dc=com"
ldap_add: No such object (32)

ldapadd: invalid format (line 13) entry: "cn=pstickney,ou=People,dc=pvpsc,dc=com"
adding new entry "cn=staff,ou=Groups,dc=linuxlaboratory,dc=org"
ldap_add: Server is unwilling to perform (53)
additional info: no global superior knowledge