I'm in a Docker, in a VM (Ubuntu Serv). I have created a OpenLDAP server.

I want to know simply : how to create groups and users.

My DIT tree : dc=company,dc=com ou=group1 ou=group2 ou=group3 ou=group4 and in each groupe I have many users : cn=user1 cn=user2 etc...

Thank you


create an LDIF for each object like this:

dn: uid=cx,ou=group1,ou=People,dc=company,dc=com
loginShell: /bin/bash
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
userPassword:: ...pwhash.....
cn: Your Name
gecos: The Gecos field (infos),,,
gidNumber: 100
uid: xy
homeDirectory: /home/xy
uidNumber: 1040

Then add the thing to the ldap server like this:

ldapadd -v -U admin@fs -h -a -f /path/to/ldiffile.ldif

You might have to play with the authentication of your initial admin user (Maybe user an DN to auth .... depends on your intial setup)

HTH, derjohn

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.