-
-
Notifications
You must be signed in to change notification settings - Fork 177
Description
Prerequisites
- I have updated to the latest version using
nix run --refresh github:nix-community/nixos-anywhere - I have reproduced the issue with the
--debugflag - I have searched existing issues to make sure this isn't a duplicate
Bug Description
Sorry I don't have the time to take all these steps to reproduce, anyway, it seems when --copy-host-keys not working, at least in my case.
I'm triyng to install a minimal NixOS on a 512MiB memory vultr vps, naturally I use the minimal NixOS ISO as the installation medium. I need copy the host keys for bootstrap vaultix(secrets) setup, however when the installation finished, the host keys on VPS is not what on my local machine, thus vaultix failed to decrypt my secrets.
I belive this should be the relevant code, however I can't really understand it.
nixos-anywhere/src/nixos-anywhere.sh
Lines 894 to 905 in 25d23ef
| if [ ${copyHostKeys-n} = "y" ]; then | |
| # NB we copy host keys that are in turn copied by kexec installer. | |
| mkdir -m 755 -p /mnt/etc/ssh | |
| for p in /etc/ssh/ssh_host_*; do | |
| # Skip if the source file does not exist (i.e. glob did not match any files) | |
| # or the destination already exists (e.g. copied with --extra-files). | |
| if [ ! -e "\$p" ] || [ -e "/mnt/\$p" ]; then | |
| continue | |
| fi | |
| cp -a "\$p" "/mnt/\$p" | |
| done | |
| fi |
Could it be only occur when using the minimal NixOS ISO? Since it not kexec?
Steps to Reproduce
I have my nixos config on https://github.com/dearfl/nyx, however I don't think it necessary to reproduce.
- deploy a vultr vps with a minimal NixOS ISO attached.
- install any nixosconfig with --copy-host-keys
- after the installation finish, you should see
ssh-keyscanreturn a public key different from your local machine.
Debug Logs
https://fars.ee/cMYeCommand Used
nix run nixpkgs#nixos-anywhere -- -f .#vultr --build-on local --copy-host-keys --no-disko-deps --target-host root@207.148.71.76
Target System
Other
NixOS Version
No response
Environment Information
- Host OS:
- Nix version:
- Target architecture:
Configuration Files
Additional Context
No response