SDB:Facial authentication
Situation
You have built-in camera (and IR emitters optionally) and want to use the Windows Hello™ style facial authentication for openSUSE based on howdy package.
Procedure
Installing with YaST or Zypper requires logging in as root.
Add the RPM Repository
YaST
- Open YaST Control Center, then click Software Repositories.
- Click Add and Next.
- Enter name "dmafanasyev" and set the repository URL according to your version of openSUSE (replace
[leap_version]
to 15.4 & etc.).
openSUSE Leap
https://download.opensuse.org/repositories/home:/dmafanasyev/[leap_version]/
openSUSE Tumbleweed
https://download.opensuse.org/repositories/home:/dmafanasyev/openSUSE_Tumbleweed
Zypper
According to your version of openSUSE run in terminal:
openSUSE Leap
# sudo zypper addrepo --refresh https://download.opensuse.org/repositories/home:/dmafanasyev/[leap_version]/ dmafanasyev
openSUSE Tumbleweed
# sudo zypper addrepo --refresh https://download.opensuse.org/repositories/home:/dmafanasyev/openSUSE_Tumbleweed/ dmafanasyev
install python3-dlib using OCI
Install
YaST
- Go to the YaST Control Center and click Software Management.
- View > Repositories > dmafanasyev
- Choose the howdy package
- Press Accept
Zypper
Run in terminal
# sudo zypper in howdy
Configuration
Howdy
Log in as the root user and open the file /usr/lib64/security/howdy/config.ini
using your favorite text editor (e.g. mcedit, nano or vi). For example for mcedit:
# sudo mcedit /usr/lib64/security/howdy/config.ini
Set the parameter device_path
:
device_path = <the path to the device to capture frames from>
For the simplest case this is path to camera (for your Laptop the index 0 may be different):
device_path = /dev/video0
But it is better to use IR emmiters because it will be work correct in the dark place also. Try different index in the path to find apropriate value. For example this is may be index 2:
device_path = /dev/video2
You can change another parameters according to the comments in config file. For example set:
detection_notice = true
to print that face detection is being attempted.
At the last step add face model using command:
# sudo howdy add
or if you use kde plasma
# kdesu howdy add
This is good idea to add about 3-5 models for increasing accuracy of face recognition.
PAM
Now you need to tell to the Pluggable Authentication Modules (PAM) system to use facial authentication. The directories /etc/pam.d/
and /usr/etc/pam.d/
contains the configuration files of authentication for different system services. The most interesting is:
/etc/pam.d/common-auth
- configuration of login into graphical user interface through SDDM (the login screen after system start up but before desktop environment launch)
Log in as the root user, open the configuaration file for service under interest using your favorite text editor (e.g. mcedit, nano or vi), and insert on first line the following string:
auth sufficient pam_python3.so /usr/lib64/security/howdy/pam.py
also edit file /usr/lib64/security/howdy/pam.py replacing
import ConfigParser
with
import configparser
and
config = ConfigParser.ConfigParser
with
config = configparser.ConfigParser
You can do it by running
sed -i 's|import ConfigParser|import configparser|g' /usr/lib64/security/howdy/pam.py
sed -i 's|config = ConfigParser.ConfigParser|config = configparser.ConfigParser|g' /usr/lib64/security/howdy/pam.py
Known issues
- In some cases howdy does not recognize your face. If this happen during screen unlock or login into terminal mode you could try it again. But in SDDM only one attempt works correct while next time nothing happens. As workaround you could enter "Ctrl + Alt + Backspace" to restart graphical interface and try again.
- Everytime after system update the modifications of authentication configuration files located at
/usr/etc/pam.d
are reseted. Hence you need to configure the system services for using the Howdy everytime after packages update (see PAM section).