ldifs/README.md

34 lines
864 B
Markdown
Raw Normal View History

2018-03-29 21:44:11 +02:00
Add your basedn to basedn (eg: `echo o=denkn,c=at > basedn`).
2018-03-29 21:50:34 +02:00
2018-03-29 23:09:08 +02:00
For initialization, first shutdown slapd and delete the content of `/var/lib/ldap/` (you will loose all of your data!),
2018-03-29 22:49:51 +02:00
then use:
2018-03-29 22:50:57 +02:00
./00.root.ldif.sh | slapadd -b `cat basedn` -v
2018-03-29 23:53:05 +02:00
chown -R openldap:openldap /var/lib/ldap/
2018-03-29 21:50:34 +02:00
2018-03-29 23:53:05 +02:00
Now you can start slapd with your fresh config.
2018-03-29 21:50:34 +02:00
2018-03-29 23:53:05 +02:00
Add these lines to `/etc/ldap/ldap.conf`:
2018-03-29 22:41:19 +02:00
2018-03-29 23:54:42 +02:00
cat >> /etc/ldap/ldap.conf <<EOF
2018-03-29 23:53:05 +02:00
BASE `cat basedn`
URI ldapi://
EOF
2018-03-29 22:41:19 +02:00
Via `ldapadd -Y EXTERNAL` you can add any other ldif.
2018-03-29 21:44:11 +02:00
2018-03-29 23:53:05 +02:00
For adding 10 and 20 use: [BROKEN, do it manually in `/etc/...`]
ldapmodify -Y EXTERNAL -f 10.acls.ldif
ldapmodify -Y EXTERNAL -f 20.passwordhash.ldif
For adding an user run:
./90.user.ldif.sh username givenname surname emailaddr | ldapadd -Y EXTERNAL
It will print the password on STDERR.
For changing password use:
ldappasswd -xASD YOURDN