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

sshd failed to start #4

Open
Guanran928 opened this issue Sep 21, 2024 · 3 comments
Open

sshd failed to start #4

Guanran928 opened this issue Sep 21, 2024 · 3 comments
Labels
question Further information is requested

Comments

@Guanran928
Copy link

After I deployed a NixOS machine with Disko and Preservation, sshd.service failed after booting up.

image
image

/etc/ssh/ssh_host_* are empty files, bind mounted from /persist.

disko config: https://pb.ny4.dev/JQxPwa.nix
preservation config: https://pb.ny4.dev/r5DtFb.nix

@WilliButz
Copy link
Owner

I cannot confirm this issue from any of my hosts, but I'd be happy to take a look at the config. Could you please provide your config in a less obscure fashion?

For example in a markdown code block (https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks), or via https://gist.github.com

@WilliButz WilliButz added the question Further information is requested label Oct 11, 2024
@Guanran928
Copy link
Author

Here's my entire flake, the machine that I'm facing this issue is sin0:
https://git.ny4.dev/nyancat/flake/src/branch/master/hosts/vultr

I'm not too sure what's going on, this issue appears after every deploy.

image

@WilliButz
Copy link
Owner

Oh I see, it is caused by the bind-mounts. The log messages from the journal would have been helpful :)

Try setting both how = "symlink" and configureParent = true for the key files in preservation like so:

preservation.preserveAt."/persist".files = [
  { file = "/etc/ssh/ssh_host_rsa_key"; how = "symlink"; configureParent = true; }
  { file = "/etc/ssh/ssh_host_ed25519_key"; how = "symlink"; configureParent = true; }
];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants