Hello. Doing some school work here. But cant get it to work.

Have this ldif file from the teacher slapcat.ldif that is supposed to initialize the database. Cant add it to the database.

But first things first, these packages are installed:
apt-get install slapd ldap-utils libnss-ldap libpam-ldap nscd cpu

/etc/nsswitch.conf is changed to contain these modified lines:
passwd: compat ldap
group: compat ldap
shadow: compat ldap

All configured to use admin and not manager. And dc=localdomain
/etc/pam.d and its files using "required pam_unix.so" have been added a line with "sufficient pam_ldap." /etc/init.d/slapd then restartet, as well as /etc/init.d/nscd

I use slapcat to check everything, heres the output:
dn: dc=localdomain
objectClass: top
objectClass: dcObject
objectClass: organization
o: localdomain
dc: localdomain
structuralObjectClass: organization
entryUUID: 40b4c700-b2f5-102c-9116-17607c266e3c
creatorsName:
modifiersName:
createTimestamp: 20080510155527Z
modifyTimestamp: 20080510155527Z
entryCSN: 20080510155527Z#000000#00#000000

dn: cn=admin,dc=localdomain
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: admin
description: LDAP administrator
userPassword:: e2NyeXB0fVpDem5CVVh6NDR0c0k=
structuralObjectClass: organizationalRole
entryUUID: 40b82eea-b2f5-102c-9117-17607c266e3c
creatorsName:
modifiersName:
createTimestamp: 20080510155527Z
modifyTimestamp: 20080510155527Z
entryCSN: 20080510155527Z#000001#00#000000

Added initdb.ldif after staring /etc/init.d/slapd again.
ldapadd -x -W -a -D "cn=admin,dc=localdomain -f initdb.ldif
That file looks like this:

dn: cn=nss,dc=localdomain
objectClass: organizationalRole
objectClass: simpleSecurityObject
cn: nss
description: LDAP NSS user for user-lookups
userPassword:: 0NSWVBUfXh4eHh4eHh4eHg=9

dn: ou=People,dc=localdomain
objectClass: organizationalUnit
objectClass: top
ou: People

dn: ou=Group,dc=localdomain
objectClass: top
objectClass: organizationalUnit
ou: Group


Made a homefolder for joe:
mkdir /home/joe
added joe:
ldapadd -x -W -a -D "cn=admin,dc=localdomain" -f joe.ldif
That file looks like this:
dn: uid=joe,ou=People,dc=localdomain
uid: joe
sn: User
cn: Joe User
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: top
loginShell: /bin/bash
uidNumber: 3002
gidNumber: 501
homeDirectory: /home/joe


Tried:
chown joe /home/joe
Got message: invalid user.
Understandable, since joe is not in /etc/passwd and /etc/shadow, but what then?

I changed /etc/cpu/cpu.conf to contain the right setup according to my system.
I then tried "cpu cat", and got to see the user I added.

Tried again:
chown joe /home/joe
Got the errormessage: invalid user again?
Added nate with cpu useradd nate, chown didnt recognize him either.
Added password for nate: cpu usermod nate -w xxxxx

Tried to log in as nate: su nate
The system did not know of any nate.
Same thing for joe.

I restart the system and cant login as either nate or joe.
I log in with my standard user, and notice that I now have to type my password twice to access.

I then installed phpldapadmin and could not log in as nate/joe or admin. But I can connect as anonymous.

Something is wrong folks!
But what is it?