The Real-World Problem: The Distributed Credential Nightmare
Managing server logins starts innocently enough. You spin up two or three VPS instances, run useradd -m, drop your public key into ~/.ssh/authorized_keys, and get back to shipping features. That setup holds up fine until your cluster reaches twenty, fifty, or a hundred nodes.
Scale breaks manual administration fast. When an engineer leaves on a Friday afternoon, someone must SSH into 40 distinct boxes to lock or wipe their UID. Password complexity rules become un-auditable. On top of that, your internal Grafana dashboards, PostgreSQL clusters, and microservices demand TLS certificates. Without a proper system, admins end up juggling self-signed certs with browser security warnings, or writing brittle OpenSSL shell scripts that break every time a cert expires at 3 AM.
Orphaned accounts stay active on neglected staging boxes. Ex-contractor SSH keys persist undetected for months. Even worse, backend services end up falling back to hardcoded plaintext tokens just to talk to each other across subnets.
Root Cause: Why Local Authentication Fails at Scale
Traditional Linux identity management was built for isolated workstations, not coordinated fleets:
- Decoupled State: Every machine stores credentials locally in
/etc/passwd,/etc/shadow, and/etc/group. There is zero native synchronization across independent nodes. - Absence of True SSO: Local authentication forces users to re-authenticate at every boundary or distribute long-lived SSH private keys. Without Kerberos tickets handling ticket-granting exchanges, every network hop requires passing credentials over the wire.
- Disconnected PKI: Standing up an internal Certificate Authority with bare OpenSSL is cumbersome. It lacks automated renewals via ACME or SCEP and completely decouples certificate lifecycles from existing host records.
Evaluating the Alternatives
Before jumping into FreeIPA, it helps to understand why other common directory setups fall short for all-Linux teams.
1. Standalone OpenLDAP
OpenLDAP provides a battle-tested, RFC-compliant directory. The catch? It only handles storage. You still have to manually configure Kerberos via SASL/GSSAPI, stitch together custom schema extensions for sudo rules, and run a separate CA. Hand-crafting LDIF files and wrestling with slapd.d cn=config syntax requires specialized directory administration skills that most DevOps teams simply do not have.
2. Microsoft Active Directory (AD)
Active Directory remains the gold standard for enterprise Windows environments, and tools like SSSD make joining Linux hosts straightforward. However, paying $1,069+ per Windows Server Standard license just to manage Ubuntu and Rocky nodes makes little sense. It introduces heavy Windows Server patching cycles into an otherwise pure Linux infrastructure.
3. FreeIPA (Identity, Policy, Audit)
FreeIPA packages core open-source infrastructure into a cohesive platform: 389 Directory Server for LDAP, MIT Kerberos KDC for ticket-based authentication, Dogtag PKI for certificate lifecycles, and BIND for dynamic DNS updates. You get a clean web UI, a fast CLI, and zero licensing fees.
Step-by-Step FreeIPA Deployment
FreeIPA gives you a production-grade identity provider in under 30 minutes without requiring you to compile custom LDAP schemas or hand-stitch Kerberos realms.
Prerequisites & Environment Setup
Our setup uses a Rocky Linux 9 server with at least 2 vCPUs and 4 GB RAM for the FreeIPA master, plus an Ubuntu 22.04 LTS client node.
- Master FQDN:
ipa.infra.internal - Domain:
infra.internal - Kerberos Realm:
INFRA.INTERNAL(must remain strictly uppercase) - Static IP:
192.168.10.15/24
Set a valid FQDN on the server and confirm your local resolution returns the fully qualified hostname rather than localhost:
sudo hostnamectl set-hostname ipa.infra.internal
echo "192.168.10.15 ipa.infra.internal ipa" | sudo tee -a /etc/hosts
hostname -f
Installing the FreeIPA Master Server
Install the core server package and integrated BIND DNS service. On RHEL 8 / AlmaLinux 8, enable the idm:DL1 stream first; on RHEL 9 / Rocky 9, install directly from AppStream:
sudo dnf install freeipa-server freeipa-server-dns -y
Run the interactive installer. Pass --setup-dns to automate your SRV record creation so clients can locate the KDC and LDAP ports automatically:
sudo ipa-server-install --setup-dns --forwarder=1.1.1.1 --no-reverse
The wizard will ask for your domain name, realm name, and passwords for both Directory Manager (LDAP admin) and the admin user.
FreeIPA requires HTTP (80/443), LDAP (389/636), Kerberos (88/464), DNS (53), and NTP (123). Open the required firewall ports in one shot:
sudo firewall-cmd --add-service={http,https,ldap,ldaps,kerberos,kpasswd,dns,ntp} --permanent
sudo firewall-cmd --reload
Authenticating and Creating Accounts via CLI
Obtain a Kerberos Ticket-Granting Ticket (TGT) to interact with the FreeIPA API from the terminal:
kinit admin
klist
Create a centralized developer account with a standard POSIX UID, login shell, and default home directory:
ipa user-add jdoe --first=John --last=Doe [email protected] --password
Automating Internal TLS with Dogtag and Certmonger
Forget generating manual CSRs with OpenSSL. FreeIPA integrates directly with Dogtag PKI and Certmonger. Register the service principal first, then ask Certmonger to handle issuance and continuous renewal behind the scenes:
# 1. Register the HTTP service principal for your host
ipa service-add HTTP/web01.infra.internal
# 2. Issue the cert and track renewal in /etc/pki/tls
ipa-getcert request \
-f /etc/pki/tls/certs/web01.crt \
-k /etc/pki/tls/private/web01.key \
-N CN=web01.infra.internal \
-K HTTP/web01.infra.internal
Certmonger tracks expiration in the background. When 28 days remain on the certificate, it calls Dogtag, renews the cert, and reloads your web server without manual intervention.
Enrolling Linux Clients (SSSD)
Enrolling remote nodes takes two shell commands. On an Ubuntu 22.04 node, install the client package and run the enrollment script:
sudo apt update && sudo apt install freeipa-client sssd-tools -y
sudo ipa-client-install --domain=infra.internal --server=ipa.infra.internal --mkhomedir --enable-dns-updates
The --mkhomedir argument configures PAM via pam_mkhomedir.so to generate /home/jdoe/ automatically with proper permissions upon the user’s first SSH session.
Enforcing Centralized Sudo Rules
Stop maintaining fragile /etc/sudoers.d/ files on fifty different nodes. FreeIPA distributes granular privilege escalation policies using SSSD:
# Create a sudo rule granting full root execution
ipa sudorule-add devops-root --cmdcat=all
ipa sudorule-add-user devops-root --users=jdoe
ipa sudorule-add-host devops-root --hostcat=all
The policy syncs to enrolled clients in seconds. If John leaves the team, running ipa user-disable jdoe instantly invalidates his Kerberos tickets, disables his SSH access, and revokes his sudo privileges across every server.
Production Hardening & Operational Tips
- Clock Synchronization: Kerberos strictly enforces a 5-minute maximum clock skew (300 seconds) to prevent replay attacks. Configure
chronyon all clients to query your FreeIPA DNS/NTP servers. - SSSD Credential Caching: Ensure
cache_credentials = Trueis active in/etc/sssd/sssd.conf. When edge or cloud nodes experience transient network splits, local engineers can still log in using cached SHA-512 hashes. - Automated Disaster Recovery: Back up the database and directory state with
ipa-backup --datafor quick configuration snapshots, or runipa-backupfor a full disaster recovery tarball. Ship these tarballs to encrypted S3 or off-site cold storage daily.

