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
if you are X-forwarded remotely into the computer, and wish to use a graphical editor to edit text with root privileges (
sudo gedit
): you can copy your XAUTHORITY to the root user:sudo xauth add $(xauth -f ~/.Xauthority list|tail -1) sudo gedit /usr/local/sbin/mount-zfs-homedir2
If you encounter "Can't open display": that probably means users can't share a DISPLAY? Try closing the ssh session, opening a new ssh session, then doing the
sudo xauth add
andsudo gedit
(i.e. let root be the first user to use that DISPLAY).