Written for FreeIPA 4.10 and later, which is Red Hat IdM on RHEL 9 and 10. Run kinit admin (or kinit as another admin user) before the ipa commands; they work from any enrolled machine. Commands starting ipa- (with a dash), ipactl and the firewall lines run as root on the machine they set up or manage: the server for installs, replicas, health checks and backups, and the client for ipa-client-install, ipa-getcert and ipa-getkeytab. User, host, domain and rule names are examples, so swap in your own.

Install and setup #

  • Give the server a fully qualified host name firstLinux
    hostnamectl set-hostname ipa1.example.com
  • Install the server packages with integrated DNS (RHEL, Rocky, Alma)Red Hat, Fedora
    dnf install ipa-server ipa-server-dns
  • Install the server packages with integrated DNS (Fedora)Red Hat, Fedora
    dnf install freeipa-server freeipa-server-dns
  • Open the firewall for FreeIPA and DNSRed Hat, Fedora
    firewall-cmd --permanent --add-service={freeipa-4,dns} firewall-cmd --reload
  • Install the first server, answering the questions as you goLinux
    ipa-server-install
  • Install the first server with integrated DNSLinux
    ipa-server-install --setup-dns --auto-forwarders --auto-reverse
  • Install the first server with no questions askedLinux
    ipa-server-install -U --realm=EXAMPLE.COM --domain=example.com --setup-dns --auto-forwarders --auto-reverse --ds-password='ChangeMe-2026!' --admin-password='ChangeMe-2026!'

    Warning: The passwords end up in your shell history. Clear it afterwards, or leave them out and answer the prompts.

  • Install the client packages (RHEL, Rocky, Alma, Fedora)Red Hat, Fedora
    dnf install ipa-client
  • Install the client packages (Debian, Ubuntu)Debian, Ubuntu
    apt install freeipa-client
  • Join a machine to the domain, finding the server through DNSLinux
    ipa-client-install --mkhomedir
  • Join a machine to a named server and domainLinux
    ipa-client-install --mkhomedir --domain=example.com --server=ipa1.example.com --principal=admin
  • Join a machine with a one-time password, with no questions askedLinux
    ipa-client-install --mkhomedir -U --password='Secret123'
  • Remove a machine from the domainLinux
    ipa-client-install --uninstall
  • Remove FreeIPA from a serverLinux
    ipa-server-install --uninstall

    Warning: On the last server this wipes the whole domain. On a replica, run ipa server-del from another server first.

  • Upgrade the data and config after updating the packagesLinux
    ipa-server-upgrade
  • Show the global settings (default shell, home folders, search limits)Linux
    ipa config-show
  • Change the default shell for new usersLinux
    ipa config-mod --defaultshell=/bin/bash

Kerberos and the ipa command #

  • Get an admin ticket so ipa commands workLinux
    kinit admin
  • Get a ticket as yourselfLinux
    kinit jsmith
  • Show your tickets and when they expireLinux
    klist
  • Throw away your ticketsLinux
    kdestroy
  • Throw away every ticket cache you haveLinux
    kdestroy -A
  • Get a ticket as the machine itself using its keytabLinux
    kinit -k
  • List the keys in the machine's keytabLinux
    klist -k /etc/krb5.keytab
  • Check you can get a ticket for a serviceLinux
    kvno host/web01.example.com
  • Change your own passwordLinux
    kpasswd
  • Check the ipa command can reach the serverLinux
    ipa ping
  • List the help topicsLinux
    ipa help topics
  • List every ipa commandLinux
    ipa help commands
  • Show the options for one commandLinux
    ipa user-add --help
  • Show what the ipa command sends and receivesLinux
    ipa -vv user-show admin

Users #

  • Add a userLinux
    ipa user-add jsmith --first=Jane --last=Smith [email protected]
  • Add a user and set a first password (they change it at first login)Linux
    ipa user-add jsmith --first=Jane --last=Smith --password
  • List all usersLinux
    ipa user-find
  • Search for users by surnameLinux
    ipa user-find --last=Smith
  • Show everything about a userLinux
    ipa user-show jsmith --all
  • Change a user's login shellLinux
    ipa user-mod jsmith --shell=/bin/bash
  • Add an SSH public key to a userLinux
    ipa user-mod jsmith --sshpubkey="$(cat ~/.ssh/id_ed25519.pub)"
  • Reset a user's password (they change it at next login)Linux
    ipa passwd jsmith
  • Push back when a user's password expiresLinux
    ipa user-mod jsmith --password-expiration='20271231000000Z'
  • Disable a userLinux
    ipa user-disable jsmith
  • Enable a user againLinux
    ipa user-enable jsmith
  • Unlock a user locked out by failed loginsLinux
    ipa user-unlock jsmith
  • Show failed logins and lockouts on each serverLinux
    ipa user-status jsmith
  • Delete a user but keep the account so you can restore itLinux
    ipa user-del jsmith --preserve
  • Restore a preserved userLinux
    ipa user-undel jsmith
  • Delete a user for goodLinux
    ipa user-del jsmith

    Warning: Can't be undone. Use --preserve if you might need the account back.

  • Add a user who can't log in yet (a stage user)Linux
    ipa stageuser-add jsmith --first=Jane --last=Smith
  • Activate a stage userLinux
    ipa stageuser-activate jsmith

Groups #

  • Add a groupLinux
    ipa group-add linux-admins --desc="Linux administrators"
  • Add a group without a GID (for access rules only)Linux
    ipa group-add linux-admins --nonposix
  • Add users to a groupLinux
    ipa group-add-member linux-admins --users=jsmith
  • Put a group inside another groupLinux
    ipa group-add-member linux-admins --groups=admins
  • Remove a user from a groupLinux
    ipa group-remove-member linux-admins --users=jsmith
  • Show a group and its membersLinux
    ipa group-show linux-admins
  • List all groupsLinux
    ipa group-find
  • List the groups a user is inLinux
    ipa group-find --user=jsmith
  • Let a user manage a group's members without being an adminLinux
    ipa group-add-member-manager linux-admins --users=jsmith
  • Delete a groupLinux
    ipa group-del linux-admins

Hosts and host groups #

  • Add a host and its DNS recordLinux
    ipa host-add web01.example.com --ip-address=192.168.10.21
  • Add a host and get a one-time password to enrol itLinux
    ipa host-add web01.example.com --random
  • List all hostsLinux
    ipa host-find
  • Show a hostLinux
    ipa host-show web01.example.com
  • Disable a host (removes its keys and certificates)Linux
    ipa host-disable web01.example.com
  • Delete a host and its DNS recordsLinux
    ipa host-del web01.example.com --updatedns
  • Add a host groupLinux
    ipa hostgroup-add webservers --desc="Web servers"
  • Add hosts to a host groupLinux
    ipa hostgroup-add-member webservers --hosts=web01.example.com
  • Show a host group and its membersLinux
    ipa hostgroup-show webservers
  • List all host groupsLinux
    ipa hostgroup-find
  • Put new hosts in a host group automaticallyLinux
    ipa automember-add --type=hostgroup webservers
  • Match new hosts whose name starts with webLinux
    ipa automember-add-condition --type=hostgroup webservers --key=fqdn --inclusive-regex='^web'
  • Apply the automatic membership rules to existing hostsLinux
    ipa automember-rebuild --type=hostgroup

Services and keytabs #

  • Add a service, such as a web serverLinux
    ipa service-add HTTP/web01.example.com
  • List all servicesLinux
    ipa service-find
  • Show a serviceLinux
    ipa service-show HTTP/web01.example.com
  • Let a host manage a service's keytab and certificatesLinux
    ipa service-add-host HTTP/web01.example.com --hosts=web01.example.com
  • Create a keytab for a serviceLinux
    ipa-getkeytab -s ipa1.example.com -p HTTP/web01.example.com -k /etc/httpd/conf/http.keytab

    Warning: Makes new keys, so any copy of the old keytab stops working. Use -r to get the existing keys instead.

  • Get the existing keys without changing themLinux
    ipa-getkeytab -r -s ipa1.example.com -p HTTP/web01.example.com -k /etc/httpd/conf/http.keytab
  • List the keys in a keytabLinux
    klist -kt /etc/httpd/conf/http.keytab
  • Disable a service (removes its keys)Linux
    ipa service-disable HTTP/web01.example.com
  • Delete a serviceLinux
    ipa service-del HTTP/web01.example.com

