OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
audio-input medium common DISPUTE

Make the fingerprint reader authenticate sudo, polkit and the lock screen

omarchyarchendeavouroscachyosmanjarohyprlandwaylandlaptop
CORRECTED An auditor found the fix wrong or incomplete and rewrote it.
AUDIT NOTE

Every command and PAM snippet is sourced correctly. The pam_unix/pam_fprintd sufficient pair, the system-local-login stanza, the enrol-all-fingers brace-expansion loop and the polkit 50-default.rules copy are all verbatim from Arch Fprint (lines 52-95 and 165-178). But the wiki carries an explicit warning immediately above the stanza this record reproduces, and the record drops it: 'This setting (fingerprint-only authentication) is a security breach if used for su, polkit, or sudo as it allows background processes to obtain permissions without prompting the user for a fingerprint (via fingerprint hijacking). See CVE-2024-37408.' Handing a user a /etc/pam.d/sudo edit with no mention of that, and no mention that a typo in that file locks them out of sudo entirely, is dangerous-without-warning. nullok is also carried over unnecessarily and permits empty passwords.

The cause above was not rewritten and may still contain the error described. The fix below is the corrected version.
RISK

Adding pam_fprintd.so as sufficient to sudo/su/polkit is a documented security weakness (CVE-2024-37408): a background process can obtain elevated permissions when you touch the reader for something else. Editing PAM incorrectly can lock you out of the system entirely. Keep a root TTY or a live USB open while you test, and never edit /etc/pam.d/system-auth without a second session already logged in.

Symptom

The fingerprint reader is listed by lsusb and fprintd-enroll works, but nothing ever asks for a fingerprint: sudo, the lock screen and polkit prompts all still demand a password. Or fprintd-enroll fails with EnrollStart failed: GDBus.Error:net.reactivated.Fprint.Error.PermissionDenied: Not Authorized: net.reactivated.fprint.device.enroll.

Cause

fprintd only provides the D-Bus service. Nothing uses it until pam_fprintd.so is added to the relevant PAM stacks. Enrolment itself needs a running polkit authentication agent, and on a bare Hyprland session there often isn't one, which produces the PermissionDenied error.

Fix

WARNING before you touch PAM: fingerprint-only authentication for sudo, su or polkit is a security weakness, because a background process can obtain elevated permissions without you being prompted to touch the sensor (fingerprint hijacking, CVE-2024-37408). If that matters to you, add pam_fprintd to the graphical login stack only and leave sudo on passwords.

WARNING before editing /etc/pam.d/sudo: a syntax error there locks you out of sudo. Keep a second terminal with an active root shell open (sudo -i) until you have verified the change works in a THIRD terminal.

Install and check the reader:


sudo pacman -S --needed fprintd usbutils
lsusb
systemctl status fprintd.service

Enrol (as root if no polkit agent is running):


sudo fprintd-enroll "$USER"
fprintd-verify

Enrol several fingers:


fprintd-delete "$USER"
for finger in {left,right}-{thumb,{index,middle,ring,little}-finger}; do
  fprintd-enroll -f "$finger" "$USER"
done

For local graphical login, add to the top of the auth section of /etc/pam.d/system-local-login:


auth      sufficient  pam_fprintd.so
auth      include     system-login

Only if you accept the CVE-2024-37408 risk above, for sudo. Note nullok is dropped, it permits empty passwords and is not needed here:


# /etc/pam.d/sudo
auth      sufficient  pam_unix.so try_first_pass likeauth
auth      sufficient  pam_fprintd.so
auth      include     system-auth

This prompts for a password first. Pressing Enter on a blank field falls through to the fingerprint. If you need both prompts simultaneously (some GTK polkit agents reject blank input), use pam-fprint-grosshack from the AUR instead.

If fingerprint works for login and sudo but not polkit prompts:


sudo cp /usr/share/polkit-1/rules.d/50-default.rules /etc/polkit-1/rules.d/

then edit the returned group in that copy to match your admin group (unix-group:wheel on Arch).

Verify

fprintd-verify succeeds, and running sudo -k; sudo true in a terminal prompts for a fingerprint (pressing Enter on the empty password field falls through to the reader).

Sources

fingerprint-reader-not-used-for-login-sudo