Main page » Linux AD-DC on Ubuntu 18.04 – Setting Samba4 – Part 1

Linux AD-DC on Ubuntu 18.04 – Setting Samba4 – Part 1

by Belfigor
Configuring Samba4 for Linux AD-DC on Ubuntu 18.04 - Part 1

Setting up Samba4 for Linux AD-DC on Ubuntu 18.04 is our current goal. In an earlier article we prepared the ground to now initiate the domain. Successfully initiated domain will allow us to advance to the next article and tweak bind9.

All articles in best to study order:

  1. Configuring BIND9 for Linux AD-DC on Ubuntu 18.04 – Part 1

  2. Linux AD-DC on Ubuntu 18.04 – Setting Samba4 – Part 1

  3. Set up BIND9 for Linux AD-DC on Ubuntu 18.04 – Part 2

  4. Linux Samba4 AD-DC on Ubuntu 18.04 – Settings – Part 2

  5. DHCP server for Linux AD-DC Ubuntu 18.04. Integration with BIND9

  6. Domain Controller on Ubuntu 18.04 – Time Synchronization – NTP

  7. Administering the Linux domain controller

Key package versions

Remember that recently versions of packages have become a critical element. Despite this, in the Ubuntu 18 repository, updates rolling out now in the Ubuntu 20 repository should not be reached.

  1. Samba4: Version 4.7.6-Ubuntu
  2. bind9 (named): BIND 9.11.3-1ubuntu1.13-Ubuntu (Extended Support Version) <id:a375815>


  1. Set up Samba4 for Linux AD-DC on Ubuntu 18.04 – Part 1

    1. Turn off systemd-resolved

      1. Stop the service

        sudo service systemd-resolved stop
      2. We remove from the auto-start

        sudo systemctl disable systemd-resolved.service
      3. Remove simlink/etc/resolv.conf

        sudo rm /etc/resolv.conf
      4. Open and change the config

        sudo nano /etc/resolv.conf
      5. Set up the address of the server name as in the picture.

        search adminguide.lan

        Now, nameserver should be configured to the address of our current DNS server, which is located for example on a router or where
        Search lists the name of our future domain
        Keep the Ctrl’O changes

    2. Set up file /etc/hosts

      Be sure that AD DC can be opted for by name to your IP address inside a customizable network, even when pinging from AD DC
      Open the file and make changes

      sudo nano /etc/hosts localhost.localdomain localhost ag-dc-1.adminguide.lan ag-dc-1

      We apply changes

    3. We check that the system does not work self-propelled processes

      ps ax | egrep "samba|smbd|nmbd|winbindd"

      There should be no process, as in the picture:Set up Samba4 for Linux AD-DC on Ubuntu 18.04 - Part 1

    4. Linux AD-DC on Ubuntu 18.04 – Install Samba

      It is very important to remember that the domain controller on the samba is initiated once and for all. The possibility to change its name in the future – is absent in principle. Once called it, with such a name it will exist until the end of centuries or until you kill him. Calling the domain ADMINGUIDE. LAN, it will always remain with this name ADMINGUIDE. Lan. Samba4 does not support domain renaming. Once you’ve initiated it, to change the name, you’ll have to exclude from the domain all the machines that have managed to enter it, remove AD DC, set everything up from scratch and enter the machines already in it. So I strongly recommend thinking through every step before you start initialing the domain, reading this instruction to the very end, thinking over the nuances to avoid future mistakes.

      1. Install samba4 and all the packages you want with the following line:

        sudo apt -y install samba krb5-config winbind smbclient krb5-user

        In order to initiate Linux AD-DC on Ubuntu 18.04 successfully, it is important not to make any mistake when entering data on kerberos configuration screens

      2. Default area for Kerberos 5

        On this screen, we should automatically put the name of our domain in large letters: ADMINGUIDE. Lan

        Ubuntu Domain Controller - Default Area for Kerberos v5

        Default area for Kerberos v5

      3. Kerberos server for your area

        Here we have to enter the name of the domain everything in the lower register, in this case it is:


        Ubuntu Domain Controller - Kerberos Server for our area

        Server kerberos for our area

      4. Managing server of your area Kerberos

        At this stage we are introducing the same as in the previous one:


        Ubuntu Domain Controller - Kerberos Domain Server Manager

        Kerberos field server manager

      5. We expect the installation to end

        Samba 4 installation results

        Samba 4

      6. Backup file with original Samba settings

        sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.bkp
    5. Linux AD-DC on Ubuntu 18.04 – Initialize domain controller

      1. Start initialization with option –interactive

        From our AD DC, we will be driving users and groups of computers with linux operatings. Therefore, we activate compatibility with NIS more contagiously using the command –use-rfc2307

        sudo samba-tool domain provision --use-rfc2307 --interactive

        Turning on Network Information Service (NIS) support won’t hurt AD DC, even though it will never run into Linux servers or computers. At the same time, if you set up a controller without this option, and someday you’ll have Linux machines in it, you’ll have to modify the AD scheme and add NIS support. To do this of course will have to kill the controller at great risk.

      2. Linux AD-DC on Ubuntu 18.04 – Domain Settings

        If there were no errors in the set-up process, the parameters you need to adjust other than the DNS backend installer will place in brackets as defaulted values.

        Domain [ADMINGUIDE]:
        Server Role (dc, member, standalone) [dc]:
        DNS forwarder IP address (write 'none' to disable forwarding) []:
        Administrator password:
        Retype password:

        At the moment when the installer asks to enter the password, the best way to set such that is more reliable, because. We will use it for authorization under the AD DC administrator.
        If at the moment in the default values are not the values that you expect, most likely admitted a serious joint, it is better to start to adjust again.
        Ubuntu Domain Controller - Initialization

      3. Linux AD-DC on Ubuntu 18.04 – Check the effects of initialization

        If we see information similar to the one below, it means that the domain controller on Ubuntu has successfully completed the initialization:
        At the end see where the samba holds the config and config krb5

        Set up Samba4 for Linux AD-DC on Ubuntu 18.04 - Part 1 - Domain Initialization Result

        The result of domain initialization

    6. Let’s move on to “Ubuntu Domain Controller – BIND9 Configuration – Part 2”

      At this point, we can consider that the setting of Samba4 for Linux AD-DC on Ubuntu 18.04, or rather the first part of it, completed successfully.

At the moment, all text content a week earlier is published in my zen blog. Russian-language premieres of video lessons 🙂

The same videos are published on Youtube channel, but there are first English-language premieres 🙂 - 100.00%

You may also like

Leave a Comment