How to easily join an AlmaLinux server to an Active Directory domain with Cockpit

Jack Wallen shows you how easy it is to join an existing AlmaLinux server to an Active Directory domain via a web GUI.

Image: Jack Wallen

If you have started deploying AlmaLinux in your data center or cloud-hosted services, you may have a reason to join these servers to your existing Active Directory domain. At first glance, you might think the process is a never-ending exercise in command-line marathons. It’s not. Believe it or not, thanks to Cockpit’s web GUI, the process is incredibly simple.

And I’ll show you how it’s done.

SEE: Security Incident Response Policy (TechRepublic Premium)

What you will need

For this to work, you will need an instance of AlmaLinux, a running Active Directory domain controller, and a user with sudo privileges (or the root user itself).

How to activate Cockpit

The first thing you need to do is enable Cockpit as it is not enabled by default. To do this, connect to your AlmaLinux server and run the command:

sudo systemctl enable --now cockpit.socket 

That’s all it takes to activate Cockpit. You can now point a web browser to https://SERVER:9090 (where SERVER is either the IP address or the domain of the AlmaLinux server).

How to set hostname

Before you can join the domain, you must first set the hostname of the computer. Say, for example, the domain you will be joining is example.lan. You might want to set your domain to almalinux.example.lan. For this, you can either use the command line or do it via Cockpit. From the terminal, this command would be:

sudo hostnamectl set-hostname almalinux.example.lan 

If you prefer to do this through Cockpit, click Edit next to the hostname, then when prompted (Figure A), type in a nice hostname (such as almalinux) and the full host name (such as almalinux.example.lan). Click Edit when you’re done.

Figure A

Definition of hostname for AlmaLinux via Cockpit.

How to connect AlmaLinux to the domain

You are now ready to connect AlmaLinux to the domain. Click Join Domain in the Configuration section (Figure B).

Figure B

The main Cockpit page makes it easy to connect to a domain.

In the resulting window, you will first type the address of your domain controller. As soon as AlmaLinux finds the controller (Figure C), you can then select the authentication type, add the administrator name and the administrator password.

Figure C

Cockpit was able to see the domain controller and is ready for authentication.

At this point, AlmaLinux is now connected to the domain (Figure D).

Figure D

Our AlmaLinux server is connected to my Active Directory domain monkeypantz.lan.

Congratulations, you have just joined your AlmaLinux server to an Active Directory domain, via the Web GUI, Cockpit.

Subscribe to TechRepublic’s How To Make Tech Work YouTube Video for all the latest tech tips for professionals from Jack Wallen.

Comments are closed.