What are you thinking when you have question regarding Directory Service?
Yeah, it can be:
- LDAP
- Active Directory
- Azure
Well we are not in Windows Environment and prefer to have On Premise Directory Service, and my Choice comes to OpenLDAP.
Now let’s go through on OpenLDAP installation on Raspberry Pi
First thing to do
pi@raspberrypi:~ $ sudo apt update Hit:1 http://archive.raspberrypi.org/debian buster InRelease Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease Reading package lists... Done Building dependency tree Reading state information... Done All packages are up to date. pi@raspberrypi:~ $ sudo apt upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following package was automatically installed and is no longer required: libpng12-0 Use 'sudo apt autoremove' to remove it. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Installing the OpenLDAP
pi@raspberrypi:~ $ sudo apt install slapd ldap-utils Reading package lists... Done Building dependency tree Reading state information... Done The following package was automatically installed and is no longer required: libpng12-0 Use 'sudo apt autoremove' to remove it. The following additional packages will be installed: libodbc1 libsasl2-modules Suggested packages: libsasl2-modules-gssapi-mit | libsasl2-modules-gssapi-heimdal libmyodbc odbc-postgresql tdsodbc unixodbc-bin libsasl2-modules-ldap libsasl2-modules-otp libsasl2-modules-sql The following NEW packages will be installed: ldap-utils libodbc1 libsasl2-modules slapd 0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. Need to get 1,723 kB of archives. After this operation, 14.9 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://raspbian.mirror.constant.com/raspbian buster/main armhf libodbc1 armhf 2.3.6-0.1 [186 kB] Get:2 http://raspbian.mirror.constant.com/raspbian buster/main armhf slapd armhf 2.4.47+dfsg-3+rpi1+deb10u6 [1,262 kB] Get:3 http://raspbian.mirror.constant.com/raspbian buster/main armhf ldap-utils armhf 2.4.47+dfsg-3+rpi1+deb10u6 [178 kB] Get:4 http://raspbian.mirror.constant.com/raspbian buster/main armhf libsasl2-modules armhf 2.1.27+dfsg-1+deb10u1 [96.3 kB] Fetched 1,723 kB in 4s (440 kB/s) Preconfiguring packages ... Selecting previously unselected package libodbc1:armhf. (Reading database ... 127641 files and directories currently installed.) Preparing to unpack .../libodbc1_2.3.6-0.1_armhf.deb ... Unpacking libodbc1:armhf (2.3.6-0.1) ... Selecting previously unselected package slapd. Preparing to unpack .../slapd_2.4.47+dfsg-3+rpi1+deb10u6_armhf.deb ... Unpacking slapd (2.4.47+dfsg-3+rpi1+deb10u6) ... Selecting previously unselected package ldap-utils. Preparing to unpack .../ldap-utils_2.4.47+dfsg-3+rpi1+deb10u6_armhf.deb ... Unpacking ldap-utils (2.4.47+dfsg-3+rpi1+deb10u6) ... Selecting previously unselected package libsasl2-modules:armhf. Preparing to unpack .../libsasl2-modules_2.1.27+dfsg-1+deb10u1_armhf.deb ... Unpacking libsasl2-modules:armhf (2.1.27+dfsg-1+deb10u1) ... Setting up libsasl2-modules:armhf (2.1.27+dfsg-1+deb10u1) ... Setting up ldap-utils (2.4.47+dfsg-3+rpi1+deb10u6) ... Setting up libodbc1:armhf (2.3.6-0.1) ... Setting up slapd (2.4.47+dfsg-3+rpi1+deb10u6) ... Creating new user openldap... done. Creating initial configuration... done. Creating LDAP directory... done. Processing triggers for systemd (241-7~deb10u6+rpi1) ... Processing triggers for man-db (2.8.5-2) ... Processing triggers for libc-bin (2.28-10+rpi1) ...
There will be prompted to:
- enter admin password
- Confirm password
Next is reconfigure the OpenLDAP/ Slapd
pi@raspberrypi:~ $ sudo dpkg-reconfigure slapd
- If you enable this option, no initial configuration or database will be created for you. │
│ │
│ Omit OpenLDAP server configuration?
Choose No
- Enter domain name
- enter admin password
- enter domain name
- select MDB ada backend DB
- Do you want the database to be removed when slapd is purged? Choose No
- Move old database? Choose Yes
After all is done, below message will appear
Backing up /etc/ldap/slapd.d in /var/backups/slapd-2.4.47+dfsg-3+rpi1+deb10u6... done. Moving old database directory to /var/backups: - directory unknown... done. Creating initial configuration... done. Creating LDAP directory... done.
Connecting to OpenLDAP
I am using ldapadmin , a simple and cool LDAP explorer.