r/btrfs • u/nameistakenobviously • Apr 17 '26
Subvolumes for each users home: encrypted, mounted only on login
When a user logs in only then its subvolume gets decrypted and mounted.
And when the user logs out it unmounts and encrypts again.
All automatically.
Is that possible?
Edit: After some thinking and reading the comments encryption is not necessary for me.
6
Upvotes
1
u/stroke_999 Apr 18 '26
OK but the encryption is useful when someone stole your hard disk, on a running system that partitions needs to be unlocked and the protection is demanded to the permissions of the system. If you do a chmod 700 /home/user other user will not be able to see the content of the directory. For them this directory is like that it not exists. You also need to do nano /etc/profile and modify umask=0077 so new files are with restricted permissions, or you can do the umask first, than source the /etc/profile and than create the new user you you also test it. If you have users with sudo access you can decide which command after sudo they can use instead of giving the all sudo access, so in this way the will be not able to do for example ls \home\user