I have an Ubuntu 17.10 laptop, with users A and B. There are encrypted home directories /home/A
and /home/B
for the two users. These are set up using Ubuntu's default encrypted home directory mechanism (ecryptfs?).
The laptop has another hard disk, which is currently unused and not mounted. I want both users to be able to use this disk, so I want to set up a /home2
folder on this disk, with folders /home2/A
and /home2/B
in it, owned by the two users respectively. Ideally I'd like that /home2/A
should be encrypted, with the same credentials as /home/A
, and should be auto-mounted when user A logs in, just like /home/A
is. And the same for B.
This seems like a completely natural way to use an additional disk just like one would use one's primary disk, in a multi-user scenario. How does one do this?
I tried searching for this but most answers I found talk of full-disk encryption, which is not suitable for a multi-user environment.