Join RHEL 10 to Active Directory with Samba Winbind

Deepak Prasad
Tested on RHEL 10.2 (Coughlan) — client vm1.lab.example (192.168.56.116)
Windows Server 2025 AD DC — WIN-8S0K67EP5EO.lab.example (192.168.56.128)
Package realmd-0.17.1-13.el10_1
samba-4.23.5-111.el10_2
samba-winbind-4.23.5-111.el10_2
samba-winbind-clients-4.23.5-111.el10_2
krb5-workstation-1.21.3-10.el10_2
Applies to RHEL 10, Rocky Linux 10, AlmaLinux 10, Oracle Linux 10, CentOS Stream 10
Privilege sudo or root on the Linux client; domain account that can join computers
Scope Join RHEL as an Active Directory member with Samba Winbind using realm join --membership-software=samba --client-software=winbind, verify trust and NSS lookup, and grant an AD group access to a simple Samba share. Includes a manual net ads join alternative. For ordinary Linux login with SSSD, use realmd or adcli with manual SSSD.
Related guides Join with realmd and SSSD
Join with adcli and SSSD
Integrate FreeRADIUS with AD
Chrony time sync
Kerberos packet analysis
Short on time?Beta Get the gist of this 9-minute read in seconds, then ask follow-up questions

Samba Winbind connects Linux to Active Directory for identity and authentication through Kerberos and SMB/RPC. On RHEL 10, the supported path is realm join with --membership-software=samba and --client-software=winbind, which configures Samba, NSS, PAM, and Winbind together.

Use SSSD and realmd for typical interactive Linux logins. Choose Winbind when this host runs Samba and needs DOMAIN\user semantics for file shares or related services.


Quick answer

Install packages, point DNS at the domain controller, then join with realmd’s Winbind profile:

bash
sudo realm join --membership-software=samba --client-software=winbind lab.example -U Administrator

Verify trust and user lookup:

bash
sudo net ads testjoin
wbinfo -t
getent passwd 'LAB\jane'

Winbind exposes LAB\username names. SSSD exposes user@domain.example and is the better default for SSH and sudo on a generic server.


SSSD vs Winbind for Active Directory

Choose SSSD Choose Winbind
Interactive login, SSH, and sudo Samba file and print on a member server
realm permit with default client software wbinfo, ntlm_auth, or DOMAIN\user semantics
kinit and user@domain naming FreeRADIUS AD integration and similar

Do not run SSSD and Winbind as parallel identity providers on the same host without a deliberate design. Pick one stack per system.


How Samba Winbind connects Linux to Active Directory

              Linux host (Samba member)
                         ↓
                    Winbind daemon
                         ↓
              Kerberos + LDAP / RPC to AD
                         ↓
         Windows Server 2025 domain controller

Winbind caches SID-to-UID mappings, lists domain users and groups for NSS, and keeps the machine account password in sync with Active Directory.


Test environment

Role Hostname IP
Active Directory DC (Windows Server 2025) WIN-8S0K67EP5EO.lab.example 192.168.56.128
RHEL 10.2 member server vm1.lab.example 192.168.56.116
DNS domain / Kerberos realm lab.example / LAB.EXAMPLE —

Prerequisites before joining the AD domain

Point the client resolver at the DC, confirm the hostname FQDN, and keep time synchronized with the domain.

Confirm LDAP SRV records:

bash
dig +short _ldap._tcp.lab.example SRV
output
0 100 389 win-8s0k67ep5eo.lab.example.

When SRV records resolve, confirm the system clock is synchronized before you join:

bash
timedatectl | grep 'System clock synchronized'
output
System clock synchronized: yes

The Samba computer account name comes from the short hostname of the FQDN:

bash
hostname -f
output
vm1.lab.example

Install Samba and Winbind

Install the Samba member-server stack, realmd, and Kerberos client tools:

bash
sudo dnf install -y \
  realmd \
  oddjob \
  oddjob-mkhomedir \
  samba \
  samba-winbind \
  samba-winbind-clients \
  samba-winbind-krb5-locator \
  samba-client \
  samba-common-tools \
  krb5-workstation

Verify the Winbind components:

bash
rpm -q realmd samba-winbind samba-winbind-clients
output
realmd-0.17.1-13.el10_1.x86_64
samba-winbind-4.23.5-111.el10_2.x86_64
samba-winbind-clients-4.23.5-111.el10_2.x86_64

Join using realmd and Winbind

Red Hat documents joining Active Directory with Samba Winbind through realm join and explicit client/membership software flags.

