Preface

I have been waiting for a long time to write this post.  In order to test this out, I needed to upgrade my home lab.  I had a VM machine running XCP-NG (I tried Proxmox, it’s just not the same), but it had an old dual core Intel and 8GB of ram, so not much I could do with other than host a good single VM… which is pointless, the server might as well be the function of that single VM.  So recently I was able to upgrade my main system to a Ryzen 5 5600X with a new mobo, RAM, and PSU, so I figured I would use my old Ryzen 5 1600X in the server.  So now I have 6 cores which translated to 12 Threads (each of which can be used as a virtual CPU), 32GB of RAM, and more then enough resources to make a few VMs with multiple purposes.  The first of which of course was a Linux based Active Directory.

Video

https://www.youtube.com/watch?v=KT6O-TfJ41g

 

Note:
Please note, the following commands are meant to accompany the video, some context may be missing.

Prerequisites

  • Ubuntu Server (20.04/22.04)
  • A user account with sudo privileges
  • A Windows 10 PRO computer on the same network
  • A Linux Desktop on the same server (Fedora or Ubuntu based)

In this example will be using Ubuntu 22.04 Server for the Active Directory. We will be connecting to it with a Windows 10 PRO client as well as Fedora as the Linux based client

DC Server Setup

Set the Server Hostname

For this demonstration we will be using the hostname dc1 for the Ubuntu server

Add Server to Hosts File

We will also need to modify the hosts file, add the following line to /etc/hosts

Verify Hostname

You can quickly verify everythign worked with the following command

Disable the DNS Resolver

Disable the DNS Resolver and unlink the config

Create our own Resolv.conf

Enter the following into /etc/resolv.conf

Make the file immutable

As we do not want anything to change this file automatically, we make it immutable so that it does not get modified

Installing Samba

Enter the appropriate info

Disable Samba Services

Activate samba-ad-dc

Configuring Samba Active Directory

First backup the original smb.conf file

Provision the Active Directory

Enter the following info

  1. On Realm prompte – <Enter>
  2. On Domian Promp – <Enter>
  3. On Server Roll – <Enter>
  4. On DNS Backend – <Enter>
  5. DNS Forwarding IP – 9.9.9.9
  6. Enter an Admin Password

Backup and replace the Kerberos Config

Start samba-ad-dc

Set up Time Synchronization

Set permissions

Update Chrony

add the following to /etc/chrony/chrony.conf

Then restart Chrony and get it’s status

Verifying Samba Active Directory

Run the following to verify

Then verify the Kerberos and ldap services

Then verify the Samba resources

Lastly KINIT

Create your first user (Optional)

The reason why this is optional, is you have more options when adding a user through the Remote Server Administration Tools (RSAT) on Windows.

Windows Setup

PreCheck

  1. Set Computer Name
  2. Set DNS/IP,  The first DNS should be your Samba Server set up above

Verify DNS resolver

Add Server to Directory

After restart login as domain user

Install RSAT to administer domain from Windows

Download RSAT tools <– For Windows 10 – Could not find a DL source for Windows 11, something I need to look into.

Linux Setup

Precheck

  1. On Ubuntu, you may need to add the Universe repositories

Set Hostname

Modify Resolved info

On Fedora edit the Resolved config (This works on Ubuntu as well, old editions you may need to change the /etc/resolv.conf file)

Install required packages (Ubuntu Only)

For Ubuntu Only

Discover the Domain (Optional)

Join the Domain

Restart and you will be able to login as Domain user