Access rules (HBAC) #

  • List the access rulesLinux
    ipa hbacrule-find
  • Show the rule that lets everyone log in everywhereLinux
    ipa hbacrule-show allow_all
  • Add an access ruleLinux
    ipa hbacrule-add ssh-webservers
  • Let a group use the ruleLinux
    ipa hbacrule-add-user ssh-webservers --groups=linux-admins
  • Apply the rule to a host groupLinux
    ipa hbacrule-add-host ssh-webservers --hostgroups=webservers
  • Allow SSH logins onlyLinux
    ipa hbacrule-add-service ssh-webservers --hbacsvcs=sshd
  • Allow every login serviceLinux
    ipa hbacrule-mod ssh-webservers --servicecat=all
  • List the login services rules can useLinux
    ipa hbacsvc-find
  • Test whether a user can log in to a hostLinux
    ipa hbactest --user=jsmith --host=web01.example.com --service=sshd
  • Test one rule onlyLinux
    ipa hbactest --user=jsmith --host=web01.example.com --service=sshd --rules=ssh-webservers
  • Turn off the rule that lets everyone log in everywhereLinux
    ipa hbacrule-disable allow_all

    Warning: Only users matched by another rule can log in afterwards, admins included. Test with ipa hbactest first.

  • Turn a rule back onLinux
    ipa hbacrule-enable ssh-webservers
  • Delete an access ruleLinux
    ipa hbacrule-del ssh-webservers

Sudo rules #

  • Add a command sudo rules can allowLinux
    ipa sudocmd-add /usr/bin/systemctl
  • Add a group of commandsLinux
    ipa sudocmdgroup-add service-control
  • Add a command to a command groupLinux
    ipa sudocmdgroup-add-member service-control --sudocmds=/usr/bin/systemctl
  • Add a sudo ruleLinux
    ipa sudorule-add web-admins-sudo
  • Let a group use the sudo ruleLinux
    ipa sudorule-add-user web-admins-sudo --groups=linux-admins
  • Apply the sudo rule to a host groupLinux
    ipa sudorule-add-host web-admins-sudo --hostgroups=webservers
  • Allow one commandLinux
    ipa sudorule-add-allow-command web-admins-sudo --sudocmds=/usr/bin/systemctl
  • Allow a group of commandsLinux
    ipa sudorule-add-allow-command web-admins-sudo --sudocmdgroups=service-control
  • Allow every commandLinux
    ipa sudorule-mod web-admins-sudo --cmdcat=all
  • Apply the sudo rule to every hostLinux
    ipa sudorule-mod web-admins-sudo --hostcat=all
  • Let the rule run commands as any userLinux
    ipa sudorule-mod web-admins-sudo --runasusercat=all
  • Don't ask for a passwordLinux
    ipa sudorule-add-option web-admins-sudo --sudooption='!authenticate'
  • List the sudo rulesLinux
    ipa sudorule-find
  • Show a sudo ruleLinux
    ipa sudorule-show web-admins-sudo
  • Check what sudo lets you run on a clientLinux
    sudo -l

Passwords and two-factor #

  • Show the global password policyLinux
    ipa pwpolicy-show
  • Set the maximum password age and minimum lengthLinux
    ipa pwpolicy-mod --maxlife=180 --minlength=12
  • Lock accounts after 5 failed logins for 10 minutesLinux
    ipa pwpolicy-mod --maxfail=5 --failinterval=60 --lockouttime=600
  • Add a stricter policy for one groupLinux
    ipa pwpolicy-add linux-admins --priority=10 --minlength=16
  • Show which policy applies to a userLinux
    ipa pwpolicy-show --user=jsmith
  • Turn on password plus OTP for one userLinux
    ipa user-mod jsmith --user-auth-type=otp
  • Allow password or password plus OTP for everyoneLinux
    ipa config-mod --user-auth-type=password --user-auth-type=otp
  • Add an authenticator app token for a user (shows a QR code)Linux
    ipa otptoken-add --owner=jsmith --type=totp
  • List a user's tokensLinux
    ipa otptoken-find --owner=jsmith
  • Delete a tokenLinux
    ipa otptoken-del a1b2c3d4-0000-4e5f-9a8b-123456789abc

