I started with a basic Ubuntu 22.10 installation, where I chose in the installer to use ZFS as my volume manager.
I wanted to encrypt my home folder.
I followed the article (and comments, including Christoph Hagemann's) from:
https://talldanestale.dk/2020/04/06/zfs-and-homedir-encryption/
To achieve:
- Home directory (a ZFS rpool mount) is encrypted
- You are only prompted for password if you are trying to login to that user
- So PC can boot fine to login screen without intervention
- Password prompt authenticates you as the user and decrypts the home folder's rpool
- SSH users get the same experience as physical users
- You can power on the PC, then SSH in
- Once rpool is unlocked: subsequent SSH login can use key exchange instead of password
- Once all sessions log out: rpool is encrypted and unmounted again
/usr/local/sbin/mount-zfs-homedir2
: