github:https://github.com/boltgolt/howdy

archwiki: https://wiki.archlinux.org/title/Howdy_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)

安装 Howdy

1
yay -S howdy

修改 Howdy 目录权限

1
sudo chmod -R 755 /lib/security/howdy

添加红外传感器

可以在诸如 cheesefswebcamAUR 或者 v4l-utils 的程序里找到并确定能连接到红外传感器的正确 /dev/videoX 文件,

以内置于 v4l-utils 软件包的工具为例:

1
2
3
4
$ v4l2-ctl --list-devices
Integrated_Webcam_HD: Integrate (usb-0000:00:14.0-11):
/dev/video0
/dev/video1

修改配置文件 sudo vim /lib/security/howdy/config.ini 也可以使用 sudo howdy config 修改

1
2
3
 修改以下内容
- device_path = none
+ device_path = /dev/video0

测试配置是否成功

1
sudo howdy test

添加人脸模型

1
sudo howdy add

查看添加的人脸模型

1
sudo howdy list

面部验证

为了能识别用户,必须对 Howdy 需要用到的 PAM 配置文件做一些小修改,任取其一加入:

建议放在 PAM 配置第一行

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

sudo

1
sudo vim /etc/pam.d/sudo

image-20220524134900307

测试

1
sudo visudo

SDDM

1
2
3
sudo vim /etc/pam.d/system-login

sudo vim /etc/pam.d/sddm

polkit-1 KDE 代理验证程序

1
sudo vim /etc/pam.d/polkit-1

取消拍照

Howdy 会在识别用户时拍照,然后保存到 /lib/security/howdy/snapshots

sudo vim /lib/security/howdy/config.ini

1
2
3
[snapshots]
capture_failed = false
capture_successful = false

常见问题

终端里有 GStreamer warnings

已经让 Howdy 正常工作,但是在终端里收到警告:

1
2
3
4
5
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (2401) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module source reported: Could not read from resource.
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (1356) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (862) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Identified face as likfees

添加 opencv log 日志等级环境变量 sudo vim /etc/profile

1
export OPENCV_LOG_LEVEL=ERROR