I joined a Nethserver to another Nethserver with remote LDAP.
It’s basically working, I can login with LDAP users to my moodle on the LDAP client Nethserver, so we need to find out why it’s not working on your side.
I’m going to try with ldapsearch…
This is what I set in the moodle module for LDAP:
sudo -u apache scl enable rh-php73 -- php /usr/share/moodle/admin/cli/cfg.php --component="auth_ldap" --name="host_url" --set="$ldapuri"
sudo -u apache scl enable rh-php73 -- php /usr/share/moodle/admin/cli/cfg.php --component="auth_ldap" --name="ldap_version" --set="3"
sudo -u apache scl enable rh-php73 -- php /usr/share/moodle/admin/cli/cfg.php --component="auth_ldap" --name="bind_dn" --set="$binddn"
sudo -u apache scl enable rh-php73 -- php /usr/share/moodle/admin/cli/cfg.php --component="auth_ldap" --name="bind_pw" --set="$bindpassword"
sudo -u apache scl enable rh-php73 -- php /usr/share/moodle/admin/cli/cfg.php --component="auth_ldap" --name="search_sub" --set="1"
sudo -u apache scl enable rh-php73 -- php /usr/share/moodle/admin/cli/cfg.php --component="auth_ldap" --name="user_type" --set="rfc2307"
sudo -u apache scl enable rh-php73 -- php /usr/share/moodle/admin/cli/cfg.php --component="auth_ldap" --name="contexts" --set="ou=People,dc=directory,dc=nh"
sudo -u apache scl enable rh-php73 -- php /usr/share/moodle/admin/cli/cfg.php --component="auth_ldap" --name="user_attribute" --set="uid"
sudo -u apache scl enable rh-php73 -- php /usr/share/moodle/admin/cli/cfg.php --component="auth_ldap" --name="field_map_firstname" --set="gecos"
sudo -u apache scl enable rh-php73 -- php /usr/share/moodle/admin/cli/cfg.php --component="auth_ldap" --name="field_map_lastname" --set="uid"
sudo -u apache scl enable rh-php73 -- php /usr/share/moodle/admin/cli/cfg.php --component="auth_ldap" --name="field_map_email" --set="Email"
Working settings (sorry, too much to show all)
EDIT:
This works for me:
ldapsearch -x -b dc=directory,dc=nh -H ldap://192.168.1.187
EDIT2:
And with credentials:
ldapsearch -Z -b dc=directory,dc=nh -H ldap://192.168.1.187 -D cn=ldapservice,dc=directory,dc=nh -W