Skip to content

Enable fingerprint authentication for sudo on Ubuntu

May 14th, 2024 Ubuntu A white lit fingerprint on a darkblue background, with a dimmed lit circle around it.

Fingerprint authentication offers a convenient and secure way to access your system without having to type your password every time. If you’re running Ubuntu and want to enable fingerprint authentication for sudo operations, follow this short step-by-step guide.

Step 1: Install fingerprint tools

First, ensure that the required fingerprint tools are installed. Open a terminal and run the following commands:

$ sudo apt update
$ sudo apt install fprintd libpam-fprintd
bash

Step 2: Enroll your fingerprint

Once the tools are installed, you need to enroll your fingerprint. Run the following command and follow the on-screen instructions to register your fingerprint:

$ fprintd-enroll
bash

You will be prompted to scan your fingerprint several times until the process is complete.

Step 3: Configure PAM (Pluggable Authentication Module)

Next, we need to configure PAM to use fingerprint authentication for sudo operations. Run the following command to open the PAM Configuration dialogue.

$ pam-auth-update
bash

Now you should see the following dialog in your terminal:

Screenshot of PAM Configuration dialogue in a Terminal.
PAM Configuration dialogue in a Terminal

Now, select “Fingerprint authentication”, navigate to OK with Tab, and press the space bar to save the configuration.

Step 4: Test the configuration

To ensure everything is working correctly, open a new terminal session or log out and log back in. Then, try to execute a command with sudo:

$ sudo apt update
bash

You should be prompted to scan your fingerprint instead of entering your password. If the fingerprint authentication is successful, the command will execute as expected.

Photo by George Prentzas

About Marcel Bootsman

Marcel discovered the web in 1995. Since then he has paid attention to and worked with lots of technologies and founded his own WordPress oriented business nostromo.nl in 2009.

Currently Marcel is Business Development Manager Dutch & DACH Markets at Kinsta where he helps Kinsta's client base grow with Managed WordPress, Application, Database and Static site hosting.

You can contact Marcel on a diverse range of online platforms. Please see the Connect section on the homepage for the details.