Enable fingerprint authentication for sudo on 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

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

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

Now you should see the following dialog in your terminal:

Screenshot of PAM Configuration dialogue in a Terminal
Screenshot of 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

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

Share on Mastodon

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 Partnerships & Community Manager EMEA at Kinsta. where he helps clients and partners grow with their business with Managed Hosting for WordPress.

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

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *