How to Install and Configure FreeIPA on Rocky Linux/Centos 8

Pinterest LinkedIn Tumblr

In this guide, you will learn how to install and configure FreeIPA server on Rocky Linux/Centos 8. This guide also works on RHEL 8 and other derivatives like Oracle Linux and Alma Linux.

FreeIPA is 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. It is similar to Microsoft Active Directory.

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.

Also Check:


To follow along well, ensure you have:

  • A RHEL 8 based server like Rocky Linux
  • The server should have at least 1GB of RAM, 2GB for optimum performance
  • The server should have at least 10GB of disk space
  • Root access or user with sudo access
  • Set up a fully qualified domain name as hostname. We will use subdomain in our case

Table of content

  1. Update system, Set hostname and Timezone
  2. Installing FreeIPA Server
  3. Running FreeIPA Server Installer
  4. Configure Linux Firewalld
  5. Access FreeIPA Gui Web Interface
  6. Using FreeIPA CLI Interface to do basic operations

1. Update system, Set hostname and Timezone

Use this command to ensure that our system packages are up to date:

sudo dnf -y update

We need to set up the FQDN(Fully qualified domain name) we want to use to point to our server. We need to set the subdomain ( DNS to resolve to our server. if you don’t have a DNS server, then we need to manually add entries in the host file of our server to resolve the system IP address for our fully qualifies hostname.

Set hostname:

sudo hostnamectl set-hostname

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

Confirm the hostname:

$ hostnamectl
   Static hostname:
         Icon name: computer-vm
           Chassis: vm
        Machine ID: ee3563997878469ebfcc3f721aec3c66
           Boot ID: 029a7962df24475091296d32b222f166
    Virtualization: kvm
  Operating System: Rocky Linux 8.4 (Green Obsidian)
       CPE OS Name: cpe:/o:rocky:rocky:8.4:GA
            Kernel: Linux 4.18.0-305.3.1.el8_4.x86_64
      Architecture: x86-64

$ 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 " ipa" | sudo tee -a /etc/hosts

Replace with your server IP address and with your FQDN hostname.

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

ping -c 2

Output on my machine

# ping -c 2
PING ( 56(84) bytes of data.
64 bytes from ( icmp_seq=1 ttl=64 time=0.033 ms
64 bytes from ( icmp_seq=2 ttl=64 time=0.029 ms

--- ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1039ms
rtt min/avg/max/mdev = 0.029/0.031/0.033/0.002 ms

Finally, let us set up the timezone to match the region you are in. For me I am in the Africa/Nairobi timezone, I will use this command:

sudo timedatectl set-timezone Africa/Nairobi

Confirm that it was configured as expected:

$ timedatectl
               Local time: Tue 2021-11-09 07:58:09 EAT
           Universal time: Tue 2021-11-09 04:58:09 UTC
                 RTC time: Tue 2021-11-09 04:58:08
                Time zone: Africa/Nairobi (EAT, +0300)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

2. Installing FreeIPA Server

No extra RPM repository is required, all the packages and dependencies are available in default OS default repositories.

In EL8 based systems,the packages necessary for installing FreeIPA server are shipped in a module stream called the DL1 stream. You’ll need to enable the stream before performing packages installation from the stream.

You can use the following command to list modules that contain IdM packages.

$ sudo yum module list idm

Rocky Linux 8 - AppStream
Name Stream     Profiles                        Summary
idm  DL1        adtrust, client, common [d], dn The Red Hat Enterprise Linux Identity Management syst
                s, server                       em module
idm  client [d] common [d]                      RHEL IdM long term support client module

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

You can check more about the Stream using the command:

sudo dnf module info idm:DL1

Now Enable the idm:DL1 stream:

sudo dnf module enable idm:DL1

Output on my system

$ sudo dnf module enable idm:DL1
Last metadata expiration check: 0:45:05 ago on Tue 09 Nov 2021 07:22:21 AM EAT.
Dependencies resolved.
 Package                Architecture          Version                   Repository              Size
Enabling module streams:
 389-ds                                       1.4
 httpd                                        2.4
 idm                                          DL1
 pki-core                                     10.6
 pki-deps                                     10.6

Transaction Summary

Is this ok [y/N]: y

Choose one of the following options, depending on your IdM requirements:

  • Installing IdM server without an integrated DNS:
sudo dnf module install idm:DL1/server
  • Installing FreeIPA server with an integrated DNS:
sudo dnf module install idm:DL1/dns
  • Installing FreeIPA server that has a trust agreement with Active Directory:
sudo dnf module install idm:DL1/adtrust
  • For multiple profiles, e.g dns and adtrust profiles:
sudo dnf module install idm:DL1/{dns,adtrust}
  • For FreeIPA client
sudo dnf module install idm:DL1/client

3. Running FreeIPA Server installer

With the FreeIPA packages installed, we can now run the ipa-server-install utility. The installer script will create a log file at /var/log/ipaserver-install.log:

sudo ipa-server-install

The script prompts for several required settings and offers recommended default values in brackets.

To accept a default value, press Enter. To provide a custom value, enter the required value. For Non-interactive installation for IdM without DNS use this:

sudo ipa-server-install \
  --realm IPA.CITIZIX.COM \
  -domain \
  --ds-password ds_password \
  --admin-password admin_password \

The minimum required options for non-interactive installation are:

  • --realm to provide the Kerberos realm name
  • --ds-password to provide the password for the Directory Manager (DM), the Directory Server super user
  • --admin-password to provide the password for admin, the IdM administrator
  • --unattended to let the installation process select default options for the host name and domain name

For non-interactive installation for IdM with integrated DNS, use this:

sudo ipa-server-install \
    --domain \
    --realm IPA.CITIZIX.COM \ \
    --no-forwarders \
    --no-ntp \
    --setup-dns \
    --ds-password ds_password \
    --admin-password admin_password \

This is the output of an interactive session on my server:

$ sudo ipa-server-install

The log file for this installation can be found in /var/log/ipaserver-install.log
This program will set up the IPA Server.
Version 4.9.2

This includes:
  * Configure a stand-alone CA (dogtag) for certificate management
  * Configure the NTP client (chronyd)
  * Create and configure an instance of Directory Server
  * Create and configure a Kerberos Key Distribution Center (KDC)
  * Configure Apache (httpd)
  * Configure the KDC to enable PKINIT

To accept the default shown in brackets, press the Enter key.

Do you want to configure integrated DNS (BIND)? [no]: no

Enter the fully qualified domain name of the computer
on which you're setting up server software. Using the form

Server host name []:

The domain name has been determined based on the host name.

Please confirm the domain name []:

The kerberos protocol requires a Realm name to be defined.
This is typically the domain name converted to uppercase.

Please provide a realm name [IPA.CITIZIX.COM]: IPA.CITIZIX.COM
Certain directory server operations require an administrative user.
This user is referred to as the Directory Manager and has full access
to the Directory for system management tasks and will be added to the
instance of directory server created for IPA.
The password must be at least 8 characters long.

Directory Manager password:
Password (confirm):

The IPA server requires an administrative user, named 'admin'.
This user is a regular system account used for IPA server administration.

IPA admin password:
Password (confirm):

Do you want to configure chrony with NTP server or pool address? [no]: no

The IPA Master Server will be configured with:
IP address(es):
Domain name:
Realm name:     IPA.CITIZIX.COM

The CA will be configured with:
Subject DN:   CN=Certificate Authority,O=IPA.CITIZIX.COM
Subject base: O=IPA.CITIZIX.COM
Chaining:     self-signed

Continue to configure the system with these values? [no]: yes

The following operations may take some minutes to complete.
Please wait until the prompt is returned.

Disabled p11-kit-proxy
Synchronizing time
No SRV records of NTP servers found and no NTP server or pool address was provided.
Using default chrony configuration.
Attempting to sync time with chronyc.
Time synchronization was successful.
Configuring directory server (dirsrv). Estimated time: 30 seconds
  [1/41]: creating directory server instance
  [2/41]: tune ldbm plugin
  [3/41]: adding default schema

Upon successful installation:

Client configuration complete.
The ipa-client-install command was successful

Please add records in this file to your DNS system: /tmp/ipa.system.records.87gb3voq.db
Setup complete

Next steps:
	1. 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

	2. You can now obtain a kerberos ticket using the command: 'kinit admin'
	   This ticket will allow you to use the IPA tools (e.g., ipa user-add)
	   and the web user interface.

Be sure to back up the CA certificates stored in /root/cacert.p12
These files are required to create replicas. The password for these
files is the Directory Manager password
The ipa-server-install command was successful

4. Configure Linux Firewalld

If you have firewalld installed and firewall enabled in your system, you have to open the FreeIPA ports for access.

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

To open the ports using firewalld, use these commands:

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

5. 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 or even if you type https://your-server-ip this will automatically redirect it to the FQDN.

Ignore SSL warning by clicking “Advanced” > “Proceed to (unsafe)” if you get it.

Upon successful login you’re presented with the Identity Dashboard interface

6. Using FreeIPA CLI Interface to do basic operations

The ipa command can be used to perform all FreeIPA server operations.

But first, get admin user Kerberos ticket:

$ sudo kinit admin
Password for [email protected]:

Check ticket expiry information using klist.

$ sudo klist
Ticket cache: KCM:0
Default principal: [email protected]

Valid starting       Expires              Service principal
11/09/2021 09:03:25  11/10/2021 09:03:19  krbtgt/[email protected]
  1. Set user’s default shell to /bin/bash.
$ sudo ipa config-mod --defaultshell=/bin/bash
  Maximum username length: 32
  Maximum hostname length: 64
  Home directory base: /home
  Default shell: /bin/bash
  Default users group: ipausers
  Default e-mail domain:
  Search time limit: 2
  Search size limit: 100
  User search fields: uid,givenname,sn,telephonenumber,ou,title
  Group search fields: cn,description
  Enable migration mode: FALSE
  Certificate Subject base: O=IPA.CITIZIX.COM
  Password Expiration Notification (days): 4
  Password plugin features: AllowNThash, KDC:Disable Last Success
  SELinux user map order: guest_u:s0$xguest_u:s0$user_u:s0$staff_u:s0-s0:c0.c1023$sysadm_u:s0-s0:c0.c1023$unconfined_u:s0-s0:c0.c1023
  Default SELinux user: unconfined_u:s0-s0:c0.c1023
  Default PAC types: MS-PAC, nfs:NONE
  IPA masters:
  IPA master capable of PKINIT:
  IPA CA servers:
  IPA CA renewal master:

2. Add a user to FreeIPA

$ sudo ipa user-add etowett --first=Eutychus --last=Towett \
> [email protected] --password

Enter Password again to verify:
Added user "etowett"
  User login: etowett
  First name: Eutychus
  Last name: Towett
  Full name: Eutychus Towett
  Display name: Eutychus Towett
  Initials: ET
  Home directory: /home/etowett
  GECOS: Eutychus Towett
  Login shell: /bin/bash
  Principal name: [email protected]
  Principal alias: [email protected]
  User password expiration: 20211109060518Z
  Email address: [email protected]
  UID: 1063800001
  GID: 1063800001
  Password: True
  Member of groups: ipausers
  Kerberos keys available: True

3. List User Accounts in FreeIPA

$ sudo ipa user-find
2 users matched
  User login: admin
  Last name: Administrator
  Home directory: /home/admin
  Login shell: /bin/bash
  Principal alias: [email protected], [email protected]
  UID: 1063800000
  GID: 1063800000
  Account disabled: False

  User login: etowett
  First name: Eutychus
  Last name: Towett
  Home directory: /home/etowett
  Login shell: /bin/bash
  Principal name: [email protected]
  Principal alias: [email protected]
  Email address: [email protected]
  UID: 1063800001
  GID: 1063800001
  Account disabled: False
Number of entries returned 2

4. Login as the create etowettuser. On your first log in, you’ll be asked to change your password:

$ ssh [email protected]

Password expired. Change your password now.
Current Password:
New password:
Retype new password:

$ id
uid=1063800001(etowett) gid=1063800001(etowett) groups=1063800001(etowett) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023


In this guide, we managed to set up FreeIPA in our Rocky Linux system. You can play with the interface to understand placement of various FreeIPA management functions.

I am a Devops Engineer, but I would describe myself as a Tech Enthusiast who is a fan of Open Source, Linux, Automations, Cloud and Virtualization. I love learning and exploring new things so I blog in my free time about Devops related stuff, Linux, Automations and Open Source software. I can also code in Python and Golang.

Write A Comment