Certificates #

  • List the certificates certmonger is tracking and renewingLinux
    ipa-getcert list
  • Request a certificate for a service and keep it renewedLinux
    ipa-getcert request -f /etc/pki/tls/certs/web01.crt -k /etc/pki/tls/private/web01.key -K HTTP/web01.example.com -D web01.example.com
  • Force a tracked certificate to renew nowLinux
    ipa-getcert resubmit -i 20261125093000
  • Stop tracking a certificateLinux
    ipa-getcert stop-tracking -i 20261125093000
  • Sign a certificate request you made yourselfLinux
    ipa cert-request web01.csr --principal=HTTP/web01.example.com
  • List certificates issued to a hostLinux
    ipa cert-find --subject=web01.example.com
  • Save a certificate to a fileLinux
    ipa cert-show 12 --out=cert.pem
  • Revoke a certificate (4 means superseded)Linux
    ipa cert-revoke 12 --revocation-reason=4
  • List the certificate profilesLinux
    ipa certprofile-find
  • List the certificate authoritiesLinux
    ipa ca-find
  • Renew the CA certificateLinux
    ipa-cacert-manage renew

    Warning: Run ipa-certupdate on every server and client afterwards so they trust the new CA certificate.

  • Update a server or client with the latest CA certificatesLinux
    ipa-certupdate

DNS #

  • List the DNS zonesLinux
    ipa dnszone-find
  • Add a zoneLinux
    ipa dnszone-add example.com
  • Add a reverse zone for a subnetLinux
    ipa dnszone-add --name-from-ip=192.168.10.0/24
  • Add an A record and its PTR recordLinux
    ipa dnsrecord-add example.com app --a-rec=192.168.10.21 --a-create-reverse
  • Add a CNAME recordLinux
    ipa dnsrecord-add example.com app --cname-rec=web01
  • List the records in a zoneLinux
    ipa dnsrecord-find example.com
  • Show one recordLinux
    ipa dnsrecord-show example.com app
  • Delete an A recordLinux
    ipa dnsrecord-del example.com app --a-rec=192.168.10.21
  • Set the global forwarder for outside namesLinux
    ipa dnsconfig-mod --forwarder=1.1.1.1
  • Set the forwarder on one serverLinux
    ipa dnsserver-mod ipa1.example.com --forwarder=1.1.1.1
  • Send another domain's lookups to its own DNS serversLinux
    ipa dnsforwardzone-add ad.example.com --forwarder=192.168.10.5 --forward-policy=only
  • Show the SRV records IPA needs, without changing anythingLinux
    ipa dns-update-system-records --dry-run
  • Fix missing or wrong IPA SRV recordsLinux
    ipa dns-update-system-records
  • Check clients can find the LDAP serversLinux
    dig +short SRV _ldap._tcp.example.com

Replicas and topology #

  • Turn an enrolled client into a replica with a CA and DNSLinux
    ipa-replica-install --setup-ca --setup-dns --auto-forwarders
  • Add a CA to an existing replicaLinux
    ipa-ca-install
  • List the IPA serversLinux
    ipa server-find
  • Show which servers run the CALinux
    ipa server-role-find --role='CA server'
  • Show which server renews the CA certificateLinux
    ipa config-show | grep -i renewal
  • List the replication links for users and groupsLinux
    ipa topologysegment-find domain
  • List the replication links for the CALinux
    ipa topologysegment-find ca
  • Check the topology for missing linksLinux
    ipa topologysuffix-verify domain
  • Show replication status from this serverLinux
    ipa-replica-manage list -v ipa1.example.com
  • Rebuild a broken replica from another serverLinux
    ipa-replica-manage re-initialize --from=ipa1.example.com

    Warning: Replaces this server's data with the other server's copy. Run it on the broken replica.

  • Remove a dead replica from the domainLinux
    ipa server-del ipa2.example.com

    Warning: Check it's not the only CA or the CA renewal server first, with ipa server-role-find and ipa config-show.

