Ubuntu - Join Windows Active Directory Domain with Samba Winbind

By EssingtonITS team ·

Learn how to join an Ubuntu system to a Windows Active Directory domain using Samba Winbind for SSH authentication. The article provides step-by-step instructions, including necessary configurations and testing commands.

Join Ubuntu to Active Directory for SSH AD Authentication

To join your Ubuntu desktop or server to Active Directory for SSH AD authentication, ensure your machine is on the correct network and can communicate with the domain controller. You'll need an Active Directory user account with sufficient privileges to join the domain.

apt-get -y install winbind libpam-winbind libnss-winbind krb5-config samba-dsdb-modules samba-vfs-modules

When prompted, enter your REALM (example.com) and the AD server hostname (myserver). Once installation is complete, edit the following files:

Edit Configuration Files

smb.conf

vi /etc/samba/smb.conf

Add or alter the following:

workgroup = myserver
realm = example.com
security = ads
idmap config * : backend = tdb
idmap config * : range = 3000-7999
idmap config FD3S01 : backend = rid
idmap config FD3S01 : range = 10000-999999
template homedir = /home/%U
template shell = /bin/bash
winbind use default domain = true
winbind offline logon = false

nsswitch.conf

vi /etc/nsswitch.conf

Add the following at the bottom of the config file:

passwd:     compat systemd winbind
group:     compat systemd winbind

common-session

vi /etc/pam.d/common-session

Add the following to the bottom of the config file:

session optional        pam_mkhomedir.so skel=/etc/skel umask=077

Join the Domain

net ads join -U Administrator

Note that joining a domain requires DNS. Ensure your machine can resolve the domain name and, where possible, add the domain/AD server to the hosts file:

vi /etc/hosts
192.x.x.x myserver example.com

Restart winbind:

systemctl restart winbind

Testing

Use wbinfo to query users or groups:

wbinfo -u
wbinfo -g

Looking to enhance your Linux infrastructure? At EssingtonITS.co.uk, we offer expert support and tailored solutions to optimise your systems. Let us help you achieve seamless integration and improved performance.

person people found this useful.

Related

Knowledge base 10 Jun 2026

Personal Notebook in eLLM

The personal notebook in eLLM allows users to organise and store notes, images, and files in a private, searchable timeline. It ensures privacy by keeping contents visible only to the user, and it can be integrated with the assistant for personalised answers.

Knowledge base 9 Jun 2026

Git Commands Quick Reference Guide

This quick reference guide covers essential Git commands for repository setup, staging, branching, merging, and working with remote repositories, making it a handy tool for developers to streamline their workflow.

Knowledge base 9 Jun 2026

Organisation Skills in the eLLM Admin Console

The article explains how the eLLM Admin Console allows organisations to create and manage shared instruction sets called "organisation skills" to ensure consistent responses across teams. These skills can be customised, restricted to specific groups, and integrated with extern…

Expand 29 Jul 2026

How AI can support pupils with SEND

Explore how AI tools are aiding pupils with special educational needs and disabilities by simplifying text, breaking down tasks, and enhancing accessibility. Learn about the considerations schools should make before implementation.

Expand 29 Jul 2026

AI policy and practice in further education

Further education colleges need distinct AI policies due to their unique mix of vocational courses, diverse age groups, and specific funding and inspection requirements. This guidance highlights the importance of tailored AI approaches in FE settings.