-
Notifications
You must be signed in to change notification settings - Fork 0
Integrations
Linux Hello Bot edited this page Dec 8, 2025
·
3 revisions
You can use Linux Hello in your own scripts (e.g., sudo replacements, unlocking secrets).
Source the library script:
#!/bin/bash
source /opt/linux-hello/face-auth.sh
echo "Please look at the camera..."
if face_auth 5; then
echo "Authenticated!"
# Do secure stuff
else
echo "Go away!"
exit 1
fi-
face_auth [timeout]: Main function. Returns 0 on success, 1 on fail. -
face_is_enrolled [user]: Returns 0 if user has data.
Linux Hello provides a D-Bus interface org.faceauth.Service at /org/faceauth/Service.
Authenticate(int timeout) -> (bool success, string user)CheckPresence() -> bool
import dbus
bus = dbus.SessionBus()
obj = bus.get_object('org.faceauth.Service', '/org/faceauth/Service')
interface = dbus.Interface(obj, 'org.faceauth.Service')
success, user = interface.Authenticate(10)
if success:
print(f"Hello {user}!")Linux Hello can integrate with PAM (Pluggable Authentication Modules) to unlock your computer or authorize sudo.
- Navigate to
pam/. - Run
sudo ./install_pam.sh. - This configures
/etc/pam.d/files to use face authentication viapam_exec.so. - Face auth runs first, password fallback is always available.
The script adds this line to PAM configuration files:
auth sufficient pam_exec.so quiet stdout /usr/local/bin/face-auth pam-authenticate
Run sudo ./uninstall_pam.sh inside the pam/ directory.