Adding a Group
Create the file:
add_group.ldif
dn: cn=mygroup,ou=groups,dc=example,dc=com
objectClass: groupofnames
cn: mygroup
description: All users
member: uid=john,ou=people,dc=test,dc=com
where you add a "member : user_dn" line for each user you want to add to this group. And then run:
ldapadd -x -D cn=admin,dc=test,dc=com -W -f add_group.ldif
Taking it for a test-run
You can run the following command to see if it is all set up properly:
ldapsearch -x -LLL -H ldap:/// -b uid=john,ou=people,dc=test,dc=com dn memberof
And it should yield this result:
dn: uid=john,ou=People,dc=test,dc=com
memberOf: cn=mygroup,ou=groups,dc=test,dc=com