Официальная документация SAMBA: Setting up Samba as an Active Directory Domain Controller
apt install -y acl attr samba samba-dsdb-modules samba-vfs-modules smbclient winbind libpam-winbind libnss-winbind libpam-krb5 krb5-config krb5-user dnsutils net-tools
systemctl disable --now smbd nmbd winbind systemd-resolved
sudo systemctl unmask samba-ad-dc
sudo systemctl enable samba-ad-dc
rm /etc/samba/smb.conf
samba-tool domain provision --use-rfc2307 --interactive
rm /etc/krb5.conf
cp /var/lib/samba/private/krb5.conf /etc/krb5.conf
unlink /etc/resolv.conf
nano /etc/resolv.conf
nameserver 10.20.30.10
search lab.lan
samba-tool user create support 'Specialist1!' --given-name 'Tech' --surname 'Support'
host -t A lab.lan
host -t A lin-dc.lab.lan
host -t SRV _kerberos._udp.lab.lan
host -t SRV _ldap._tcp.lab.lan
kinit administrator@LAB.LAN
klist
. /etc/os-release
sudo apt install -t ${VERSION_CODENAME}-backports cockpit
curl -fsSL https://download.opensuse.org/repositories/home:/Hezekiah/xUbuntu_20.04/Release.key | sudo apt-key add -
sudo add-apt-repository "deb https://download.opensuse.org/repositories/home:/Hezekiah/xUbuntu_20.04 ./"
apt-get update
apt-get install cockpit-samba-ad-dc