Fedora

Join Fedora 45 / 44 to FreeIPA: ipa-client-install, SSSD, sudo

Most people assume that when you join Fedora to FreeIPA, the join copies your users, groups and sudo rules onto the machine. It copies none of them. The join writes a host keytab, a CA certificate and a few config files, and from then on SSSD asks the IPA server about every login and pulls sudo rules into its cache on a timer. That is why a new sudo rule can sit on the server for minutes before a client honours it, and why broken DNS stops everything before it starts.

Original content from computingforgeeks.com - post 200203

You will join two Fedora machines, one with the admin password and one with a one-time password, then prove login, home directories, Kerberos SSO and a scoped sudo rule. Everything below was run on Fedora 45 and Fedora 44 clients against a FreeIPA 4.13.4 server on Rocky Linux 10 in November 2026.

The lab has one IPA server and two Fedora clients

You need a working FreeIPA server with integrated DNS before any of this. If you don’t have one yet, build it with the FreeIPA server install on Rocky Linux 10 first and come back. These are the names used throughout, so swap in yours:

HostRoleIP
ipa01.lab.example.comFreeIPA server, DNS, KDC (Rocky Linux 10)10.0.1.10
client01.lab.example.comFedora 45, joined with the admin password10.0.1.21
client02.lab.example.comFedora 44, joined with a one-time password10.0.1.22

The realm is LAB.EXAMPLE.COM. The diagram shows what a login on these clients asks the server, in order, and it is worth reading before the commands because every failure later in this guide maps to one of the numbered steps.

Architecture diagram of a Fedora client login against FreeIPA: DNS SRV lookup, Kerberos KDC, 389 Directory for login and HBAC, sudo rules on a refresh timer, and an SSO hop to a second Fedora client

The client finds the servers through DNS, gets a ticket from the KDC, then reads identity and access rules from the directory. Sudo rules come from the same directory, but SSSD fetches them on its own refresh timer rather than at login. Step 5 is the payoff, because the ticket from step 3 opens the next host without a password. So if step 2 fails, nothing after it can work, which is why DNS gets its own section below.

On the server, the firewall has to let clients reach each of those services, because a blocked port shows up later as a vague timeout rather than a clear refusal. What needs to be open on ipa01:

  • Kerberos on 88 and 464, TCP and UDP
  • LDAP on 389 and LDAPS on 636
  • HTTP and HTTPS on 80 and 443 for enrollment
  • DNS on 53, since the clients resolve through IPA

The freeipa-4 firewalld service bundles the first three (it includes the http, https, kerberos, kpasswd, ldap and ldaps services), but it doesn’t include DNS. Add both in one go so you don’t chase a missing port 53 later.

sudo firewall-cmd --permanent --add-service={freeipa-4,dns}
sudo firewall-cmd --reload
sudo firewall-cmd --list-services

Both services should be listed. The --permanent flag alone changes nothing until the reload, which is why the three commands go together.

dns freeipa-4

The clients need nothing open inbound for the join itself. You’ll want SSH reachable on them later, which Fedora allows by default.

Create a test user and fix the default shell on the server

You can’t prove a join without a domain user to log in as. On ipa01, get an admin ticket and create a group plus one user in it:

kinit admin
ipa group-add linuxadmins --desc="Linux admins with dnf sudo"
ipa user-add alice --first=Alice --last=Ngetich --password
ipa group-add-member linuxadmins --users=alice

Look closely at what user-add printed, because most people scroll past it. The trimmed output from the lab is below.

------------------
Added user "alice"
------------------
  User login: alice
  Full name: Alice Ngetich
  Home directory: /home/alice
  Login shell: /bin/sh
  Principal name: [email protected]
  User password expiration: 20261130112525Z
  UID: 47400004
  GID: 47400004
  Member of groups: ipausers

Two lines in there will bite you later, and neither looks like an error:

  • Login shell is /bin/sh, FreeIPA’s default
  • Password expiration equals the creation time

The shell means your users land in Bash running in POSIX mode, which skips ~/.bashrc, so their aliases and prompt never load, and they will blame the client, not the server. The expired password is by design, because the admin set it and the user must change it on first use, so plan for that prompt in the first login below. Fix the shell for everyone created from now on, and for alice.

