NS8 + LDAP Account Provider + Linux Clients (Issue)

Hi everyone,

Here again, so thanks again for the great product. I love the server!

Let me explain the issue I’m having. I installed NS8 in my lab to authenticate a few Linux clients. I chose AlmaLinux 10 for the clients and Rocky Linux 9 for NS8. Since my goal is to connect only using pure Linux clients, I originally wanted to go with the OpenLDAP Account Provider. However, I know you guys disabled that option.

Because of that, I thought about using the SAMBA Account Provider instead. My idea was to still have the clients connect using pure OpenLDAP client tools, since Samba uses LDAP in the backend. Unfortunately, I cannot make this work.

To make sure I wasn’t doing something wrong, I set up a quick LDAP server using Turnkey Linux as a test, and my clients connected to it perfectly.

Please advise. What am I missing to get this working with Samba?

LAB System HOST:
Virt-Manager / KVM / QEMU
Network / NAT with DHCP

Hi Giancarlos, please check log messages from Alma Linux clients, e.g.:

journalctl -u sssd --since "10 minutes ago"

Or

journalctl -b --since "10 minutes ago" | grep -i -E 'ldap|sssd|tls'

Samba DC does not allow clear-text LDAP binds, and maybe Samba’s self-signed certificate is not accepted by Alma Linux clients.

Thanks Davide,

Here is the output of the journalctl + grep

journalctl -b --since “10 minutes ago” | grep -i -E ‘ldap|sssd|tls’
Oct 10 11:34:20 GRPDT001.grp.local systemd[1]: systemd 257-23.el10_2.2.alma.1-gdb72f78 running in system mode (+PAM +AUDIT +SELINUX -APPARMOR +IMA +IPE +SMACK +SECCOMP -GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN -IPTC +KMOD +LIBCRYPTSETUP +LIBCRYPTSETUP_PLUGINS +LIBFDISK +PCRE2 +PWQUALITY +P11KIT -QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK +BTF +XKBCOMMON +UTMP +SYSVINIT +LIBARCHIVE)
Oct 10 11:34:21 GRPDT001.grp.local kernel: RPC: Registered tcp-with-tls transport module.
Oct 10 11:34:23 GRPDT001.grp.local systemd[1]: systemd 257-23.el10_2.2.alma.1-gdb72f78 running in system mode (+PAM +AUDIT +SELINUX -APPARMOR +IMA +IPE +SMACK +SECCOMP -GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN -IPTC +KMOD +LIBCRYPTSETUP +LIBCRYPTSETUP_PLUGINS +LIBFDISK +PCRE2 +PWQUALITY +P11KIT -QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK +BTF +XKBCOMMON +UTMP +SYSVINIT +LIBARCHIVE)
Oct 10 11:34:24 GRPDT001.grp.local systemd[1]: Listening on sssd-kcm.socket - SSSD Kerberos Cache Manager responder socket.
Oct 10 11:34:25 GRPDT001.grp.local systemd[1]: Starting sssd.service - System Security Services Daemon…
Oct 10 11:34:25 GRPDT001.grp.local sssd[1159]: Starting up
Oct 10 11:34:25 GRPDT001.grp.local sssd_be[1203]: Starting up
Oct 10 11:34:25 GRPDT001.grp.local sssd_nss[1204]: Starting up
Oct 10 11:34:25 GRPDT001.grp.local sssd_pam[1205]: Starting up
Oct 10 11:34:25 GRPDT001.grp.local systemd[1]: Started sssd.service - System Security Services Daemon.
Oct 10 11:34:26 GRPDT001.grp.local sssd_be[1203]: Backend is online
Oct 10 11:34:41 GRPDT001.grp.local systemd[1]: Starting sssd-kcm.service - SSSD Kerberos Cache Manager…
Oct 10 11:34:41 GRPDT001.grp.local systemd[1]: Started sssd-kcm.service - SSSD Kerberos Cache Manager.
Oct 10 11:34:41 GRPDT001.grp.local sssd_kcm[3357]: Starting up
Oct 10 11:35:09 GRPDT001.grp.local packagekitd[2277]: Failed to get cache filename for gnutls
Oct 10 11:35:09 GRPDT001.grp.local packagekitd[2277]: Failed to get cache filename for sssd
Oct 10 11:35:09 GRPDT001.grp.local packagekitd[2277]: Failed to get cache filename for sssd-ad
Oct 10 11:35:09 GRPDT001.grp.local packagekitd[2277]: Failed to get cache filename for sssd-client
Oct 10 11:35:09 GRPDT001.grp.local packagekitd[2277]: Failed to get cache filename for sssd-common
Oct 10 11:35:09 GRPDT001.grp.local packagekitd[2277]: Failed to get cache filename for sssd-common-pac
Oct 10 11:35:09 GRPDT001.grp.local packagekitd[2277]: Failed to get cache filename for sssd-ipa
Oct 10 11:35:09 GRPDT001.grp.local packagekitd[2277]: Failed to get cache filename for sssd-kcm
Oct 10 11:35:09 GRPDT001.grp.local packagekitd[2277]: Failed to get cache filename for sssd-krb5
Oct 10 11:35:09 GRPDT001.grp.local packagekitd[2277]: Failed to get cache filename for sssd-krb5-common
Oct 10 11:35:09 GRPDT001.grp.local packagekitd[2277]: Failed to get cache filename for sssd-ldap
Oct 10 11:35:09 GRPDT001.grp.local packagekitd[2277]: Failed to get cache filename for sssd-nfs-idmap
Oct 10 11:35:09 GRPDT001.grp.local packagekitd[2277]: Failed to get cache filename for sssd-proxy

