How To Install FreeIPA Client on Rocky Linux/Alma Linux/CentOS 8

Pinterest LinkedIn Tumblr

In this article, we will learn how to install freeipa client on Rocky Linux/Alma Linux/CentOS 8. This guide will also work on other RHEL 8 based systems.

This integrations allow a System Administrator to conveniently configure the server centrally, on the FreeIPA server. When a management command is executed on the Client machine, the FreeIPA client sends it to the server where it is executed.

Related Content


To follow along, ensure you have the following

  • A Rocky Linux/Centos 8 or Any Rhel 8 based server
  • An IPA Server that the client will join
  • Sudo access to the server or user with sudo access
  • Internet access from the sever

Table of Content

  1. Installing FreeIPA packages
  2. Setting up the Client
  3. Enable Creation of home directories on the first Login
  4. Test Client Addition
  5. Using FreeIPA ipa Command Line Management Tool
  6. Enable Passwordless Authentication using Private Key
  7. Removing Rocky Linux/Alma Linux IPA Client

1. Installing FreeIPA packages

On Rocky Linux 8 server, the FreeIPA client is available as an AppStream module. List the module using this command:

$ sudo dnf module list idm

Name Stream     Profiles                               Summary
idm  DL1 [e]    adtrust, client [i], common [d], dns,  The Red Hat Enterprise Linux Identity Management system
                server                                 module
idm  client [d] common [d]                             RHEL IdM long term support client module

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

From the output, you can see we have DL1 and client Streams. For more information about the FreeIPA client stream, run:

sudo dnf module info idm:DL1/client

Install FreeIPA Client packages using this command.

sudo dnf module -y install idm:DL1/client

Confirm client addition using the rpm -qi commannd

$ rpm -qi ipa-client
Name        : ipa-client
Version     : 4.9.2
Release     : 4.module+el8.4.0+664+1636a961
Architecture: x86_64
Install Date: Fri 12 Nov 2021 08:53:52 PM EAT
Group       : Unspecified
Size        : 266180
License     : GPLv3+
Signature   : RSA/SHA256, Tue 02 Nov 2021 07:33:39 PM EAT, Key ID 15af5dac6d745a60
Source RPM  : ipa-4.9.2-4.module+el8.4.0+664+1636a961.src.rpm
Build Date  : Tue 02 Nov 2021 07:21:45 PM EAT
Build Host  :
Relocations : (not relocatable)
Packager    : [email protected]
Vendor      : Rocky
URL         :
Summary     : IPA authentication for use on clients
Description :
IPA is an integrated solution to provide centrally managed Identity (users,
hosts, services), Authentication (SSO, 2FA), and Authorization
(host access control, SELinux user roles, services). The solution provides
features for further integration with Linux based clients (SUDO, automount)
and integration with Active Directory based infrastructures (Trusts).
If your network uses IPA for authentication, this package should be
installed on every client machine.
This package provides command-line tools for IPA administrators.

2. Seting up client

Once the installation of the FreeIPA Client packages is complete. Add hostname and IP address of your IPA Server to /etc/hosts file if you don’t have a working DNS resolution.

echo "" | sudo tee /etc/hosts

Set your system hostname.

sudo hostnamectl set-hostname

We can then setup client with specifying FreeIPA server and domain name

sudo ipa-client-install --domain

You can also add more arguments specifying the ipa client hostname, server, domain and realm like in this example.

sudo ipa-client-install \
 --mkhomedir \ \
 --domain \

This is my output. You should see something similar to this

# ipa-client-install --domain
This program will set up IPA client.
Version 4.9.2

Sudo version 1.8.29
Configure options: --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --prefix=/usr --sbindir=/usr/sbin --libdir=/usr/lib64 --docdir=/usr/share/doc/sudo --disable-root-mailer --with-logging=syslog --with-logfac=authpriv --with-pam --with-pam-login --with-editor=/bin/vi --with-env-editor --with-ignore-dot --with-tty-tickets --with-ldap --with-ldap-conf-file=/etc/sudo-ldap.conf --with-selinux --with-passprompt=[sudo] password for %p:  --with-linux-audit --with-sssd
Sudoers policy plugin version 1.8.29
Sudoers file grammar version 46