ipa config-mod --defaultshell=/bin/bash
ipa user-mod alice --shell=/bin/bash

Both commands echo the new value back. Users created before the config-mod keep their old shell, so you’ll need the user-mod for each of them.

  Default shell: /bin/bash
  Login shell: /bin/bash

The UID range (47400004 here) is picked at random when the server is installed, so two IPA domains are unlikely to share it. Do not hardcode it in NFS exports or file ownership scripts, because a rebuilt server gets a different range and every file owned by the old UIDs turns into a bare number.

DNS decides whether the join even starts

Install the client packages on each Fedora machine first. On a minimal or cloud image, freeipa-client pulls in SSSD’s IPA provider, oddjob-mkhomedir and the Kerberos tools.

sudo dnf install -y freeipa-client
rpm -q freeipa-client sssd-ipa oddjob-mkhomedir krb5-workstation

On the Fedora 45 client the versions came out as follows. Fedora 44 gets the same FreeIPA client release with an older SSSD build, so nothing in this guide differs between the two.

freeipa-client-4.13.4-4.fc45.x86_64
sssd-ipa-2.13.2-2.fc45.x86_64
oddjob-mkhomedir-0.34.7-20.fc45.x86_64
krb5-workstation-1.22.3-1.fc45.x86_64

Read the IPA admin password into a variable first. That keeps it out of your shell history, though it still shows in the process list while the installer runs, so do this on a client nobody else is logged in to.

read -rsp 'IPA admin password: ' IPA_ADMIN_PASS; echo

Now try the join with the client still using its default resolver, which is what most people do first.

sudo ipa-client-install --unattended --mkhomedir --principal admin --password "$IPA_ADMIN_PASS"

It stops in under a second, and the message doesn’t say DNS anywhere.

Unable to discover domain, not provided on command line
The ipa-client-install command failed. See /var/log/ipaclient-install.log for more information

Why does it fail so fast? Discovery asks DNS for two SRV records, and the upstream resolver has never heard of lab.example.com. You could pass the domain and server by hand, but SSSD keeps using the same records after the join, so every later lookup would still miss. Point the client at the IPA DNS server instead. Find the connection name first.

nmcli -t -f NAME,DEVICE connection show --active

Then set the IPA server as the only DNS server for that connection, ignore what DHCP hands out, and add the domain to the search list. If the network also hands out IPv6 DNS servers, add ipv6.ignore-auto-dns yes as well, or lookups can still leak to them.

sudo nmcli connection modify "Wired connection 1" ipv4.dns 10.0.1.10 ipv4.ignore-auto-dns yes ipv4.dns-search lab.example.com
sudo nmcli connection up "Wired connection 1"

Check that systemd-resolved picked it up and that the records resolve. You are looking for three answers:

  • _kerberos._udp pointing at port 88
  • _ldap._tcp pointing at port 389
  • An A record for ipa01 itself

Run the checks against the new resolver. dig comes from bind-utils, and rpm -q --whatrequires bind-utils shows freeipa-client needs it, so it’s already installed.

resolvectl dns ens4
dig +short -t SRV _kerberos._udp.lab.example.com
dig +short -t SRV _ldap._tcp.lab.example.com
dig +short ipa01.lab.example.com

All three came back on the first try once the resolver changed. If any of them is empty for you, stop here, because the join will fail and the error message won’t mention DNS at all.

Fedora client pointed at FreeIPA DNS with nmcli, dig returning the _kerberos and _ldap SRV records

Your interface name may differ from ens4. Desktop installs usually show enp1s0 or similar, and the connection is often named after the interface rather than “Wired connection 1”, so copy the name from the nmcli output instead of from here. A laptop that moves between networks needs more thought, because forcing IPA DNS on every Wi-Fi connection breaks name resolution away from the office.

Enroll Fedora 45 with the admin password and –no-nisdomain

With DNS fixed, the join gets most of the way and then dies at the last step on some images. This second run used the same command as before, without any extra flag. It enrolled the host, wrote sssd.conf and the SSH drop-in, then tripped over the NIS domain step.

