fix: decline to support fido2 multi drive setups#1109
fix: decline to support fido2 multi drive setups#1109RoyalOughtness merged 6 commits intosecureblue:livefrom
Conversation
There was a problem hiding this comment.
I think it's a little strange to put anything other than users' home directories in /var/home; I don't know of anything else that does this. I suggest instead changing [edit: this doesn't work]"/var/home/$SUDO_USER" to ~"$SUDO_USER", which will correctly identify the home directory of SUDO_USER regardless of whether that's root (or some other user with a home directory in a nonstandard location). Do note that the ~ has to be outside quotes for it to be properly expanded by the shell.
The problem is that when you run ujust from run0, $SUDO_USER is blank. We could add something to test and find the home directory regardless, but this is a lot of complexity. I agree it is unusual, but it doesn't make sense either for a drive encryption key to be only accessible from one user anyway. |
|
That doesn't seem right—I just tried running a nested I also think that on a multi-user system, there definitely could be good reason that a system administrator might not want the recovery key to be visible to all unprivileged users. So, putting it in the calling user's home directory still seems like the best option. If somehow |
|
You're right, it's not blank it's still root.
|
|
Oops, my bad, that works in fish but not in bash—forgot to switch to bash to check that. A method that does work in bash is: getent passwd "$SUDO_USER" | cut -d: -f6 |
|
TBH, we should port these to python instead of continuing to build on the bash versions |
Currently if you launch the fido2 autounlock script from a run0 terminal, it mostly works, but your recovery key is not saved because root doesn't have a home directory (at least not at /var/home/root/. Considering drive encryption is global to the machine, there's no reason to put the recovery key in a specific user's directory, thus always putting the recovery key in /var/home/ is an elegant solution.