So also did the command but with the turnkey ldap server and they look the same.

Hi @giancarlos,

Thanks for testing. My guess is that the problem is the TLS certificate. Samba AD only accepts binds over an encrypted connection, and its certificate is self-signed, so SSSD on AlmaLinux refuses it by default. Your Turnkey test probably worked because that server allowed binds without TLS.

You can choose between two procedures.

Option 1: Trust the Samba AD certificate and keep the LDAP provider

  1. On the NS8 node, copy the Samba CA certificate out of the module (replace samba1 with your instance name):

    runagent -m samba1 podman exec samba-dc cat /var/lib/samba/private/tls/ca.pem > samba-ca.pem
    
    
  2. Copy samba-ca.pem to each AlmaLinux client and add it to the trust store:

    cp samba-ca.pem /etc/pki/ca-trust/source/anchors/
    update-ca-trust
    
    
  3. Check that the client can resolve the DC’s FQDN, because it must match the certificate name. Then test:

    openssl s_client -connect <DC_FQDN>:636 </dev/null | grep 'Verify return code'
    
    

    You should see 0 (ok).

  4. Adjust /etc/sssd/sssd.conf for the AD schema. AD users have no POSIX attributes by default, so let SSSD generate UIDs and GIDs:

    [sssd]
    services = nss, pam
    domains = ad.example.com
    
    [domain/ad.example.com]
    id_provider = ldap
    auth_provider = ldap
    ldap_uri = ldaps://<DC_FQDN>
    ldap_search_base = DC=ad,DC=example,DC=com
    ldap_schema = ad
    ldap_id_mapping = True
    ldap_referrals = False
    ldap_default_bind_dn = ldapservice@ad.example.com
    ldap_default_authtok = <password>
    cache_credentials = True
    fallback_homedir = /home/%u
    default_shell = /bin/bash
    
    

    Then run chmod 600 /etc/sssd/sssd.conf, restart SSSD, and test with id someuser.

Option 2: Join the domain with the AD provider (recommended)

With this option SSSD authenticates with Kerberos and protects LDAP traffic with Kerberos too, so no certificate is involved.

  1. Point the client’s DNS at the Samba DC IP, so it can find the domain’s SRV records:

    nmcli con mod <connection> ipv4.dns <DC_IP> ipv4.ignore-auto-dns yes
    nmcli con up <connection>
    
    
  2. Install the packages and check that the domain is visible:

    dnf install -y realmd sssd adcli samba-common-tools oddjob oddjob-mkhomedir krb5-workstation
    realm discover ad.example.com
    
    
  3. Join the domain with an administrator account:

    realm join -U administrator ad.example.com
    
    
  4. Create home directories at first login, then test:

    authselect enable-feature with-mkhomedir
    systemctl enable --now oddjobd
    id someuser@ad.example.com
    
    

If you want short usernames (someuser instead of someuser@ad.example.com), set use_fully_qualified_names = False in /etc/sssd/sssd.conf and restart SSSD.

Kerberos needs the client and the DC clocks to agree within 5 minutes, so make sure chronyd is running on the clients.

Let us know which way you choose and how it goes!


Please check the container name (samba-dc) and the certificate path in step 1 of Option 1 against the current Samba module before posting.

[post generated by AI]

Hi davidep, thanks and sorry for the delay! Yes indeed, the second option I already implemented way before—that’s actually been the way I write tutorials for Linux and Windows interoperability in a SAMBA/AD domain. I was just trying to get pure LDAP and not have SAMBA involved this time. The first option you provided seems to be ok; I haven’t tried it yet, but once I get some time I’ll do it. Thanks again!