ipa-client-install failing on Fedora with Errno 21 Is a directory /etc/sysconfig/network at the NIS domain step

The installer wants to write the NIS domain name into /etc/sysconfig/network as a file. On Google Cloud’s Fedora images that path is a directory holding a vendor network script, owned by no package, so the write fails with [Errno 21] Is a directory. You almost certainly don’t need a NIS domain name on a modern Fedora box (it only matters for netgroups through NIS), so skip the step with --no-nisdomain.

sudo ipa-client-install --unattended --mkhomedir --no-nisdomain --principal admin --password "$IPA_ADMIN_PASS"

That run finishes with The ipa-client-install command was successful. If your first attempt already failed, a plain retry won’t work, because the failed run left the host registered on the server and half its state on the client. The troubleshooting section below has the exact cleanup commands.

ipa-client-install with --no-nisdomain enrolling a Fedora 45 client into the LAB.EXAMPLE.COM realm successfully

It’s worth knowing what each flag did on that run, because you’ll reuse the same set in automation:

  • --mkhomedir enables oddjob-mkhomedir so the first login creates /home/alice
  • --unattended accepts the discovered realm and server without prompting
  • --principal admin enrolls with a full admin account, fine for a lab, too much power for a script
  • --no-nisdomain skips the step that crashed above

One thing the admin join did not do was create an A record for client01 in IPA DNS. You will hit that the moment another host tries to SSH to it by name, so add it on the server now.

ipa dnsrecord-add lab.example.com client01 --a-rec=10.0.1.21

The record comes back with SSHFP entries already attached, because the join uploaded the host’s SSH keys. If you’d rather have clients register themselves, ipa-client-install --help lists --enable-dns-updates, which registers the client’s A record at enrollment and sends DNS updates when its IP address changes.

Enroll Fedora 44 with a one-time password instead

Typing the admin password on every new machine doesn’t scale, and it shouldn’t live in a kickstart or Ansible vars file either. The better pattern is to pre-create the host on the server and get a random one-time password, so the client only ever sees that. The first attempt on ipa01 looked like this.

ipa host-add client02.lab.example.com --random

It was refused, because IPA manages the zone and there isn’t an address for the name yet. That check is a feature: it stops you registering a host that nothing can reach by name.

ipa: ERROR: Host 'client02.lab.example.com' does not have corresponding DNS A/AAAA record

Pass the client’s IP and IPA creates the A record in the same step.

ipa host-add client02.lab.example.com --ip-address=10.0.1.22 --random

The warning about the reverse zone is harmless when IPA does not own your in-addr.arpa zone. Copy the random password, because it works exactly once and is gone after the client enrolls.

ipa: WARNING: The host was added but the DNS update failed with: DNS reverse zone in-addr.arpa. for IP address 10.0.1.22 is not managed by this server
-------------------------------------
Added host "client02.lab.example.com"
-------------------------------------
  Host name: client02.lab.example.com
  Random password: Xq7Lm2Pd9RtWv4Hs8Kb3Nc
  Password: True
  Keytab: False
  Managed by: client02.lab.example.com

On client02, after the same DNS change and package install, enroll with only the one-time password and no --principal.

OTP='Xq7Lm2Pd9RtWv4Hs8Kb3Nc'
sudo ipa-client-install --unattended --mkhomedir --no-nisdomain --password "$OTP"

It succeeds, and it also prints a line you shouldn’t ignore. Note the OTP enrollment uses admin only for a getent check at the end, as the output says, not for the join itself.

Fedora 44 enrolled into FreeIPA with a one-time password, showing the insecure HTTP CA download warning

Downloading the CA certificate via HTTP, this is INSECURE means the client had no admin credentials to fetch the CA over an authenticated channel, so it trusted whatever answered on port 80. On a lab network that is fine. On anything shared, copy /etc/ipa/ca.crt from the server to /root/ca.crt on the client first and add --ca-cert-file=/root/ca.crt to the same command, which ipa-client-install --help describes as “load the CA certificate from this file”.

