Last active
March 24, 2025 20:04
-
-
Save michaelmrose/3d6ba4d9e01fd49bfca73cf7b7eaf8d2 to your computer and use it in GitHub Desktop.
Mounting ZFS native encrypted home Dir with pam and lightdm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AFTER pam_unix.so | |
auth optional pam_exec.so expose_authtok /usr/local/bin/zfs-unlock-home.sh ifok | |
remainder redacted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Adjust to match your dataset | |
ZFS_DATASET="trident/home/michael" | |
PASS=`cat -` | |
# Only try if dataset is encrypted and not mounted | |
if ! zfs get -H -o value mounted "$ZFS_DATASET" | grep -q "yes"; then | |
echo attempting to load key and mount | |
echo "$PASS" | zfs load-key "$ZFS_DATASET" | |
zfs mount "$ZFS_DATASET" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment