--clean: also drop the stale known_hosts entry for the guest
A fresh state disk means openssh generates a brand new host key on next boot, but the old ~/.ssh/known_hosts entry for "hermes" (from vsock connections) sticks around - the next hermes-vm ssh/hermes-ctl/ migrate connection would otherwise fail on a host-key mismatch, since StrictHostKeyChecking=accept-new only accepts genuinely new hosts, not a changed key for an already-known one. ssh-keygen -R hermes runs unprivileged (the invoking user's own known_hosts, not a root-owned path) and is a safe no-op if there's nothing to remove - verified directly. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6d7ff4eace
commit
70c8c275c1
2 files changed
+14
-7
No files matched your search
@@ -645,12 +645,14 @@ the intended repair, not a last resort.
|
||||
|
||||
### Starting completely fresh
|
||||
|
||||
`hermenix setup --clean` stops the VM and deletes the existing
|
||||
`system.raw`/`state.raw`/UEFI vars before walking through setup again — for
|
||||
when you want a genuinely clean first boot rather than the disk-exists,
|
||||
skip-ahead path. It leaves the btrfs subvolumes and any snapshots alone
|
||||
(only the files inside them), and asks you to type `clean` to confirm before
|
||||
touching anything.
|
||||
`hermenix setup --clean` stops the VM, deletes the existing
|
||||
`system.raw`/`state.raw`/UEFI vars, and drops the stale `known_hosts` entry
|
||||
for the guest (a fresh state disk means a fresh SSH host key on next boot,
|
||||
so the old entry would otherwise fail with a host-key-mismatch on your next
|
||||
connect) — then walks through setup again for a genuinely clean first boot,
|
||||
rather than the disk-exists, skip-ahead path. It leaves the btrfs
|
||||
subvolumes and any snapshots alone (only the files inside them), and asks
|
||||
you to type `clean` to confirm before touching anything.
|
||||
|
||||
---
|
||||
|
||||
|
||||
+6
-1
@@ -154,7 +154,12 @@ def "main setup" [
|
||||
do -i { priv rm "-f" $"($base)/system/system.raw" } | complete | ignore
|
||||
do -i { priv rm "-f" $"($base)/state/state.raw" } | complete | ignore
|
||||
do -i { priv rm "-f" $"($base)/OVMF_VARS.fd" } | complete | ignore
|
||||
ok "cleaned existing disk images"
|
||||
# A fresh state disk means a fresh SSH host key on next boot - drop the
|
||||
# stale known_hosts entry now so the next connect doesn't fail on a
|
||||
# host-key mismatch. Not run through priv: this is the invoking user's
|
||||
# own ~/.ssh/known_hosts, not a root-owned path.
|
||||
do -i { ^ssh-keygen -R hermes } | complete | ignore
|
||||
ok "cleaned existing disk images and stale known_hosts entry"
|
||||
}
|
||||
|
||||
let parent = ($base | path dirname)
|
||||
|
||||
Reference in new issue
Block a user