[RESPONDED] Pop_OS! - Script to enable fingerprint

I have found a couple different guides addressing how to set up the fingerprint reader on Ubuntu, Fedora, and other distros, but I haven’t seen anyone post on how to setup the finger print reader in Pop_OS!.

Here is the script I pieced together from these guides. Hope this helps and feel free to make suggest any improvements.

#!/bin/bash

sudo apt update
sudo apt upgrade -y

## Path correction for python (solved a compilation issue)
export PATH="/home/$USER/.local/bin:$PATH"

## Fingerprint reader
sudo apt purge --auto-remove fprintd libfprint-2-2 -y
sudo apt install gtk-doc-tools libfprint-2-dev libgirepository1.0-dev libgusb-dev libgudev-1.0-dev libpam-wrapper libpam0g-dev libpamtest0-dev libpolkit-gobject-1-dev libxml2-utils python3-pip python3-pypamtest git gettext valgrind -y
sudo apt install build-essential cmake gettext libdbus-1-dev libdbus-glib-1-dev libdebconfclient0 libglib2.0-dev libnss3-dev libpixman-1-dev libsystemd-dev meson python3-dbusmock libpam-fprintd udev libcairo2-dev -y
sudo pip install meson
pip install ninja gobject python-dbusmock

git clone https://gitlab.freedesktop.org/libfprint/fprintd.git
git clone https://gitlab.freedesktop.org/libfprint/libfprint.git

cd libfprint/
git fetch
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
echo $latestTag
git checkout $latestTag
sudo chown $USER.$USER -R .
meson setup builddir
meson setup --wipe builddir
sudo ninja -C builddir install

cd ../fprintd/
git fetch
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
echo $latestTag
git checkout $latestTag
sudo chown $USER.$USER -R .
meson setup builddir
meson setup --wipe builddir
sudo ninja -C builddir install

cd ..

sudo pam-auth-update

echo "You can now go to Settings -> Users to enroll your fingerprints"
echo "If the option does not appear, then there must have been an error in one of the steps above (probably the compilations, lines 31-34)"

Credit to GitHub - Alexis-BX/framework_setup for most of the script
Credit to Fingerprint reader - #8 by Ryan_Helinski for some script. (I had to edit this make it work for me)

Common issues
If you have issues with registering a fingerprint where the dialog says Fingerprint reader disconnected, I have found that this is usually related to previously trying to register the fingerprint through the cli or other means and not clearing it before trying to register again.
This python script can show you any registered fingerprint and adding the -d flag will delete these fingerprints.
Script: https://drop.azokai.com/NCeIGZcl/libfprint_delete_device_prints.py

11 Likes

I get:
meson.build:156:8: ERROR: Problem encountered: Python3 module ‘dbus’ required by test suite not found

1 Like

I haven’t run in to this problem yet, but you might be able to just pip install dbus-python

1 Like

Just FYI I tried this script on Pop!_OS 21.10 beta (sans sudo apt upgrade -y) and it messed up the gnome-session login screen (symptoms include only a mouse cursor visible for some time after reboot, followed eventually by only the gdm menu at top of screen, with no users listed and no way to log in).

I used recover mode to get back to a working system by running the following:

sudo mount /dev/nvme0n1p3 /mnt
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo cp -n /etc/resolv.conf /mnt/etc/
sudo chroot /mnt

cd /home/duane/tmp/fprintd
ninja -C builddir uninstall

cd /home/duane/tmp/libfprint
ninja -C builddir uninstall

pam-auth-update # <-- then uncheck "fingerprintd"
exit
reboot

Here are some of the error logs I saw when using journalctl -xe but I haven’t had time to figure out what actually went wrong:

Dec 07 19:46:31 pop-os-fw1 gnome-session[2425]: gnome-session-binary[2425]: WARNING: Error while executing session-migration: Failed to ex>
Dec 07 19:46:31 pop-os-fw1 gnome-session-binary[2425]: WARNING: Error while executing session-migration: Failed to execute child process “>
Dec 07 19:46:31 pop-os-fw1 gnome-keyring-daemon[1615]: The Secret Service was already initialized
Dec 07 19:46:31 pop-os-fw1 gnome-keyring-daemon[1615]: The PKCS#11 component was already initialized
Dec 07 19:46:31 pop-os-fw1 gnome-keyring-secrets.desktop[2475]: SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
Dec 07 19:46:31 pop-os-fw1 systemd[1595]: app-gnome-gnome\x2dkeyring\x2dpkcs11-2465.scope: Failed to add PIDs to scope's control group: No>
Dec 07 19:46:31 pop-os-fw1 gnome-keyring-pkcs11.desktop[2479]: SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
Dec 07 19:46:31 pop-os-fw1 gnome-keyring-ssh.desktop[2484]: SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
Dec 07 19:46:31 pop-os-fw1 gnome-keyring-daemon[1615]: The SSH agent was already initialized
Dec 07 19:46:31 pop-os-fw1 systemd[1595]: app-gnome-gnome\x2dkeyring\x2dpkcs11-2465.scope: Failed with result 'resources'.
...
Dec 07 19:46:35 pop-os-fw1 gnome-session[3397]: Unable to init server: Could not connect: Connection refused
Dec 07 19:46:35 pop-os-fw1 gnome-session-f[3397]: Cannot open display: 
Dec 07 19:46:35 pop-os-fw1 gdm-launch-environment][1011]: pam_unix(gdm-launch-environment:session): session closed for user gdm
Dec 07 19:46:35 pop-os-fw1 gdm-launch-environment][1011]: GLib-GObject: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
4 Likes

I went through the entire process without any error popping out. I got the “Fingerprint login” option in the user settings. However, it is greyed out and won’t be able to click on it to add fingerprints. Have anyone run into this issue before?

