diff --git a/INSTALL.md b/INSTALL.md index 6eff7c4..ec13576 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -12,16 +12,57 @@ build ldapdock from the dockerfile and run into it ``` ``` -> docker run -h example.com -i -p 389:389 -t ldapdock -v ldap_data:/var/lib/ldap -v ldap_config:/etc/ldap/slapd.d +> docker run -h example.com -i -p 389:389 -t ldapdock ``` -## _2- Run the openLDAP server and create an admin user_ +## _2- Run the openLDAP server and populate a directory_ Use the following command to start openLDAP ``` root@example:/# slapd -h "ldap:/// ldapi:///" -g openldap -u openldap -F /etc/ldap/slapd.d ``` -Generate a password hash for our administrator user, Op3nLd4p! here being the password to comply with password policies + +Create some groups and users to populate a directory +``` +root@example:/# cat > add_content.ldif << EOF +dn: ou=People,dc=example,dc=com +objectClass: organizationalUnit +ou: People + +dn: ou=Groups,dc=example,dc=com +objectClass: organizationalUnit +ou: Groups + +dn: cn=mages,ou=Groups,dc=example,dc=com +objectClass: posixGroup +cn: mages +gidNumber: 5000 +memberUid: marisa + +dn: uid=marisa,ou=People,dc=example,dc=com +objectClass: inetOrgPerson +objectClass: posixAccount +objectClass: shadowAccount +uid: marisa +sn: Kirisame +givenName: Marisa +cn: Marisa Kirisame +displayName: Marisa Kirisame +uidNumber: 10000 +gidNumber: 5000 +userPassword: {CRYPT}x +gecos: Marisa Kirisame +loginShell: /bin/bash +homeDirectory: /home/marisa +EOF +``` +``` +root@example:/etc/ldap/slapd.d# ldapadd -x -D cn=admin,dc=example,dc=com -W -f add_content.ldif +``` +When creating the groups and users, we will be asked:\ +1-the password for the user marisa (qwerty), 2-reenter the password for marisa, 3-the openLDAP root password (admin) + + ## _3- Load and enable policy modules_