Skip to content

Instantly share code, notes, and snippets.

@tegila
Created December 13, 2022 00:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tegila/04af8df8c03f52fee8dc3a41e633fb2a to your computer and use it in GitHub Desktop.
Save tegila/04af8df8c03f52fee8dc3a41e633fb2a to your computer and use it in GitHub Desktop.
loop luks pam_mount
#!/bin/bash
truncate -s 1G ~/.priv
cryptsetup luksFormat ~/.priv
sudo cryptsetup luksOpen ~/.priv priv
sudo mkfs.ext4 /dev/mapper/priv
sudo cryptsetup luksClose priv
/etc/security/pam_mount.conf.xml:
<volume path="~/.priv" mountpoint="~/priv" />
# right after where it says <!-- Volume definitions -->
/etc/pam.d/system-login:
auth optional pam_mount.so
session optional pam_mount.so
https://askubuntu.com/questions/1020390/how-do-i-auto-mount-luks-partition
https://wiki.gentoo.org/wiki/Pam_mount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment