You are not logged in.

#1 2016-09-07 00:12:48

brando56894
Member
From: NYC
Registered: 2008-08-03
Posts: 681

OpenLDAP Setup Directory Issues

I'm trying to setup LDAP on one of my VMs to rectify the headache of corrolating uids/gids from the datasets on my NAS to the VMs they're exported to, but I'm having trouble setting up the directories on the server. There's only going to be one user in there which is my user, bran.

I followed this wiki for the initial setup and I can query the database, so that seems fine, so now I'm following this article for the authentication configuration.

This is the part that I'm stuck on: Populate LDAP Tree with Base Data .

Here is my modified base.ldif:

# brandongolway.us
dn: dc=brandongolway,dc=us
dc: brandongolway
o: Example Organization
objectClass: dcObject
objectClass: organization

# Manager, brandongolway.us
dn: cn=Manager,dc=brandongolway,dc=us
cn: root
description: LDAP administrator
objectClass: organizationalRole
objectClass: top
roleOccupant: dc=brandongolway,dc=us

# People, brandongolway.us
dn: ou=People,dc=brandongolway,dc=us
ou: People
objectClass: top
objectClass: organizationalUnit

# Groups, brandongolway.us
dn: ou=Group,dc=brandongolway,dc=us
ou: Group
objectClass: top
objectClass: organizationalUnit

I have added it to my database and it accepted it, but when I go to check if everything was imported successfully it looks like I'm missing some stuff...

  [bran@pirate]: /etc/openldap>$ ldapsearch -x -b 'dc=brandongolway,dc=us' '(objectclass=*)'
# extended LDIF
#
# LDAPv3
# base <dc=brandongolway,dc=us> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

# brandongolway.us
dn: dc=brandongolway,dc=us
objectClass: dcObject
objectClass: organization
dc:: YnJhbmRvbmdvbHdheSA=
o: Example
description: Example directory

# root, brandongolway.us
dn: cn=root,dc=brandongolway,dc=us
objectClass: organizationalRole
cn: root
description: Directory Manager

# search result
search: 2
result: 0 Success

# numResponses: 3
# numEntries: 2

I've also tried adding my user but that fails because it is missing an OU (I guess?)

Here's my user.ldif file

dn: uid=bran,ou=People,dc=brandongolway,dc=us
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
uid: bran
cn: Brandon Golway
sn: golway
givenName: Brandon
title: Awesome SysAdmin
telephoneNumber: +0 000 000 0000
mobile: +0 000 000 0000
postalAddress: AddressLine1$AddressLine2$AddressLine3
userPassword: [redacted]
labeledURI: https://brandongolway.us/
loginShell: /bin/bash
uidNumber: 1000
gidNumber: 1003
homeDirectory: /home/bran/
description: My Account

This is the error I get when I try to import it

  [bran@pirate]: /etc/openldap>$ sudo ldapadd -D "cn=root,dc=brandongolway,dc=us" -W -f user-bran.ldif
adding new entry "uid=bran,ou=People,dc=brandongolway,dc=us"
ldap_add: No such object (32)
        matched DN: dc=brandongolway,dc=us

Last edited by brando56894 (2016-09-07 00:16:08)

Offline

Board footer

Powered by FluxBB