Skip to content
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

Fix #499 #596

Merged
merged 1 commit into from Mar 27, 2017
Merged

Fix #499 #596

merged 1 commit into from Mar 27, 2017

Conversation

Nadrieril
Copy link
Member

This PR adds the auto-generated ssh public key to the machine configuration via MachineState.get_physical_spec().
This fixes #499.

@rbvermaa
Copy link
Member

@Nadrieril How does this fix the issue actually? The issue mentions 'if the NixOS configuration overrides the option'. If it is overridden, how would adding this fix the issue? Wouldn't it be still overriden?

@Nadrieril
Copy link
Member Author

No because nixos combines both lists of keys.
Given how nixos options combine, by default if your configuration adds a key, both your key and the nixops key are added to the final combination, so it works.

@rbvermaa
Copy link
Member

NixOS only combines values with the same priority. If e.g. the option is overriden with a lower prio, this would still not work. I've asked Domen for clarification in the issue.

@Nadrieril
Copy link
Member Author

Oh right. Still better than the previous behaviour though, which was that setting root.ssh.keys even at default priority would erase nixops' key.
Would there be a better way to do it through nixos configuration ? I'm not super familiar with the intricacies of config merging.

@Nadrieril
Copy link
Member Author

This PR may not fix all possible problems, but it still fixes the most current case which is people setting users.extraUsers.root.openssh.authorizedKeys.keys = [ my_key ].
I therefore think we could merge it and think about a better solution only if people actually need it.

@danbst
Copy link
Contributor

danbst commented Mar 3, 2017

@rbvermaa please, merge this. A very nasty issue, because extra keys for root currently break libvirtd deployments.

I'm now using this patch locally

@domenkozar domenkozar merged commit 47e0c8e into NixOS:master Mar 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Libvirtd: set root key without overriding root's key
4 participants