feat: respect old machine ssh host keys (#107)

When lustrating another machine, you usually are already connected by SSH. Thus, you usually already trusted that machine's keys.

With this patch, those keys are kept, so after booting into nixos, you still connect to the same trusted IP+Keys combination.

@moduon MT-904
This commit is contained in:
Jairo Llopis 2022-07-11 18:25:21 +01:00 committed by GitHub
parent 1b0c79cd46
commit 318fc516d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -309,6 +309,7 @@ infect() {
echo etc/nixos >> /etc/NIXOS_LUSTRATE
echo etc/resolv.conf >> /etc/NIXOS_LUSTRATE
echo root/.nix-defexpr/channels >> /etc/NIXOS_LUSTRATE
(cd / && ls etc/ssh/ssh_host_*_key* || true) >> /etc/NIXOS_LUSTRATE
rm -rf /boot.bak
isEFI && umount "$esp"