How to Install FreeIPA on AlmaLinux or Rocky 8

A tutorial to learn the steps and commands to install FreeIPA on CentOS 8, AlmaLinux, or Rocky Linux 8  Server distros to get a centralized authentication, authorization, and account information system.

FreeIPA stands for Free Identity, Policy, Audit and it is an open-source identity management solution based on an LDAP directory and Kerberos with optional components such as DNS server, certification authority, and more.  It can manage a domain with users, computers, policies, and trust relationships. Isn’t it sounds like Microsoft Active Directory? Yes, it is exactly what it is all about. FreeIPA can also set up a forest-to-forest trust with existing Active Directory forests and even live in a DNS zone below a zone managed by Active Directory, as long as they do not overlap. It consists of a web interface and command-line administration tools.

Requirements:

  • the hostname must be fully qualified and can be resolved. Here we are using a subdomain i.e demo.how2shout.com
  • At least 1GB of RAM and 10GB of free disk

 

Steps to install FreeIPA on AlmaLinux or Rocky Linux 8

The below-given commands can also be used on CentOS 8, Oracle Linux, VzLinux, and other RPM-based operating systems.

1. Set hostname in AlmaLinux or Rocky

As we need to have a fully qualified domain name to access and use FreeIPA properly, we need to set the FQDN hostname we want to use. For example, here we are using demo.how2shout.com which can be resolved using our DNS server. However, if you don’t have a DNS server, then we need to manually add entries in the host file of the Almalinux server to resolve the system IP address for our fully qualifies hostname.

sudo hostnamectl set-hostname demo.example.com

Replace demo.example.com with the one you want to set for your server’s hostname.

The domain used for the hostname must resolve the IP address to reach to server.  Next, point your server IP address to hostname i.e fully qualified Domain name, in the Host file.

echo "192.168.0.110 demo.example.com demo" | sudo tee -a /etc/hosts

Replace192.168.0.110 with your server IP address and demo.example.com with your FQDN hostname.

Note: If you want to test FreeIPA locally, then it is recommended to use reserved TLD such as .local. .test or even .home can be used- example: demo.IPA.local

Once done, confirm that the system can ping the host to resolve the same.

ping -c 2 demo.example.com

Now, reboot:

sudo reboot

 

2. Run system update

Before moving further, let’s run the system update command once to make sure all the system packages are up to date, and also this will rebuild the system’s repo cache.

sudo dnf update

 

3. Enable Red Hat Enterprise Linux Identity Management system module

FreeIPA Server and client packages are available through the default App stream repository, however, to get them, first, we need to enable the IDM – Identity Management system module on our AlmaLinux or Rocky Linux we are using.

sudo dnf install @idm:DL1

Enabel Redhat IDM on AlmaLinux or Rocky Linux

 

4. Install FreeIPA on AlmaLinux or Rocky Linux 8

Once the IDM module has been enabled on your server system, it’s time to install all the required packages for FreeIPA on our system.

sudo dnf install ipa-server

If you want to install the FreeIPA DNS server as well then also run the following command as well:

sudo dnf install ipa-server-dns bind-dyndb-ldap

 

5. Set up FreeIPA Server

So far we have downloaded and installed all the key things we required to set up the FreeIPA server on AlmaLinux or Rocky, so, let’s start with it.

sudo ipa-server-install

The above command will start the text-based wizard. It will ask you some common questions. The initial ones will be the integration of BIND DNS, by default, it will be set to ‘NO‘. Thus, simply press the Enter to continue without it. However, if you want to set a BIND DNS on your Alma or Rocky to resolve domain names, then type- yes and hit the Enter key.

After that, the script will automatically detect the server hostname and the  domain you have set for the hostname

Thus, simply press the Enter key for both options.

Configure domain name for freeIPA server

After setting up the above entries, the setup will ask you to set up a directory manager password, and IPA admin password for the web interface. Next, it will ask to configure the NTP server with chronic accept the default (no) or type yes as per your choice.

Remember when it asks you to continue to configure the system these values, type – yes and hit the Enter key.

 

6. Configure Linux Firewalld

If you are using your server on some cloud service then use its firewall to whitelist the following ports:

You must make sure these network ports are open:

TCP Ports:
80, 443: HTTP/HTTPS
389, 636: LDAP/LDAPS
88, 464: Kerberos

UDP Ports:
88, 464: Kerberos
123: NTP

Whereas, if you are using Firewalld in your server system, then simply run, the following two commands:

sudo firewall-cmd --add-service={http,https,dns,ntp,freeipa-ldap,freeipa-ldaps} --permanent
sudo firewall-cmd --reload

7.  Access FreeIPA GUI Web Interface

Once the installation is completed by the script, open your system browser and point it to the FQDN hostname you set for the system in the beginning e.g https://demo.example.com or even if you type https://your-server-ip this will automatically redirect it to the FQDN.

FreeIPA installation on AlmaLinux or Rocky Linux 8

 

8. Login

The default username to login FreeIPA is admin whereas the password is the same you have set for it while installing the FreeIPA server in Steps 5 of this article.

Login FreeIPA

 

FreeIPA Command-line

Those who don’t want to use the FreeIPA web GUI interface can go for the command line to perform various operations such as creating users, testing SSH login for users, and more…

To start using CLI, type-

sudo kinit admin

First Enter the system user password and then the one you set for FreeIPA during its installation.

Once you logged in, you can start using ipa commands. To get all details on its command options, see the man page:

man ipa

for example, to create a user-

sudo ipa user-add testuser --first=Test --last=User --email=testuser@example.com --password

Once the user-added, you can authenticate it with:

You can now authenticate as the new user with

kinit <user>

To list user accounts

sudo ipa user-find

To log in with created user:

ssh [email protected]

For more information see the official documentation.

FreeIPA Uninstallation from AlmaLinux or rocky

In case you are facing some problem with the open-source identity management system or you don’t need it anymore, then use the below command to remove FreeIPA from CentOS, AlmaLinux, Rocky, or any other similar Linux system you are using.

sudo ipa-server-install --uninstall

 

Other articles:

 

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.