# LDAP installation and configuration



## NuLL3rr0r (Nov 24, 2013)

Hi there,

I've installed and configured LDAP using FreeBSD's own handbook. Also, I've configured LDAP with TLS support and it seems `ldapsearch` connects sucessfully.


```
redaemon babaei # ldapsearch
# extended LDIF
#
# LDAPv3
# base <dc=redaemon,dc=net> (default) with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

# search result
search: 2
result: 32 No such object

# numResponses: 1
```

I don't know what that _32 No such object_ means anyway. The issue that I have with LDAP is whatever ldif entry that I wrote seems invalid to ldap_add.

I even copied ldif enteries from FreeBSD handbook with minimum modification (just changed the domain name), but it refuses to add them.


```
dn: ou=people,dc=redaemon,dc=net
objectClass: top
objectClass: organizationalUnit
ou: people

dn: uid=tuser,ou=people,dc=redaemon,dc=net
objectClass: person
objectClass: posixAccount
objectClass: shadowAccount
objectClass: top
uidNumber: 10000
gidNumber: 10000
homeDirectory: /home/tuser
loginShell: /bin/csh
uid: tuser
cn: tuser

dn: ou=groups,dc=redaemon,dc=net
objectClass: top
objectClass: organizationalUnit
ou: groups

dn: cn=tuser,ou=groups,dc=redaemon,dc=net
objectClass: posixGroup
objectClass: top
gidNumber: 10000
cn: tuser
```

This is how I add the above ldif entries and what I get:

```
redaemon babaei # ldapadd -cxWD cn=root,dc=redaemon,dc=net -f add-user.ldif
Enter LDAP Password:
adding new entry "ou=people,dc=redaemon,dc=net"
ldap_add: No such object (32)

adding new entry "uid=tuser,ou=people,dc=redaemon,dc=net"
ldap_add: Invalid syntax (21)
        additional info: objectClass: value #1 invalid per syntax

adding new entry "ou=groups,dc=redaemon,dc=net"
ldap_add: No such object (32)

adding new entry "cn=tuser,ou=groups,dc=redaemon,dc=net"
ldap_add: Invalid syntax (21)
        additional info: objectClass: value #0 invalid per syntax
```

Any help will be appreciated.


----------



## cpm@ (Nov 24, 2013)

Please, read the explanation of why the "ldap_*: No such object" error occurs.


----------