So which method should you pick? It comes down to who runs the client side:

  • Admin password: one machine you are sitting at
  • One-time password: kickstart, cloud-init, Ansible, a colleague’s laptop
  • OTP plus --ca-cert-file: anything on a network you do not control

The OTP wins for automation because the secret is single use and the person running the client never holds admin rights. A leaked OTP after enrollment is worthless, while a leaked admin password owns the domain.

Check what the join changed on the client

A successful exit code only tells you the installer finished. These five checks tell you the client actually resolves domain identities and will hand them to PAM and sudo, which is what your users care about.

id alice
getent passwd alice
authselect current
grep -E "^(passwd|group|sudoers)" /etc/nsswitch.conf
systemctl is-active sssd oddjobd

alice resolves with her IPA UID and the linuxadmins group, even though no line for her exists in /etc/passwd.

id and getent resolving a FreeIPA user on Fedora, authselect sssd profile with mkhomedir and sudo features

Read the output top to bottom and each line maps to a feature you will test later:

  • id and getent: identity lookup through SSSD
  • with-mkhomedir: home directory on first login
  • sudoers: files sss: sudo rules from the server
  • oddjobd active: the daemon that creates the home directory

If sudoers is missing from nsswitch.conf, sudo never asks SSSD and every IPA rule is silently ignored, so check it before you debug a rule. The installer also dropped an SSH server snippet in place.

sudo cat /etc/ssh/sshd_config.d/04-ipa.conf

It turns GSSAPI authentication on and reads public keys from IPA through sss_ssh_authorizedkeys. Since it’s a drop-in, a later edit to your main sshd_config won’t wipe it.

# IPA-related configuration changes to sshd_config

PubkeyAuthentication yes
KerberosAuthentication no
GSSAPIAuthentication yes
UsePAM yes
ChallengeResponseAuthentication yes
AuthorizedKeysCommand /usr/bin/sss_ssh_authorizedkeys
AuthorizedKeysCommandUser nobody

That AuthorizedKeysCommand line means a public key you add to a user in IPA works on every enrolled host, no authorized_keys file to distribute. If you are also hardening sshd, keep your changes in a separate drop-in so they do not collide with this one, and see the Fedora hardening guide for the rest.

First login forces a password change and creates the home directory

Remember the expired password from user-add. The cleanest place to deal with it is a kinit on any enrolled client, because Kerberos handles the change prompt in one go and you see exactly what failed if it does.

kinit alice

Kerberos asks for the temporary password, then makes you set a new one before it issues the ticket.

Password for [email protected]:
Password expired.  You must change it now.
Enter new password:
Enter it again: 

Now log in to client01 as alice over SSH with her new password. From client02, the first attempt in our lab failed with Could not resolve hostname client01.lab.example.com, because the A record did not exist yet and systemd-resolved had cached the miss. After the dnsrecord-add above, flushing the resolver cache on the machine you are connecting from should clear that negative answer without waiting for it to expire.

sudo resolvectl flush-caches
ssh [email protected]

Once you’re in, check the home directory and the ticket cache. Both should exist without you having touched the client as root.

whoami; pwd; ls -Zd /home/alice; klist

oddjob created the home directory with the correct SELinux label, and pam_sss obtained a Kerberos ticket from the password you typed, stored in the KCM cache rather than a file in /tmp.

alice
/home/alice
unconfined_u:object_r:user_home_dir_t:s0 /home/alice
Ticket cache: KCM:47400004:36643
Default principal: [email protected]

Valid starting       Expires              Service principal
11/30/2026 11:30:34  12/01/2026 11:17:37  krbtgt/[email protected]

The user_home_dir_t label matters. A home directory created with a plain mkdir by a script gets the wrong context, and SSH key logins then fail with SELinux denials that look like permission problems.

Kerberos SSO carries you to the next host

That TGT is the reason to bother with FreeIPA instead of plain LDAP. From alice’s session on client01, open a session on client02 with password prompts disabled entirely, so the test cannot pass by accident.

ssh -o BatchMode=yes client02.lab.example.com "hostname -f; cat /etc/fedora-release"
klist

With BatchMode=yes, SSH would fail outright rather than ask for a password, so a reply proves Kerberos did the work. klist now holds a second ticket, host/client02.lab.example.com.

