Skip to content

Instantly share code, notes, and snippets.

@vorstrelok
vorstrelok / keepassxc_pam.fish
Created February 2, 2021 15:20
KeePassXC PAM loing manager integration
#!/usr/bin/fish --private
# !!!Security note!!!
# This will give any process running as your user access to your password while
# key has not expired (2 minutes or revocation by service, whatever comes first)
# Proper solution would probably be writing PAM module and transfering key
# straight to KeePassXC's own keyring
set userid (/usr/bin/id -u "$PAM_USER")
if test "$PAM_TYPE" = 'auth'