Today, we will see how to join an Ubuntu server (version 16.04) to an Active Directory domain. It could be useful in case of you want that your administrators use their domain account to connect to servers, etc.

To start, connect to your server and execute the following command to install packets that will help us to join the domain:

command to install packets

A new page will open and ask you the domain name, write it:

the command page

Now, you need to configure the date to have the same that your domain controller. Edit the file ntp.conf and provide the name or the IP of your domain controller :

the configuration window

Restart the NTP service:

You can show your date/hour with the command date:

the command window

We will now configure the Kerberos part. Because our configuration will be new, we will delete everything inside the file and insert our new configuration. Execute the following commands:

Adapt the configuration with your values:

command window

Save the file. We will create a token for a user in our AD, who has rights to join the server to the domain. Execute the following command:

And, to verify that the token has been created correctly, execute the command sudo klist:

command window

We will modify the configuration file for Samba. If you want to have another name that the name in /etc/hostname, add the line NetBIOS name = newservername. Replace the line workgroup = WORKGROUP in the configuration file by the following, by adapting with your values:

Command window

Save the configuration. We will now modify the file nsswitch.conf to indicate that we will use groups and users of the Active Directory (winbind):

command window

StarWind HyperConverged Appliance is a turnkey, entirely software-defined hyperconverged platform purpose-built for intensive virtualization workloads. Bringing the desired performance and reducing downtime, the solution can be deployed by organizations with limited budgets and IT team resources. Also, it requires only one onsite node to deliver HA for your applications that make the solution even more cost-efficient.
Find out more about ➡ StarWind HyperConverged Appliance

It’s now time to join our Ubuntu Server 16.04 to our Active Directory. Use the following command:

command window

You can ignore the error concerning the DNS. The object in the Active Directory:

Active Directory window

ubuntu properties window

We will try that the Active Directory authentication is working fine. Use the following command:

A display appears. Be sure that the line Winbind NT/Active Directory authentication is selected. I selected the line to create a default repository for each user, when he will connect to the server:

command window

Restart services to apply all changes:

command window

You can use the following commands to check that the Active Directory synchronization has working fine:

command window

command window

command window

I added my username in the sudoer group:

command window

You can connect to your Ubuntu server with your domain account and move to root:

command window

The next article will be on the installation and utilization of the SQLCMD tool to manage your SQL Server databases, from a Linux server 🙂

Views All Time
Views Today
Appreciate how useful this article was to you?
1 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 5
5 out of 5, based on 1 review
Back to blog
The following two tabs change content below.
Florent Appointaire
Florent Appointaire is Microsoft Engineer with 5 years of experience, specialized in Cloud Technologies (Public/Hybrid/Private). He is a freelance consultant in Belgium from the beginning of 2017. He is MVP Cloud and Datacentre Management. He is MCSE Private Cloud and Hyper-V certified. His favorite products are SCVMM, SCOM, Windows Azure pack/Azure Stack and Microsoft Azure.