Skip to content

Integrations

Linux Hello Bot edited this page Dec 8, 2025 · 3 revisions

Integrations

Bash Integration

You can use Linux Hello in your own scripts (e.g., sudo replacements, unlocking secrets).

Basic Usage

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

Reference

  • face_auth [timeout]: Main function. Returns 0 on success, 1 on fail.
  • face_is_enrolled [user]: Returns 0 if user has data.

D-Bus Integration

Linux Hello provides a D-Bus interface org.faceauth.Service at /org/faceauth/Service.

Methods

  • Authenticate(int timeout) -> (bool success, string user)
  • CheckPresence() -> bool

Example (Python)

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}!")

PAM Integration

Linux Hello can integrate with PAM (Pluggable Authentication Modules) to unlock your computer or authorize sudo.

⚠️ Warning: Incorrect PAM configuration can lock you out of your system.

Installation

  1. Navigate to pam/.
  2. Run sudo ./install_pam.sh.
  3. This configures /etc/pam.d/ files to use face authentication via pam_exec.so.
  4. Face auth runs first, password fallback is always available.

Configuration

The script adds this line to PAM configuration files:

auth    sufficient    pam_exec.so quiet stdout /usr/local/bin/face-auth pam-authenticate

Uninstallation

Run sudo ./uninstall_pam.sh inside the pam/ directory.

Clone this wiki locally