SDB:Facial authentication

(Redirected from SDB:Howdy)
Jump to: navigation, search

Tested on openSUSE

Recommended articles

Icon-manual.png

Related articles

Icon-help.png



Icon-warning.png
Warning: This guide and package is only applicable for x86_64 distributives.

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

  1. Open YaST Control Center, then click Software Repositories.
  2. Click Add and Next.
  3. 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

  1. https://software.opensuse.org/ymp/home:badshah400:howdy/openSUSE_Tumbleweed/python311-dlib.ymp?base=openSUSE%3AFactory&query=python311-dlib

Install

YaST

  1. Go to the YaST Control Center and click Software Management.
  2. View > Repositories > dmafanasyev
  3. Choose the howdy package
  4. 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).

See also

External links