Search code examples
active-directoryldapopenldapsamba

Nextcloud with Samba via LDAP


I want to connect my samba active directory server with my nextcloud. I cant find ANY information if samba4 has ldap or not? or how i could install openldap with it so that my active directory accounts and passwords are the same as in the nextcloud.

How to configure LDAP on an Samba4 Active Directory Server?


Solution

  • • Samba4 does have support for LDAP server but it has to be integrated with Active Directory or OpenLDAP to provide a schema and other related attributes to be used with other applications dependent on it for authentication.

    • And since, configuring OpenLDAP as a backend for the Samba4 server is considered as legacy because it is best integrated with its own LDAP server in AD mode. But still if you want to configure OpenLDAP in the backend with Active Directory providing authentication to external applications, the directory schema will still be AD schema. So, you will have to update external applications accessing the directory using, such as you must do it when you use the Samba internal LDAP server. Additionally, you will have to import attributes manually from the old LDAP server that are not included in the AD schema. Even though, if you want to configure OpenLDAP as the backend with Active Directory, please find the detailed steps in link below: -

    https://ubuntu.com/server/docs/samba-openldap-backend

    • Also, please note that it is not planned to support OpenLDAP as backend for Samba AD as a significant part of the complexity of the AD DC is in the LDB modules such as creating a general-purpose OpenLDAP back end requires rewriting many of these modules as OpenLDAP overlays, outside the standard Samba programming environment wherein specific problems include the metadata required for both DRS replication and dirsync, schema manipulation, transactions, and access control lists. Please find the below link for detailed steps on configuration of ADDC on Samba4 server and integrating it with internal LDAP server: -

    https://wiki.samba.org/index.php/Setting_up_Samba_as_an_Active_Directory_Domain_Controller

    • Also, on connecting your Samba4 AD server with nextcloud, you can do it so readily as Nextcloud ships with an LDAP application to allow LDAP users (including Active Directory) to appear in your Nextcloud user listings which will authenticate to Nextcloud with their LDAP credentials, so you don’t have to create separate Nextcloud user accounts for them. Please find the below link on detailed information for its configuration: -

    https://docs.nextcloud.com/server/latest/admin_manual/configuration_user/user_auth_ldap.html