Skip to content

Attach Linux to AD

Emma edited this page Apr 17, 2025 · 7 revisions

Introduction

The goal of this lab is to attach linux to AD. I don't know much more about the specifics so my own plan for this lab is to promote my AD Box to a domain controller, create a domain and domain join my Ubuntu box. This GitHub will serve as my documentation for my process.


Making Sullivan-WindowsAD my Domain Controller

Step 1: Install AD DS on AD Box

  1. In Server Manager go to "Manage" -> "Add Roles and Features"

image

  1. "Before you Begin" Page -> Next
  2. Select "Role-based or feature-based installation"
  3. In "Server Selection" click "Select a server from the server pool" and Select "Sullivan-Windows AD" as the destination server. Click next.

image

  1. In "Server Roles" Select Active Directory Domain Services and DNS Server. (The DNS server is optional but all my classes have had me use AD as DNS so I'm going to do it here as well.)

image

  1. Take note of the default features and click next
  2. AD DS Page -> Next
  3. DNS Page -> Next
  4. Confirm installation selections and click install.

image

Step 2: Promote Sullivan-WindowsAD to Domain Controller

  1. In Server Manager there should be a notification that you need to configure AD DS. Click the blue text promote this server to a domain controller.

image

  1. Add a new forest

image

  1. Set up a DSRM password in case of emergency.
  2. Don't create a DNS delegation. Ignore the alert, you are not integrating with existing DNS infrastructure.
  3. "Additional Options" page -> next
  4. Use defaults for the AD DS database, log files, and SYSVOL locations.
  5. Verify your selections and click next
  6. Wait through the prerequisite check and install
  7. Restart your server

Step 3: Creating a named admin and user account.

This is not a requirement, it's just best practice to access from a named administrator account instead of the Administrator account.

  1. Sign in as the Domain Administrator (Administrator@emma.local)
  2. Go to Active Directory Users and Computers
  3. Navigate to emma.local and to the Users Organizational Unit

image

  1. Right-Click -> New -> User
  2. Input user information -> next -> set a password

image

  • Note: AD is a database of objects. Users and computers are considered objects and are sorted into Organizational Units (folders)
  1. This is our admin account so we are going to add it to the "Domain Admins" group. Double click on the newly created user.
  2. Go to the page labeled "Member Of" and click add. In the dialog box that pops up type "Domain Admins" -> Check Names -> OK. Apply changes.

image

  1. To create a non-admin user follow the same steps but don't add them to the Domain Admins group.
  2. Log out and sign back in as the named admin.

Domain Joining InternUbuntu-Emma (VM Name) / Ubuntu1-Sullivan (Computer Name)

Step 1: Install realmd

  1. sudo -i
  2. apt update
  3. apt install realmd sssd sssd-tools libnss-sss libpam-sss adcli samba-common-bin oddjob oddjob-mkhomedir packagekit

Step 2: Add DNS

  1. nmcli connection show To find the connection name
  2. nmcli con mod "Profile 1" ipv4.dns "172.16.8.28"
  3. nmcli con mod "Profile 1" ipv4.dns-search "emma.local"
  4. nmcli con up "Profile 1"
  5. ping -c 1 <AD BOX IP> to check connectivity

image

  1. ping -c 1 Sullivan-WindowsAD to check if hostnames can resolve.

image

Step 3: Realm join

  1. sudo realm discover emma.local

image

  1. Check if required packages are installed sudo apt install sssd-tools sssd libnss-sss libpam-sss adcli samba-common-bin
  2. realm join --user=emma.sullivan-adm@EMMA.LOCAL EMMA.LOCAL
  3. realm list should verify that we are in the domain.

image


Verifying that InternUbuntu-Emma is in the domain

Check Active Directory Users and computers

  1. Search bar -> Active Directory Users and Computers
  2. Computers Organizational Unit

image