FreeIPA user hopping from Fedora 45 to Fedora 44 over SSH without a password, klist showing the host service ticket

You did not configure anything on the SSH client side for this. Fedora’s own /etc/ssh/ssh_config.d/50-redhat.conf already sets GSSAPIAuthentication yes, and the IPA client drop-in /etc/ssh/ssh_config.d/04-ipa.conf adds KnownHostsCommand /usr/bin/sss_ssh_knownhosts, so host keys of enrolled machines are trusted from IPA without the usual fingerprint prompt. The same Kerberos identity is what makes NFSv4 with sec=krb5 between Fedora hosts possible later.

A FreeIPA sudo rule takes effect only after SSSD refreshes

Before any rule exists, alice has no sudo rights on client01. Ask sudo what she may run, logged in as alice there:

sudo -l

After the password prompt, sudo says so plainly.

[sudo] password for alice: Sorry, user alice may not run sudo on client01.

Build the rule from groups, never from individual users and hosts, so the next admin and the next client are one membership change away. A rule that names alice and client01 directly works today and turns into an audit headache the day she leaves. The rule has four parts:

  1. A hostgroup holding the Fedora clients
  2. A sudo command for /usr/bin/dnf
  3. The rule itself, linking the command
  4. The linuxadmins group and the hostgroup added to the rule

Create them in that order on ipa01. The sudorule commands print the rule as it grows, so you can watch the user group and hostgroup attach.

ipa hostgroup-add fedora-clients --desc="Fedora workstations and servers"
ipa hostgroup-add-member fedora-clients --hosts=client01.lab.example.com --hosts=client02.lab.example.com
ipa sudocmd-add /usr/bin/dnf
ipa sudorule-add linuxadmins-dnf --desc="linuxadmins may run dnf on Fedora clients"
ipa sudorule-add-allow-command linuxadmins-dnf --sudocmds=/usr/bin/dnf
ipa sudorule-add-user linuxadmins-dnf --groups=linuxadmins
ipa sudorule-add-host linuxadmins-dnf --hostgroups=fedora-clients

Now the part that confuses people. Run sudo -l as alice right away and you still get Sorry, user alice may not run sudo on client01. We also tried sudo sss_cache -E, the usual advice, and it changed nothing. SSSD fetches sudo rules on its own timer, not at each sudo call, and the upstream sssd-ldap(5) man page gives the defaults.

  • ldap_sudo_smart_refresh_interval: 900 seconds, pulls rules changed since the last fetch
  • ldap_sudo_full_refresh_interval: 21600 seconds, downloads every rule

So a new rule shows up within 15 minutes on its own. Can you make it faster? Restart SSSD on the client and give it a minute. On client02 the rule appeared within a minute of the restart, while waiting without one would have meant up to the full 15.

sudo systemctl restart sssd
sudo sudo -l -U alice

On client02 the check eight seconds after the restart still said User alice is not allowed to run sudo on client02. About 40 seconds later it showed the rule, so do not give up on the first check.

User alice may run the following commands on client02:
    (root) /usr/bin/dnf

Back on client01 as alice, the rule allows exactly what it names and nothing else. She can list repos with dnf, and restarting sshd is refused even though she’s a linuxadmin. Run the same three checks yourself:

sudo -l
sudo dnf -q repolist
sudo systemctl restart sshd

The first two succeed and the third is refused, as the capture shows.

FreeIPA sudo rule on Fedora: sudo -l allows only /usr/bin/dnf and systemctl restart sshd is refused

Notice the wording changed between the two refusals, and the difference tells you where to look:

  • “may not run sudo on client01”: no rule matched alice here, check users and hosts
  • “is not allowed to execute”: a rule matched, check its commands

That saves you from editing the wrong half of a rule. For patterns beyond a single command (command groups, runas users, NOPASSWD), the FreeIPA sudo rules cookbook has ten worked examples, and the upstream FreeIPA sudo rule workshop walks through the same commands.

Errors this join throws and how to clear them

Every one of these came up during the lab, and none of them is rare. The exact message is the heading so you can match it against your terminal.

“Unable to discover domain, not provided on command line”