Sudoers path: /etc/sudoers
nsswitch path: /etc/nsswitch.conf
ldap.conf path: /etc/sudo-ldap.conf
ldap.secret path: /etc/ldap.secret
Authentication methods: 'pam'
Syslog facility if syslog is being used for logging: authpriv
Syslog priority to use when user authenticates successfully: notice
Syslog priority to use when user authenticates unsuccessfully: alert
Ignore '.' in $PATH
Send mail if the user is not in sudoers
Lecture user the first time they run sudo
Require users to authenticate by default
Root may run sudo
Always set $HOME to the target user's home directory
Allow some information gathering to give useful error messages
Visudo will honor the EDITOR environment variable
Set the LOGNAME and USER environment variables
Length at which to wrap log file lines (0 for no wrap): 80
Authentication timestamp timeout: 5.0 minutes
Password prompt timeout: 5.0 minutes
Number of tries to enter a password: 3
Umask to use or 0777 to use user's: 022
Path to mail program: /usr/sbin/sendmail
Flags for mail program: -t
Address to send mail to: root
Subject line for mail messages: *** SECURITY information for %h ***
Incorrect password message: Sorry, try again.
Path to lecture status dir: /var/db/sudo/lectured
Path to authentication timestamp dir: /run/sudo/ts
Default password prompt: [sudo] password for %p:
Default user to run commands as: root
Value to override user's $PATH with: /sbin:/bin:/usr/sbin:/usr/bin
Path to the editor for use by visudo: /bin/vi
When to require a password for 'list' pseudocommand: any
When to require a password for 'verify' pseudocommand: all
File descriptors >= 3 will be closed before executing a command
Reset the environment to a default set of variables
Environment variables to check for sanity:
Environment variables to remove:
Environment variables to preserve:
Locale to use while parsing sudoers: C
Compress I/O logs using zlib
Directory in which to store input/output logs: /var/log/sudo-io
File in which to store the input/output log: %{seq}
Add an entry to the utmp/utmpx file when allocating a pty
PAM service name to use: sudo
PAM service name to use for login shells: sudo-i
Attempt to establish PAM credentials for the target user
Create a new PAM session for the command to run in
Perform PAM account validation management
Maximum I/O log sequence number: 0
Enable sudoers netgroup support
Check parent directories for writability when editing files with sudoedit
Query the group plugin for unknown system groups
Allow commands to be run even if sudo cannot write to the audit log
Allow commands to be run even if sudo cannot write to the log file
Resolve groups in sudoers and match on the group ID, not the name
Log entries larger than this value will be split into multiple syslog messages: 960
File mode to use for the I/O log files: 0600
Execute commands by file descriptor instead of by path: digest_only
Type of authentication timestamp record: tty
Ignore case when matching user names
Ignore case when matching group names
Log when a command is allowed by sudoers
Log when a command is denied by sudoers
Don't pre-resolve all group names

Local IP address and netmask pairs:

Sudoers I/O plugin version 1.8.29
Autodiscovery of servers for failover cannot work with this configuration.
If you proceed with the installation, services will be configured to always access the discovered server for all operations and will not fail over to other servers in case of failure.
Proceed with fixed values and no DNS discovery? [no]: yes
Do you want to configure chrony with NTP server or pool address? [no]: no
Client hostname:
DNS Domain:
IPA Server:
BaseDN: dc=ipa,dc=citizix,dc=com

Continue to configure the system with these values? [no]: yes
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.
User authorized to enroll computers: admin
Password for [email protected]:
Successfully retrieved CA cert
    Subject:     CN=Certificate Authority,O=IPA.CITIZIX.COM
    Issuer:      CN=Certificate Authority,O=IPA.CITIZIX.COM
    Valid From:  2021-11-09 05:42:01
    Valid Until: 2041-11-09 05:42:01

Enrolled in IPA realm IPA.CITIZIX.COM
Created /etc/ipa/default.conf
Configured sudoers in /etc/authselect/user-nsswitch.conf
Configured /etc/sssd/sssd.conf
Configured /etc/krb5.conf for IPA realm IPA.CITIZIX.COM
Systemwide CA database updated.
Adding SSH public key from /etc/ssh/
Adding SSH public key from /etc/ssh/
Adding SSH public key from /etc/ssh/
Could not update DNS SSHFP records.
SSSD enabled
Configured /etc/openldap/ldap.conf
Configured /etc/ssh/ssh_config
Configured /etc/ssh/sshd_config
Configuring as NIS domain.
Client configuration complete.
The ipa-client-install command was successful

3. Enable Creation of home directories on the first Login

If user’s home directory are not created automatically, enable this feature by running the command below. This will create home directory at initial login.

# authselect enable-feature with-mkhomedir
Make sure that SSSD service is configured and enabled. See SSSD documentation for more information.

- with-mkhomedir is selected, make sure pam_oddjob_mkhomedir module
  is present and oddjobd service is enabled and active
  - systemctl enable --now oddjobd.service

# systemctl enable --now oddjobd
Created symlink /etc/systemd/system/ → /usr/lib/systemd/system/oddjobd.service.

4. Test Client addition

To test that the client was added successfully, let us login with a user in freeipa. If its the first time you are logging in, you should see a password change prompt else you will see this:

$ ssh [email protected]
([email protected]) Password:
Activate the web console with: systemctl enable --now cockpit.socket

Last login: Fri Nov 12 21:03:32 2021 from
[[email protected] ~]$

5. Using FreeIPA ipa Command Line Management Tool

You can administer FreeIPA Server from the client machine using ipa command line tool.

First, obtain a Kerberos ticket.

$ kinit admin
Password for [email protected]:

Check ticket expiry information using klist.

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

Valid starting       Expires              Service principal
11/12/2021 21:27:59  11/13/2021 21:27:47  krbtgt/[email protected]

Test by adding a user account and listing accounts present:

$ sudo ipa user-add kip \
     --first=Kipkoech \
     --last=Towett \
     [email protected] \

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


$ ipa user-find kip
1 user matched
  User login: kip
  First name: Kipkoech
  Last name: Towett
  Home directory: /home/kip
  Login shell: /bin/bash
  Principal name: [email protected]
  Principal alias: [email protected]
  Email address: [email protected]
  UID: 1063800003
  GID: 1063800003
  Account disabled: False
Number of entries returned 1

6. Enable Passwordless Authentication using Private Key

If you would like to authenticate to a server without a password, copy your Public key to FreeIPA Server. In the User profile, click the Add button under “SSH public keys“, paste your public key into the box and save.

7. Removing Rocky Linux/Alma Linux IPA Client

Removal of FreeIPA client on Rocky Linux/Alma Linux 8 can be done by running the command:

$ sudo ipa-client-install  --uninstall


In this guide, we managed to install and set up FreeIPA client on a Rocky Linux/Almas Linux/Centos 8 server.

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