thinkpad-T480SなUbuntuで指紋や顔認証を行う

システム

  • ubuntu18.04
  • Thinkpad-T480S

デフォルトだと指紋も顔認証も使えません。

ここでは指紋認証と顔認証を使ってsudoの認証をパスできるようにする方法を書きます

指紋認証

いろいろ入れる。

$ sudo add-apt-repository ppa:uunicorn/open-fprintd
$ sudo apt update
$ sudo apt install open-fprintd fprintd-clients python3-validity

指紋の登録

$ fprintd-enroll

指紋センサのLEDが点灯するので登録する指を何度かゆっくりペチペチする。

PAM設定

sudo pam-auth-update

GUIのナビが起動するので

[ ] Fingerprint authentication

↓を

[*] Fingerprint authentication

にする。<tab>で選択<enter>で決定<space>で[]を[*]にできる。

顔認証

いろいろ入れる。

$ sudo apt-get install v4l-utils
$ sudo add-apt-repository ppa:boltgolt/howdy
$ sudo apt update
$ sudo apt install howdy

howdyのインストール中に

You can always change this setting in the config.
What profile would you like to use? [f/b/s]:  

と聞かれるので<f><b><s>のどれかを入力

fは速さ優先モード

bはバランスのb

sはセキュリティのs

カメラなどの設定

$ sudo howdy config

設定例

マストなのはforce_mjpegをtrueにすること

# Howdy config file
# Press CTRL + X to save in the nano editor

[core]
# Print that face detection is being attempted
detection_notice = false

# Do not print anything when a face verification succeeds
no_confirmation = false

# When a user without a known face model tries to use this script, don't
# show an error but fail silently
suppress_unknown = false

# Disable Howdy in remote shells
ignore_ssh = true

# Disable Howdy if lid is closed
ignore_closed_lid = true

# Disable howdy in the PAM
# The howdy command will still function
disabled = false

# Use CNN instead of HOG
# CNN model is much more accurate than the HOG based model, but takes much more
# computational power to run, and is meant to be executed on a GPU to attain reasonable speed.
use_cnn = false

[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
# Lower is better
certainty = 4.2

# The number of seconds to search before timing out
timeout = 4

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

# Scale down the video feed to this maximum height
# Speeds up face recognition but can make it less precise
max_height = 480

# Set the camera input profile to this width and height
# The largest profile will be used if set to -1
# Automatically ignored if not a valid profile
frame_width = -1
frame_height = -1

# 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 = 50

# The recorder to use. Can be either opencv (default), ffmpeg or pyv4l2.
# Switching from the default opencv to ffmpeg can help with grayscale issues.
recording_plugin = opencv

# Video format used by ffmpeg. Options include vfwcap or v4l2.
# FFMPEG only.
device_format = v4l2

# Force the use of Motion JPEG when decoding frames, fixes issues with YUYV
# raw frame decoding.
# OPENCV only.
force_mjpeg = true

# Specify exposure value explicitly. This disables autoexposure.
# Use qv4l2 to determine an appropriate value.
# OPENCV only.
exposure = -1

[snapshots]
# Capture snapshots of failed login attempts and save them to disk with metadata
# Snapshots are saved to the "snapshots" folder
capture_failed = true

# Do the same as the option above but for successful attempts
capture_successful = true

[debug]
# Show a short but detailed diagnostic report in console
# Enabling this can cause some UI apps to fail, only enable it to debug
end_report = false

カメラのテスト

<ctrl>+<c>で終了

$ sudo howdy test

顔の追加

<enter>を押してカメラをまっすぐ眺める。

$ sudo howdy add

PAM設定

sudo vim /etc/pam.d/sudo

末尾に以下の文を追加する

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

handaru

handaru.net

handaru(はんだる)です。 工作が趣味です。

コメント

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です