Last active
March 24, 2025 20:04
-
-
Save michaelmrose/3d6ba4d9e01fd49bfca73cf7b7eaf8d2 to your computer and use it in GitHub Desktop.
Revisions
-
michaelmrose revised this gist
Mar 24, 2025 . 2 changed files with 7 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ 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 charactersOriginal file line number Diff line number Diff line change @@ -2,9 +2,11 @@ # 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 -
michaelmrose created this gist
Mar 24, 2025 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ auth optional pam_exec.so expose_authtok /usr/local/bin/zfs-unlock-home.sh 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ #!/bin/bash # Adjust to match your dataset ZFS_DATASET="trident/home/michael" # Only try if dataset is encrypted and not mounted if ! zfs get -H -o value mounted "$ZFS_DATASET" | grep -q "yes"; then echo "$PAM_AUTHTOK" | zfs load-key "$ZFS_DATASET" zfs mount "$ZFS_DATASET" fi