Skip to content
This repository has been archived by the owner on Aug 27, 2018. It is now read-only.

users.extraUsers.xxx.openssh takes effect before users.extraUsers.xxx.createHome #12

Open
mornfall opened this issue Jul 5, 2012 · 5 comments

Comments

@mornfall
Copy link

mornfall commented Jul 5, 2012

Basically, extraUsers are not created until after openssh authorized_keys have been updated. For users that rely on createHome to get their home directories, this means a single-step deployment breaks and the keys are never installed. (openssh silently skips any users without home directories)

@rickynils
Copy link
Member

Correct me if I'm wrong, but isn't authorized_keys generated when the ssh service is restarted? And that should happen after the users are created, shouldn't it? How does your use case look? Is this on the boot-up activation, or after nixos-rebuild switch?

@mornfall
Copy link
Author

mornfall commented Jul 6, 2012

This is during a switch. I have verified that in two steps (add the user with createHome = yes, switch, add the SSH key, switch again), the keys are created correctly.

@mornfall
Copy link
Author

mornfall commented Jul 6, 2012

PS: I want to use this with disnixos-deploy-network, so doing a nixos-rebuild boot and rebooting is not really an option, even if it worked.

@rickynils
Copy link
Member

Of course rebooting is not an option. I suspect the ssh service isn't restarted properly when rebuilding. I'll try to look into this when I get time.

@domenkozar
Copy link
Member

Does this still happen with new mutable/immutable users creation?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants