-
-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simultaneous passwordFile and secret.keyFile #415
Comments
There is additionalKeyFiles? You can also set keyFile and askPassword at the same time? But then booting will fail if the keyFile is unavailable I guess. |
My intuition was that additionalKeyFiles were for when you wanted more than just one key file. So you cannot use |
I work around this by adding a # part of the disko-config.nix
root = {
size = "100%";
content = {
type = "luks";
name = "cryptroot";
extraOpenArgs = [ "--allow-discards" ];
# Encrypt with the key first
settings = {
keyFile = "/dev/mapper/cryptkey";
keyFileSize = 8192;
};
# Use a postCreateHook to add the passphrase from a file
postCreateHook = ''
cryptsetup luksAddKey --key-file /dev/mapper/cryptkey \
--keyfile-size 8192 \
/dev/disk/by-partlabel/dev-vda-root /tmp/disk.key
'';
content = {
# ...
};
}; There's probably a better way to do fill in the values in the hook, but this works for me. The |
After digging into it further - seems like the only reason my solution works is because we call Unfortunately, If I have time I'll send a PR for it. |
I think
in your nixos config, you should have the right host key in your initrd config.
That would be very welcome! |
I see this more as a work around than actually fixing the issue. |
I believe it might be easier to discuss the merits of this opinion if you could share with us why you regard it as a a workaround and what "actually fixing the issue" would look like from your perspective? :) |
The actual issue is that |
In the meantime, I've had a thought to make the disko options a bit more intuitive. You change Edit: I can start on a PR for this change if this behavior is desired. |
Ah, without quotations or context it's rather hard to tell whether your posts refer to the one before you. So in my understanding that actually fixes the issue insofar as that you can simultaneously use a password an key file? Getting the interface nicer would surely be appreciated, happy to review - and your proposal sounds like the right direction to me :) |
Yeah I could do that - but that would mean I generate the host key outside of the host that uses it. I wanted to generate the host key on the host that would be using it, hence the need for a I've worked around this by writing my own subpar implementation of I think having it all in the disko config would make it much cleaner :-) |
@midirhee12 I agree with @phaer, your proposal sounds good, and a PR for this would be welcome. If you (or anyone else) decide to implement this, please use |
0d39ae5
I think this commit has a bit of an error. This assumes that password files are an alternative to keyfiles. But in reality, many people use passwords as a backup in case they lose their file.
I'm not sure if this is intentional. So I don't know whether to state that this is a bug or a feature request. But here ya go :P
The text was updated successfully, but these errors were encountered: