Artificial intelligent assistant

How I can create accounts with command lines for my OpenLDAP server? 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 127.0.0.1 -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

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy d6dc77671ea0c40b0bdc86ca050a9cdc