Facelock reads its configuration from /etc/facelock/config.toml. Override the path with the FACELOCK_CONFIG environment variable.
All settings are optional. Facelock auto-detects the camera and uses sensible defaults. The annotated config file at config/facelock.toml in the repository serves as the canonical example.
Controls how the PAM module reaches the face engine.
Key
Type
Default
Description
mode
string
"daemon"
"daemon" connects to a persistent daemon via D-Bus system bus (~150-600ms depending on camera state). "oneshot" spawns facelock auth per PAM call (slower, ~700ms+, no background process).
model_dir
string
"/var/lib/facelock/models"
Directory containing ONNX model files.
idle_timeout_secs
u64
0
Shut down the daemon after this many idle seconds. 0 means never. Useful with D-Bus activation.
Disable face authentication entirely. PAM returns IGNORE, falling through to the next auth method.
abort_if_ssh
bool
true
Refuse face auth when connected via SSH (no camera available).
abort_if_lid_closed
bool
true
Refuse face auth when the laptop lid is closed (camera blocked).
require_ir
bool
true
Require an IR camera for authentication. RGB cameras are trivially spoofed with a printed photo. Only set to false for development/testing.
require_frame_variance
bool
true
Require multiple frames with different embeddings before accepting. Defends against static photo attacks.
require_landmark_liveness
bool
false
Require landmark movement between frames to pass liveness check. Detects static images by tracking facial landmark positions across frames. Experimental; off by default.
suppress_unknown
bool
false
Suppress warnings for unknown users (users with no enrolled face).
min_auth_frames
u32
3
Minimum number of matching frames required before accepting. Only applies when require_frame_variance is true.
Controls how face embeddings are encrypted at rest.
Key
Type
Default
Description
method
string
"none"
"none" -- no encryption. "keyfile" -- AES-256-GCM with a plaintext key file. "tpm" -- AES-256-GCM with a TPM-sealed key (recommended if TPM available).