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

Re: ldapadd



Jubal,
I'm new to LDAP, so this could be wrong, but wouldn't
your first entry be defined in slapd.conf (as your
"suffix")?

Anyway, here's a slapd.conf configuration I used along
with the ldapadd command and the ldif file (which I
borrowed from the jakarta tomcat user manual). Maybe
that will help?? Hope so.
Ryan

##slapd.conf ENTRIES###
database        ldbm
suffix          "dc=myserver, dc=com"
rootdn          "cn=Manager, dc=myserver, dc=com"
# Use of strong authentication encouraged.
rootpw          whatever

###COMMAND###
ldapadd -x -D "cn=Manager,dc=myserver,dc=com" -W -f
tomcat-user.ldif


###tomcat-user.ldif file###
# Define a user named 'tomcat'
dn: cn=tomcat,dc=myserver,dc=com
cn: tomcat
userPassword: tomcat
sn: Tomcat User
objectClass: person



# Define a user named 'role1'
dn: cn=role1,dc=myserver,dc=com
cn: role1
userPassword: tomcat
sn: Role1 User
objectClass: person



# Define a user named 'both'
dn: cn=both,dc=myserver,dc=com
cn: both
userPassword: tomcat
sn: Both User
objectClass: person



# Define an entry to base role searches on
dn: dc=roles,dc=myserver,dc=com
cn: roles
objectClass: person
sn: Roles Entry



# Define all members of the 'tomcat' role
dn: cn=tomcat,dc=roles,dc=myserver,dc=com
cn: tomcat
objectClass: groupOfUniqueNames
uniqueMember: cn=tomcat,dc=myserver,dc=com
uniqueMember: cn=both,dc=myserver,dc=com



# Define all members of the 'role1' role
dn: cn=role1,dc=roles,dc=myserver,dc=com
cn: role1
objectClass: groupOfUniqueNames
uniqueMember: cn=role1,dc=myserver,dc=com
uniqueMember: cn=both,dc=myserver,dc=com






 
--- Jubal Molina <agro_jubal@yahoo.com> wrote:
>   I'm sorry i typed it wrong when I send the email.
> I
> had put in the -D option. 
> The ldif file goes something like:
> 
> dn: o=Myorg
> objectClass: top
> objectClass: organization
> o: Myorg
> description: My org
> 
> dn: cn=LdapAdmin,o=Myorg
> objectClass: organizationalRole
> cn: LdapAdmin
> description: LDAP Directory Administrator
> 
> dn: cn=First Last,o=Myorg
> cn: First Last
> objectClass: top
> objectClass: person
> objectClass: organizationalPerson
> objectClass: inetOrgPerson
> mail: First.Last@somemail.net
> givenName: First
> sn: Last
> userPassword: pass
> 
> If I delete the first entry from the ldif it will
> import the next one. 
> 
>  Thanks for replying so quickly.
> 
> --- Ryan <niespam@yahoo.com> wrote:
> > Jubal,
> > It looks like you forgot the -D option.
> > 
> > ldapadd -x -h 127.0.0.1 -p 389 -D
> > "cn=LdapAdmin,o=Myorg"
> > 
> > Should work, if not, you need to include more
> > information, such as the contents of the ldif
> file.
> > 
> > Ryan
> > 
> > 
> > --- Jubal Molina <agro_jubal@yahoo.com> wrote:
> > > Hi:
> > >   I'am trying to use add an Ldif file using
> > ldapadd.
> > > The problem I'm having is that it only imports
> the
> > > first entry. 
> > > I have search google groups and the archives
> > looking
> > > for something like ldapadd one entry and have
> been
> > > unable to find any help. 
> > > I'm using openldap 2.0.21-0.7.1.i386. The
> command
> > > I'm
> > > using is 
> > > ldapadd -x -h 127.0.0.1 -p 389 "cn=LdapAdmin,
> > > o=Myorg"
> > > -w mypass -f export.ldif.
> > >   Is there anything on the slapd.conf that has
> to
> > do
> > > with this?
> > >  I appreciate any help on this issue. I
> appologize
> > > if
> > > I post it to the wrong email
> > >   Jubal
> > > 
> > >
> __________________________________________________
> > > Do You Yahoo!?
> > > Yahoo! - Official partner of 2002 FIFA World Cup
> > > http://fifaworldcup.yahoo.com
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! - Official partner of 2002 FIFA World Cup
> > http://fifaworldcup.yahoo.com
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com