The client can’t find the SRV records. Run the three dig checks from the DNS section. Fix the resolver rather than passing --domain and --server, because SSSD needs the same records after the join.

“[Errno 21] Is a directory: ‘/etc/sysconfig/network'”

The NIS domain step met a directory where it expected a file. Re-run with --no-nisdomain, after the cleanup in the next entry, because the failed run already registered the host.

“IPA client is already configured on this system”

A half-finished join leaves state behind, and ipa-client-install --uninstall refuses with “IPA client is not configured on this system”, so you are stuck between the two messages. Clear it in three moves, starting on the server, where you delete the stale host entry.

ipa host-del client01.lab.example.com

On the client, removing only the sysrestore state is not enough. /etc/ipa/default.conf has to go too, or you get the same message again.

sudo rm -f /var/lib/ipa-client/sysrestore/sysrestore.state /etc/ipa/default.conf

Then run the enrollment again with --no-nisdomain. You don’t need to remove packages or touch sssd.conf, since the installer rewrites it. It reuses the CA certificate already in /etc/ipa/ca.crt and completes normally.

“Host does not have corresponding DNS A/AAAA record”

ipa host-add wants an address when IPA manages the zone. Add --ip-address= with the client’s IP, or --force if the record lives in DNS that IPA does not control.

“Sorry, user alice may not run sudo” right after creating the rule

That is the refresh timer, not a broken rule. Confirm the rule on the server with ipa sudorule-show, then restart sssd on the client and retry after a minute. If it still fails, check that the host is in the rule’s hostgroup and that sudoers: files sss is in nsswitch.conf.

Prove it from the IPA server

Client-side checks show one machine. The server shows the whole picture, and it is where you will check a host months from now when someone says login is broken, so run these three on ipa01.

ipa host-find --in-hostgroups=fedora-clients
ipa hbactest --user=alice --host=client02.lab.example.com --service=sshd
ipa sudorule-show linuxadmins-dnf

Both clients are registered in the hostgroup, HBAC grants alice SSH to client02, and the sudo rule ties linuxadmins to fedora-clients for dnf only.

FreeIPA server checks: host-find by hostgroup, hbactest granting alice sshd on client02 and sudorule-show output

Look at Matched rules: allow_all. Every user can still log in to every host, because that default HBAC rule is untouched. That is the next thing to change, and the HBAC least privilege walkthrough replaces it with scoped rules and the same hbactest to prove each one. Keep this table for the day something breaks.

QuestionWhere to look
Is the host enrolled?ipa host-show on the server, /etc/krb5.keytab on the client
Can the user log in here?ipa hbactest, then journalctl -u sshd on the client
Why is sudo refused?ipa sudorule-show, then sudo -l -U user after an sssd restart
Why can’t the client find IPA?dig -t SRV _ldap._tcp.<domain> and resolvectl dns

One server is a single point of failure for every login on these clients. Once more than a couple of machines depend on it, add a replica with the FreeIPA replication guide. The clients’ sssd.conf reads ipa_server = _srv_, ipa01.lab.example.com, so SSSD finds the replica through the same SRV records you checked at the start.

Keep reading

How to Upgrade Fedora 44 to Fedora 45 (GUI, CLI and Rollback) Fedora How to Upgrade Fedora 44 to Fedora 45 (GUI, CLI and Rollback) Java4Shell (CVE-2026-114938): Find and Patch Vulnerable JVMs Security Java4Shell (CVE-2026-114938): Find and Patch Vulnerable JVMs UFW Firewall Commands with Examples on Ubuntu 26.04 / 24.04 Security UFW Firewall Commands with Examples on Ubuntu 26.04 / 24.04 Install Waydroid on Fedora 45 to Run Android Apps Fedora Install Waydroid on Fedora 45 to Run Android Apps Encapsule on Fedora 45: Isolated Dev Containers vs Toolbx Containers Encapsule on Fedora 45: Isolated Dev Containers vs Toolbx SSH Commands Cheat Sheet for Linux SysAdmins Cheat Sheets SSH Commands Cheat Sheet for Linux SysAdmins

Leave a Comment

Press ESC to close