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 24 Nov 2026

SDE PC Terminal: turn a PC or laptop into a Terminal

The SDE PC image allows a 64-bit PC or laptop to function as an SDE Terminal, providing a streamlined setup for accessing SDE desktops. It's suitable for machines that can't run Windows 11 and can be run from a USB key or installed on the disk.

Knowledge base 23 Nov 2026

SDE Labs tutor guide: classes and students' copies

The article provides a comprehensive guide for tutors and Labs admins on managing SDE Labs classes, including creating classes, setting parameters, and handling student copies. It covers essential admin tasks like pausing classes, resetting student copies, and generating reports.

Knowledge base 23 Nov 2026

SDE Labs troubleshooting

This guide provides troubleshooting steps for common issues in SDE Labs, such as blueprint saving errors and console access problems. It includes causes and solutions for each problem, aimed at engineers, Labs admins, and helpdesk staff.

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.