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

Switch to root user if non-root user is used for nixos installer #293

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

nbdd0121
Copy link
Contributor

Fix #279

Currently nixos-anywhere works with non-root users on non-NixOS installer/recovery images since it will kexec into a NixOS installer and proceed as root. But it doesn't work for NixOS installer if non-root user is used. Non-root user can be desirable if a preconfigured image is used both as Live CD and installer.

This PR allows non-root configuration by copying ~/.ssh/authorized_keys to /root/.ssh/authorized_keys and proceed as root (this should be fine regardless how user logs into the non-root user, since the nixos-anywhere.pub is what matters).

Copy link
Member

@Mic92 Mic92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds ok. Haven't tested. This assumes that root login via ssh key is enabled, which should be the case for all nixos installer I encountered so far.

@ibizaman
Copy link

FWIW I confirm this works. I just tested this locally using the NixOS USB installer.

@Mic92 Mic92 merged commit 05854a9 into nix-community:main Apr 10, 2024
23 checks passed
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

Successfully merging this pull request may close these issues.

no-os install requires root login
3 participants