Record the current auth profile before you change it:

bash
authselect current

Join the domain (you will be prompted for the join account password):

bash
sudo realm join --membership-software=samba --client-software=winbind lab.example -U Administrator

realm join calls the enrollment tools, writes Samba and Kerberos settings, selects the winbind authselect profile (with oddjobd for homedirs), and starts Winbind. Verbose joins may show authselect select winbind with-mkhomedir --force when replacing an existing profile.

After a successful join, expect:

  • /etc/samba/smb.conf with security = ADS, realm, workgroup, and idmap sections
  • winbind entries in /etc/nsswitch.conf through authselect
  • PAM stacks that use Winbind
  • /etc/krb5.keytab for the machine account
  • winbind and oddjobd enabled

Inspect the generated Samba settings:

bash
sudo testparm -s
output
Server role: ROLE_DOMAIN_MEMBER
...
	security = ADS
	workgroup = LAB
	realm = LAB.EXAMPLE
	idmap config lab : backend = rid
...

Exact idmap ranges are written by realmd; use testparm -s on your host rather than copying static numbers from another system.

Configure the Winbind Kerberos local-auth plugin

RHEL uses the Winbind Kerberos local-auth plugin to map Kerberos principals to the corresponding Winbind identity. Add this section to /etc/krb5.conf (merge with any existing [plugins] block if your file already has one):

text
[plugins]
    localauth = {
        module = winbind:/usr/lib64/samba/krb5/winbind_krb5_localauth.so
        enable_only = winbind
    }

Membership should show Winbind as the client stack:

bash
realm list
output
lab.example
  type: kerberos
  realm-name: LAB.EXAMPLE
  domain-name: lab.example
  configured: kerberos-member
  server-software: active-directory
  client-software: winbind
  login-formats: LAB\%U

Confirm the machine trust:

bash
sudo net ads testjoin
output
Join is OK

Winbind should also report a healthy trust secret to the domain:

bash
wbinfo -t
output
checking the trust secret for domain LAB via RPC calls succeeded

On the domain controller, confirm VM1 under Computers in Active Directory Users and Computers if you want a GUI check.


Verify Active Directory users and groups

Start Winbind before Samba when you will query domain users for shares or services. Use wbinfo for Winbind diagnostics and getent for what NSS-backed applications see.

bash
sudo systemctl enable --now winbind oddjobd

Confirm the Winbind daemon answers RPC pings:

bash
wbinfo -p
output
Ping to winbindd succeeded

List domain users and groups:

bash
wbinfo -u | head -5
output
LAB\administrator
LAB\guest
LAB\krbtgt
LAB\jane
LAB\john

NSS applications use getent, which returns the DOMAIN\user form when winbind use default domain is not enabled:

bash
getent passwd 'LAB\jane'
output
LAB\jane:*:11105:1000513::/home/jane@LAB:/bin/bash

id should show the same account with group memberships:

bash
id 'LAB\jane'
output
uid=11105(LAB\jane) gid=1000513(LAB\domain users) groups=1000513(LAB\domain users),11103(LAB\network-admins)

Jane’s UID 11105 follows the configured RID range plus her account RID (1105). The domain group Domain Users is a well-known group in your AD domain with RID 513, which often maps to values like 1000513 on a member server. Confirm mappings on your host with wbinfo -Y on the group SID rather than assuming every ID is range + RID.

Enable Samba after Winbind is healthy:

bash
sudo systemctl enable --now smb

Manual alternative: join with net ads join

Use this path when you manage smb.conf yourself or you are following documentation that predates the realmd Winbind flags.

Verify the client can obtain an AD Kerberos ticket (the principal includes the realm explicitly):

bash
kinit Administrator@LAB.EXAMPLE

A ticket in the cache confirms the KDC accepted the password:

bash
klist

Destroy the ticket when you are done testing:

bash
kdestroy

Example member-server [global] baseline before join:

text
[global]
   workgroup = LAB
   realm = LAB.EXAMPLE
   security = ADS
   dedicated keytab file = /etc/krb5.keytab
   kerberos method = secrets and keytab
   winbind refresh tickets = yes
   winbind use default domain = no
   template shell = /bin/bash
   template homedir = /home/%U@%D
   idmap config * : backend = tdb
   idmap config * : range = 3000-7999
   idmap config LAB : backend = rid
   idmap config LAB : range = 10000-20000

Validate syntax:

bash
sudo testparm -s

Select Winbind in authselect, then join:

bash
sudo authselect select winbind with-mkhomedir

Join with a domain administrator or delegated account:

