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

No ssh keys installed if /root/.ssh/authorized_keys is an empty file #138

Open
aequitas opened this issue Feb 27, 2023 · 3 comments
Open

Comments

@aequitas
Copy link
Contributor

When /root/.ssh/authorized_keys is an empty file the infect script will look no further and not install any ssh keys for root in the new NixOS.

@ghost
Copy link

ghost commented Apr 26, 2023

@aequitas it appears to be a prerequisite to have a rsa/ed25519 key already provisioned under /root/.ssh/authorized_keys

How do I use it?

    Read and understand the [the script](https://github.com/elitak/nixos-infect/blob/master/nixos-infect)
    Deploy any custom configuration you want on your host
    Deploy your host as non-Nix Operating System.
    Deploy an SSH key for the root user.

    NB: This step is important. The root user will not have a password when nixos-infect runs to completion. To enable root login, you must have an SSH key configured.

@aequitas
Copy link
Contributor Author

Correct. However there are 3 locations where keys should be searched (https://github.com/elitak/nixos-infect/blob/master/nixos-infect#L21), but the other 2 are skipped if the first location contains an empty file or does not contain valid keys. I made a PR that should fix the issue: #148

@ghost
Copy link

ghost commented Apr 27, 2023

@aequitas thanks for explaining this further. patch looks good

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

No branches or pull requests

1 participant