DEV Community

jakariya
jakariya

Posted on

Setup fingerprint login on Arch Linux with LightDM

1. Check Your Fingerprint Reader

Make sure your fingerprint reader is supported. You can check your device with:

lsusb
Enter fullscreen mode Exit fullscreen mode

Then look up your reader on list of supported devices or the list of unsupported devices.
Note: The list of supported devices is not updated frequently and may be incomplete. It is recommended to test your device before making any conclusions.

2. Install the Needed Packages

Open a terminal and install fprintd (it will also install libfprint):

sudo pacman -S fprintd
Enter fullscreen mode Exit fullscreen mode

3. Enroll Your Fingerprint

Run this command in your terminal (replace yourusername if needed):

fprintd-enroll
Enter fullscreen mode Exit fullscreen mode

Follow the on-screen instructions to swipe your finger until it says enrollment is complete.

4. Configure PAM for LightDM

Edit the LightDM PAM file to allow fingerprint login:

sudo nano /etc/pam.d/lightdm
Enter fullscreen mode Exit fullscreen mode

At the top of the file, add this line (before any other “auth” lines):

auth    sufficient   pam_fprintd.so
Enter fullscreen mode Exit fullscreen mode

Then save and close the file.

5. Restart LightDM

Restart LightDM to apply the changes:

sudo systemctl restart lightdm
Enter fullscreen mode Exit fullscreen mode

Restrict Fingerprint Enrollment (Optional)

By default, any user can enroll new fingerprints without authentication. You can change this behavior using polkit rules.

1. Locate the Polkit Configuration Files

Polkit configuration files are stored in two locations:

/etc/polkit-1/rules.d/  
/usr/share/polkit-1/rules.d/  
Enter fullscreen mode Exit fullscreen mode

Note: Do not modify files in /usr/share/polkit-1/rules.d/ directly, as they may be overwritten during updates. Instead, copy them to /etc/polkit-1/rules.d/ and edit them there.

2. Restrict Enrollment to Root Only

To allow only the root user to enroll fingerprints, create a new rule file:

sudo nano /etc/polkit-1/rules.d/50-net.reactivated.fprint.device.enroll.rules
Enter fullscreen mode Exit fullscreen mode

Add the following content:

polkit.addRule(function (action, subject) {
  if (action.id == "net.reactivated.fprint.device.enroll") {
    return subject.user == "root" ? polkit.Result.YES : polkit.Result.NO;
  }
});
Enter fullscreen mode Exit fullscreen mode

Save the file and exit.

3. Apply Changes

No reboot is required, but you may need to restart the polkit service for changes to take effect:

sudo systemctl restart polkit
Enter fullscreen mode Exit fullscreen mode

Now, only the root user can enroll new fingerprints.

This simple setup should allow you to log in using your fingerprint. Enjoy your new login method!

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay