Ubuntu 18.04 - Deploy Samba Active Directory
This tutorial will explain how to deploy a Samba server to act as an Active Directory (AD) for your Windows network. This is a free alternative to deploying Microsoft Active Directory, and once deployed, can be managed by the same remote tools on Windows workstations.
sudo apt update && \ sudo apt-get install -y krb5-config samba winbind smbclient
Backup the default samba configuration so that we can restore it if things go horribly wrong.
sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.bak
Use the following command to start an interactive prompt for generating a new
sudo samba-tool domain provision
(I used defaults for everything)
Copy the Kerberos configuration file to the etc directory (I couldn't find this file until I also installed krb5-config)
cp /var/lib/samba/private/krb5.conf /etc/.
Stop and disable some the following services. These will be run by our active directory service later.
sudo systemctl disable --now smbd nmbd winbind systemd-resolved
Unmask the samba active directory service, enable it, and start it.
sudo systemctl unmask samba-ad-dc.service sudo systemctl enable --now samba-ad-dc.service
Check that everything is running by running:
samba-tool domain level show
Configure server to use our own domain server
sudo rm /etc/resolv.conf sudo vim /etc/resolv.conf
Put in the IP address of your DNS server(s). E.g.
nameserver 192.168.1.1 nameserver 192.168.1.2
samba-tool user create myUserName
Enter a password when prompted.
Then you can go back to windows workstation and log in with
myUserName and the user you just set.
First published: 16th June 2020