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

2 years ago 333

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

almalinuxhero.jpg

Image: Jack Wallen

If you've begun deploying AlmaLinux into your data center or your cloud-hosted services, you might have a reason to join those servers to your existing Active Directory domain. At first blush, you might think that process is a drawn-out exercise in command-line marathons. It's not. Believe it or not, thanks to the Cockpit web-based GUI, the process is incredibly simple.

And I'm going to show you how it's done.

SEE: Security incident response policy (TechRepublic Premium)

What you'll need

To make this work, you'll need an instance of AlmaLinux, a running Active Directory Domain Controller, and a user with sudo privileges (or the root user itself).

How to enable Cockpit

The first thing you must do is enable Cockpit since it's not enabled out of the box. Do this, log in to your AlmaLinux server and issue the command:

sudo systemctl enable --now cockpit.socket

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

How to set the hostname

Before you can join the domain, you must first set the computer's hostname. Let's say, for example, the domain you'll be joining is example.lan. You might want to set your domain to almalinux.example.lan. For that, you could either use the command line or do it through Cockpit. From the terminal, that command would be:

sudo hostnamectl set-hostname almalinux.example.lan

If you'd rather do this through Cockpit, click Edit next to the hostname and then, when prompted (Figure A), type a Pretty Host Name (such as almalinux) and the full hostname (such as almalinux.example.lan). Click Change when finished.

Figure A

almaada.jpg

Setting the hostname for AlmaLinux through Cockpit.

How to connect AlmaLinux to the domain

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

Figure B

almalinuxadb.jpg

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

In the resulting window, you'll 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 Administrator password.

Figure C

almalinuxadc.jpg

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

almalinuxadd.jpg

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

Congratulations, you've just joined your AlmaLinux server to an Active Directory domain, via the web-based GUI, Cockpit.

Subscribe to TechRepublic's How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.

Cybersecurity Insider Newsletter

Strengthen your organization's IT security defenses by keeping abreast of the latest cybersecurity news, solutions, and best practices. Delivered Tuesdays and Thursdays

Sign up today

Also see

Read Entire Article