Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Woolfy025/08f556783dcef94e3133f4980092b8d0 to your computer and use it in GitHub Desktop.
Save Woolfy025/08f556783dcef94e3133f4980092b8d0 to your computer and use it in GitHub Desktop.
Setup face recognition authentication on ArchLinux and KDE Plasma using howdy

Setup face recognition authentication on ArchLinux and KDE Plasma using howdy

This is surprisingly easy...basically following Arch Wiki:

https://wiki.archlinux.org/index.php/Howdy

After some investigation, here is step by step and preferences

Install howdy

https://github.com/boltgolt/howdy

https://aur.archlinux.org/packages/howdy/

yay -S --editmenu howdy

yay is an AUR helper

on 2019/10/30, I need to edit PKGBUILD, removing --yes USE_AVX_INSTRUCTIONS to get it compiled

Setup howdy

Find out IR camera device

mpv /dev/video2
# see if this device is IR camera
# it might be /dev/video0, /dev/video1, /dev/video{N}...

mpv is a video playback application

config.ini

sudo vim /lib/security/howdy/config.ini
[core]
# Print that face detection is being attempted
detection_notice = true

# ...

[video]
# The certainty of the detected face belonging to the user of the account
# On a scale from 1 to 10, values above 5 are not recommended
certainty = 4.5

# ...

# The path of the device to capture frames from
# Should be set automatically by an installer if your distro has one
device_path = /dev/video2

# ...

# Because of flashing IR emitters, some frames can be completely unlit
# Skip the frame if the lowest 1/8 of the histogram is above this percentage
# of the total
# The lower this setting is, the more dark frames are ignored
dark_threshold = 100

where device_path = /dev/video{N} is the IR camera device we found using mpv above

Register faces

sudo howdy add # follow its instructions

explore by sudo howdy --help, you will learn to list, remove faces

Set using howdy to authenticate

sudo vim /etc/pam.d/kde # for KDE lock screen
sudo vim /etc/pam.d/sudo # for sudo, obviously

add this line to kde and sudo files before system-auth line:

auth sufficient pam_python.so /lib/security/howdy/pam.py

# original system-auth setting
auth include system-auth

Get KDE lock screen using howdy to unlock

boltgolt/howdy#219

  • detection_notice = true above will make lock screen showing Attempting face detection
  • dismiss_lockscreen = above will prevent IR camera from keeping scanning after unlock (kind of loop?)

And run this to allow using howdy:

sudo chmod -R 755 /lib/security/howdy

Reboot to ensure PAM setting is taking place

Prevent GStreamer warnings in shell

https://wiki.archlinux.org/index.php/Howdy#GStreamer_warnings_in_shell

vim ~/.xprofile

add this line:

export OPENCV_LOG_LEVEL=ERROR

Then reboot or re-login

Using howdy to authenticate

When sudo

Just sudo ..., howdy will start

To unlock KDE lock screen

Leave password empty and press enter, howdy should start

Using howdy on SDDM is not recommended

SDDM is display manager that authenticates only when laptop just boots up and login, while lock screen asks for authentication much more often

add auth sufficient pam_python.so /lib/security/howdy/pam.py to /etc/pam.d/sddm will make it to authenticate using howdy, leave password empty and press enter

But this will result some drawbacks:

  • when failed, SDDM's password input box seems to be freezed..
  • will be unable to unlock KDE Wallet automatically on login and ask password to unlock KDE Wallet for Wifi credentials...Arch Wiki Link
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment