Open Source / MIT + Apache 2.0

Facelock

Face authentication for Linux PAM.
IR-required capture by default, layered static-presentation checks, a persistent daemon, and optional TPM-sealed encryption. 100% local — your face never leaves the machine.

Published and candidate channels are labeled separately · MIT/Apache 2.0 · No telemetry
facelock
$ sudo facelock setup
# Interactive choices include camera, models, encryption,
# daemon, enrollment, and optional PAM services.
 
$ sudo facelock test
# Read the result: exit 0 alone does not prove a scan or match.

Three-stage recognition pipeline

SCRFD detection finds faces, affine alignment normalizes geometry, and ArcFace produces a 512-dimensional embedding for cosine similarity matching.

Camera Capture

V4L2 frame acquisition with auto-detection. Prefers IR cameras for anti-spoofing. CLAHE enhancement for consistent lighting.

Face Detection

SCRFD neural network locates faces and extracts 5-point landmarks. Affine alignment produces a normalized 112x112 crop.

Embedding Match

ArcFace produces a 512-dim L2-normalized vector. Cosine similarity against stored embeddings determines match or reject.

Defense in depth, on by default

Multiple independent layers reduce static-presentation, tampering, and unauthorized-access risk. They do not claim complete spoof resistance.

IR

IR Camera Enforcement

Enabled by default. Rejects RGB-only operation and applies an IR texture check where a verified IR path is available.

FV

Frame Variance

Requires variation across a window of matched face embeddings. Rejects sufficiently static presentations; it does not establish that every photo or video replay will be rejected.

RL

Rate Limiting

5 face-detected authentication failures per user per 60 seconds by default. Successful and no-face attempts do not consume this budget.

MV

Model Verification

ONNX model files are SHA256-verified at every load. Tampered models are rejected before any inference runs.

DB

D-Bus Policy

D-Bus system bus policy restricts daemon access. Any local user may request authentication for itself; the daemon verifies the caller's UID and every other method is root-only.

AL

Audit Logging

PAM authentication messages use syslog. Optional structured audit logging writes JSONL when enabled; it is disabled by default. Journal and log-file availability depends on the distribution.

Where Facelock fits

Three places it pays for itself the first day you install it.

Sudo without typing

A configured sudo PAM service can offer face before password fallback. The daemon keeps models loaded; measure the camera-specific reopen cost with sudo facelock bench camera-reopen.

Screen lock unlock

Facelock can be added to an existing locker's PAM service. Hyprlock has a built-in user-side adapter; other lockers must own and validate their UI integration.

Display manager login

Display-manager PAM is sensitive and system-dependent. It is not part of the current validated matrix; test in a disposable guest with a recovery path.

Engineered for the Linux PAM ecosystem

A complete face authentication stack written in Rust, with sane defaults and the knobs you need when you outgrow them.

IR Anti-Spoofing

Requires an IR-classified camera by default. Frame variance and IR texture checks target static presentations; they are not a video-replay guarantee.

Persistent Daemon

Persistent daemon keeps ONNX models loaded, so repeated authentication avoids model reload. sudo facelock bench camera-reopen measures the hardware-specific cold-camera cost.

100% Local & Private

All processing happens on-device via ONNX Runtime. Authentication and inference make no network requests; setup and explicit model downloads can use the network. No cloud services, telemetry, or analytics. Facelock does not upload your face data.

PAM Integration

The PAM module can be added to named Linux-PAM services. The wizard edits only services you select; sensitive shared and login stacks require explicit authorization.

TPM Encryption

Optional TPM 2.0 support for encrypting face embeddings at rest. Hardware-bound keys ensure biometric data stays protected even if the disk is copied.

Daemon + Oneshot

Choose persistent daemon mode or direct/oneshot operation. With daemon mode configured, backend-using management commands try D-Bus and can fall back to direct execution. In oneshot mode, PAM invokes its dedicated authentication subprocess.

Your face, your machine, nobody else

Facelock is designed from the ground up to keep your biometric data private.

LO

Local-Only Processing

Face detection and recognition run entirely on your CPU or GPU via ONNX Runtime. No images or embeddings are ever transmitted over the network.

NT

No Telemetry

No analytics or telemetry. Setup and explicit model-download commands can use the network; authentication and inference do not download models or contact servers.

EN

Encryption at Rest

New enrollment uses AES-256-GCM with a local keyfile by default; TPM sealing is optional. Database encryption protects a copy obtained without its key, not a disk copy containing both the database and an unsealed keyfile.

OS

Open Source & Auditable

Facelock's source is dual-licensed under MIT or Apache-2.0. Dependencies and model weights have their own licenses; review the model notice before deployment.

Choose an installation channel

Channel status checked 2026-09-06: v0.2.0 is the latest stable release, published with direct Debian 13, Ubuntu 26.04, and Fedora 44 packages. Every stable channel serves it: the three AUR entries, both APT suites, and the production COPR.

terminal
# Requires an installed AUR helper (yay or paru); run as your ordinary user.
$ yay -S facelock   # or: paru -S facelock
 
# Run the interactive setup wizard
$ sudo facelock setup

The setup wizard includes enrollment and only edits PAM when selected. Keep a root recovery shell open. See docs for exact release status, source prerequisites, and safe testing.

What each feature provides

Implementation-backed properties and their limits. See the contracts and security model before deployment.

Feature Facelock behavior
Language Rust, with native-library and FFI boundaries; memory safety is not a guarantee against all runtime failures.
Daemon mode Models stay loaded. Authentication latency still depends on the camera, runtime and configured checks.
IR enforcement Default on. Requires an IR-classified camera; format evidence does not attest sensor authenticity.
Frame variance check Default on. Checks matched embedding variation; not a video-replay guarantee.
TPM encryption Optional TPM-sealed key. Protection depends on the selected policy and protection of any key backups.
Model verification SHA256 verification before model loading; mismatched files are rejected.
Rate limiting 5 face-detected authentication failures per user per 60 seconds by default, including persistent accounting for oneshot authentication.
D-Bus activation Can start the daemon on demand. The persistent process retains models after authentication; there is no zero-idle-memory promise.
Constant-time matching Constant-time selection and comparison primitives reduce matching side channels; the entire camera/authentication pipeline is not constant-time.
GPU acceleration CUDA, ROCm and OpenVINO are runtime options requiring a compatible ONNX Runtime build and device drivers.
Audit logging PAM syslog messages and optional structured JSONL authentication records (disabled by default); see the contracts for rejection-path coverage.
systemd hardening ProtectSystem=strict and NoNewPrivileges, with explicit writable state paths. The unit retains CAP_SETUID and CAP_SETGID for desktop notifications.
PAM dependency boundary Direct dependencies are libc, toml, serde and zbus. Camera and inference libraries stay outside the PAM module; binary size varies by build.