Active Directory trust #

  • Install the trust packagesRed Hat, Fedora
    dnf install ipa-server-trust-ad
  • Open the firewall for the trustRed Hat, Fedora
    firewall-cmd --permanent --add-service=freeipa-trust firewall-cmd --reload
  • Set up this server to host trustsLinux
    ipa-adtrust-install --add-sids
  • Create the trust with an AD admin accountLinux
    ipa trust-add --type=ad ad.example.com --admin Administrator --password
  • List trustsLinux
    ipa trust-find
  • List the domains in the trusted forestLinux
    ipa trustdomain-find ad.example.com
  • Refresh the list of trusted domainsLinux
    ipa trust-fetch-domains ad.example.com
  • Check an AD user resolves on a Linux hostLinux
  • Make an external group to hold AD groupsLinux
    ipa group-add ad_admins_external --external
  • Put an AD group in the external groupLinux
    ipa group-add-member ad_admins_external --external='Domain [email protected]'
  • Give the AD group a normal IPA group to use in rulesLinux
    ipa group-add ad_admins ipa group-add-member ad_admins --groups=ad_admins_external
  • Let an AD user run ipa commands (step 1: add an ID override)Linux
    ipa idoverrideuser-add 'Default Trust View' [email protected]
  • Let an AD user run ipa commands (step 2: add them to admins)Linux
    ipa group-add-member admins [email protected]
  • Make an ID view to change AD users' attributes on some hostsLinux
    ipa idview-add web-hosts-view
  • Give an AD user a different GID in the viewLinux
    ipa idoverrideuser-add web-hosts-view [email protected] --gidnumber=732001337
  • Apply the ID view to a hostLinux
    ipa idview-apply web-hosts-view --hosts=web01.example.com

Health and troubleshooting #

  • Show the status of every IPA serviceLinux
    ipactl status
  • Restart every IPA serviceLinux
    ipactl restart
  • Run the health checks and show only problemsLinux
    ipa-healthcheck --failures-only
  • Run the health checks in readable formLinux
    ipa-healthcheck --output-type=human
  • Check only that the IPA services are runningLinux
    ipa-healthcheck --source=ipahealthcheck.meta.services
  • List the health check sourcesLinux
    ipa-healthcheck --list-sources
  • Run the health checks every dayLinux
    systemctl enable --now ipa-healthcheck.timer
  • Look up a user the way the system sees themLinux
    id jsmith
  • Look up a user in the passwd databaseLinux
    getent passwd jsmith
  • Check a user's lookup, login and access in one goLinux
    sssctl user-checks jsmith
  • Check SSSD is online and which server it's usingLinux
    sssctl domain-status example.com
  • Clear the SSSD cache so changes show up straight awayLinux
    sss_cache -E
  • Restart SSSDLinux
    systemctl restart sssd
  • Wipe the SSSD cache completelyLinux
    systemctl stop sssd rm -rf /var/lib/sss/db/* systemctl start sssd

    Warning: Cached logins are lost, so users can't log in offline until the host reaches a server again.

  • Follow the SSSD logsLinux
    journalctl -u sssd -f
  • Follow the Kerberos server logLinux
    tail -f /var/log/krb5kdc.log
  • Follow the directory server error logLinux
    tail -f /var/log/dirsrv/slapd-*/errors
  • Follow the IPA web and API logLinux
    tail -f /var/log/httpd/error_log
  • Back up the whole server (stops IPA while it runs)Linux
    ipa-backup
  • Back up only the data, without stopping IPALinux
    ipa-backup --data --online
  • Restore a backupLinux
    ipa-restore /var/lib/ipa/backup/ipa-full-2026-11-25-09-00-00

    Warning: Replaces everything on this server. Restoring one replica in a working domain can bring back old data, so read the docs first.