bash
sudo net ads join -U Administrator

DNS update warnings are common in labs without secure DNS delegation; look for Joined 'VM1' to dns domain and then run net ads testjoin.

If you used this manual path instead of realm join, add the Winbind Kerberos localauth plugin block to /etc/krb5.conf as shown in the realmd Winbind join section above.


Quick Samba share smoke test

After join, prove that Winbind identities can reach smbd with a minimal share. For SELinux, ACLs, write list, firewall, and Windows access patterns, use Configure Samba shares for Active Directory users.

Create /srv/projects, set group LAB\network-admins and mode 2770, add a [projects] stanza with valid users = @"LAB\network-admins", then run sudo testparm -s and sudo systemctl reload smb. Confirm with smbclient //127.0.0.1/projects -U 'LAB\jane' and a quick mkdir at the smb: prompt.


Winbind ID mapping explained

Active Directory identifies users with SIDs (S-1-5-21-…). Linux processes expect numeric UIDs and GIDs. Winbind maps between them through an idmap backend.

Backend Use case
rid Default choice for a single AD domain; IDs derived from the RID portion of the SID
ad Requires POSIX uidNumber / gidNumber attributes in AD
autorid Multi-domain forests with one consistent range
tdb Local allocation for non-AD SIDs (idmap config *)

After realm join, inspect the active ranges with testparm -s and validate a user with id 'LAB\username'.


Leave the Active Directory domain

With realmd managing the join:

bash
sudo realm leave lab.example

To remove the computer object from AD as well:

bash
sudo realm leave --remove lab.example -U Administrator

On a manual net ads join host, use sudo net ads leave -U Administrator and restore the authselect profile you recorded before join.


Troubleshooting Samba/Winbind Active Directory integration

Symptom Likely cause Fix
net ads join fails DNS, credentials, or security not ADS Fix SRV records; run testparm; test kinit
wbinfo -u returns no users winbind not running or join broken systemctl status winbind; net ads testjoin
getent passwd does not show AD users NSS missing winbind authselect select winbind; check /etc/nsswitch.conf
Kerberos works but Winbind fails smb.conf idmap or realm mismatch Align workgroup, realm, and idmap config with wbinfo -D
Share access denied for a valid user Unix permissions or group mismatch chgrp/chmod on the path; confirm id shows the AD group
SID-to-UID/GID mapping surprises Mixed backends or built-in RIDs Use wbinfo -Y on the SID; read testparm -s idmap ranges

Summary

On RHEL 10, join Active Directory as a Samba member with realm join --membership-software=samba --client-software=winbind. That is the current integrated path: realmd writes smb.conf, enables Winbind in NSS/PAM, and enrolls the computer account. Verify with realm list, net ads testjoin, wbinfo -t, and getent passwd 'LAB\user'.

Use the manual net ads join section when you own smb.conf end to end. For file shares, set Unix group ownership on the path and test with smbclient as a domain user in the authorized group—not with anonymous smbclient -N listing.

For ordinary Linux login and realm permit policy, SSSD with realmd remains the simpler choice. Manual SSSD after adcli join is covered in the adcli guide.


References


Frequently Asked Questions

Should I use SSSD or Winbind with Active Directory?

Use SSSD for typical Linux user login and sudo. Use Winbind when Samba or Winbind-specific tools must resolve domain users on the same host.

Can realmd configure Winbind?

Yes. On RHEL 10, join with realm join --membership-software=samba --client-software=winbind domain.example. realmd configures Samba, NSS, PAM, and Winbind for that path.

Does Winbind require Samba?

Yes. Winbind is part of the Samba suite; install samba-winbind and configure /etc/samba/smb.conf.

What does net ads join do?

It creates or updates the computer account in Active Directory, stores secrets for the member server, and prepares Winbind to authenticate against the domain.

Can Samba use SSSD instead of Winbind?

For a Samba member server integrated with AD, Red Hat documents the Winbind member path. SSSD and Winbind solve overlapping but not identical problems; avoid running both as identity providers without a documented architecture.

Finished reading?Beta Get the key takeaways in seconds, then ask follow-up questions
Omer Cakmak

Linux Administrator

Highly skilled at managing Debian, Ubuntu, CentOS, Oracle Linux, and Red Hat servers. Proficient in bash scripting, Ansible, and AWX central server management, he handles server operations on OpenStack, KVM, Proxmox, and VMware.

  • Debian
  • Ubuntu
  • Linux
  • Red Hat Enterprise Linux
  • Shell Script
  • System Administration