1 Like

Heyo,

I have been looking into trying to get the fingerprint working in pop for a few days but was a but daunted by the complexity behind all of the how-tos and posts about it.

I noticed that there is a libpam-fprintd in apt and figured it would be an easy thing to test out.

I installed it via apt then did a pam-auth-update to enable finger print scanning and everything started working without any issues.

libpam-fprintd/impish 1.90.9-1build1 amd64

PAM module for fingerprint authentication through fprintd

Im on the new 21.10 update. Login and mid-session prompts for elevated access are working. I was able to find the fingerprint option in the ‘Users’ menu immediately after the apt install was complete.

Just sharing in case it helps anyone.

8 Likes

Wow, did that and it seems to work perfectly well. Just tried to sudo with fingerprint :slight_smile: Tanks a lot for sharing!

For those who need something to copy-paste:

sudo apt update && sudo apt install libpam-fprintd
sudo pam-auth-update

UPD: hm, it worked, but not that well. When I login with my fingerprint I get a message:

The login keyring did not get unlocked

Followed by password prompt. Nothing visible happens if I decline this, though, I can use my account as usual at the first sight.

5 Likes

OK, this seems to be related to the Chromium browser. It uses some custom keyring to store saved passwords and this keyring isn’t unlocked by libfprint, you need your account password. It disappeared after Chromium uninstall (it isn’t my default browser).

Yet, the same appears when I open VSCode. So this is kind of a problem that libfprint cannot unlock the login keyring

1 Like

Thanks to @Vizzo and @ololobus, it is now (mostly) working for me on Pop 21.10.

I am experiencing the same login issue that @ololobus describes, but as a workaround I can tab to the password field, type it in, wait for the fingerprint auth to time out, then hit enter to login.

Otherwise, it works great in CLI for sudo and in the OS UI dialogs (e.g, Preferences)

1 Like

I’m coming across an error when trying to register a fingerprint though and a bit stumped. I don’t know what other process it alludes to as I don’t have a fingerprint registered yet.

Error: Failed to claim fingerprint device Goodix MOC Fingerprint Sensor: this device is already claimed by another process.

2 Likes

@ololobus 's solution worked out of the box, thanks friend! (Pop OS 21.10)

2 Likes

I ran the script but the fingerprint reader wasn’t enabled in the settings. Then when I rebooted, I didn’t get a login prompt at all. It was just a grey screen with the date at the top and the standard settings at the top right.

I booted up into Ubuntu on another partition but I’m not sure how to fix the Pop!_OS partition from here.

1 Like

@Duane_Johnson thanks for sharing that! After running and uninstalling from my ubuntu partition I was able to login to Pop!_OS again. :+1:t2:

2 Likes

Is anyone having issues using the fingerprint when waking from sleep? When I try it errors with timeout and can’t use it.

@Jacob_Griffin you absolute legend, I’ve spent the last half an hour trying to get the other techniques to work. TYSM.

Just worth noting that if it isn’t letting you use fingerprint to authenticate in a terminal after using sudo, use

sudo pam-auth-update

and select “fingerprint” with the arrow keys, and press space to enable it. you can then press enter to exit.

2 Likes

Trying this again, I’m now getting this error message:
“Failed to enroll new fingerprint”

Edit: this python script fixed it for me:

@Jacob_Griffin Is it now safe to remove the “fprintd” and “libfprint” directories? I installed them in my home directory and would ideally like to keep directories in there to a minimum.

Ran the python script and then was able to register the fingerprint. Thanks guys!

I just installed Pop!_OS 21.10 and got fingerprint working:

sudo apt install pam-fprintd
sudo pam-auth-update

then put the checkmark at the fringerprint option and registered my prints through the user settings.
No script needed (anymore, apparently :man_shrugging:t2:).

4 Likes

@Duane_Johnson do you or anyone else have an idea of how to fix the issue of not having users listed & not being able to login from the original code if your drive is encrypted? I’m having a rough time trying to follow your fix because the Luks encryption. I still have not been able to mount my drive while in recovery mode and my user folder is denying me access.
I’m on Pop OS 21.10.

In my searching to fix this problem, I’ve encountered many others who’ve suggested trying things like this:

cryptsetup luksOpen /dev/nvme0n1p3 crypt_data
mount /dev/mapper/crypt_data /mnt

I tried the first line and i get stuck because it spits the error line:

cryptsetup open /dev/nvme0n1p3 crypt_data
Device /dev/nvme0n1p3 does not exist or access denied.

I can’t find anything to suggest how to fix this issue, and/or I’m too deep in stuff that I don’t understand (probably both). The closest I found was a forum question which was slightly related: partitioning - cryptsetup luksFormat error: access denied or device doesnt exist - Ask Ubuntu. I’m providing this mostly to show my work.

I’ve also tried just accessing my user folder through the Files app because graphical interfaces are my crutch and I was able to locate my user folder already mounted at: /media/recovery/[root folder]/home/[user] but to my dismay, it gave me this error when I tried to open it.


So I have no idea what to do or even if that error is related to the fact that my drive is not mounted through the cryptsetup luksOpen command. Only thing that seemed relevant on the web was this article which did not fix my problem: Fix GVfs Admin “Unix process subject does not have uid set” in Ubuntu 21.10, 21.04 | UbuntuHandbook

Please help? I have a backup of my entire home folder, but it would be really nice if I didn’t have to reinstall Pop OS for the 4th time since that’s a lot more work to re-setup my pc.

Edit: also, yes I tried the most recent suggestions by @ololobus and @rumlyne , neither worked for me for whatever reason. The fingerprint option never showed in the PAM settings.

1 Like