Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

pam_parallel

Runs PAM authentication modules in parallel. The first module to succeed logs you in. Splits modules into a foreground (fg=, allows I/O like passwords) and background (bg=, async, no I/O, like fingerprint or USB).

Install

Dependencies: You need a C compiler (e.g., gcc) and your distribution's PAM development headers (often named libpam0g-dev, pam-devel, or libpam-dev). Then run

make
sudo make install

Setup & Example

Instead of placing modules directly in your main PAM file, create separate sub-configs for each method, then map them using pam_parallel.so.

Step A: Create method sub-configs

  1. Create /etc/pam.d/sub-pwd (for your password):
auth sufficient pam_unix.so try_first_pass
  1. Create /etc/pam.d/sub-fp (for your fingerprint):
auth sufficient pam_fprintd.so
  1. Create /etc/pam.d/sub-usb (for your usb device):
auth sufficient pam_usb.so

Step B: Update your target application

Edit the PAM file for the app you want to configure (e.g., /etc/pam.d/sudo or /etc/pam.d/swaylock) and replace/append the existing auth rules with:

auth sufficient pam_parallel.so fg=sub-pwd bg=sub-fp,sub-usb

Note: You can specify multiple background modules separated by commas (no spaces): bg=sub-fp,sub-usb

Uninstall

Revert the pam.d files appropriately, then run:

sudo make uninstall

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages