fix(diagnostics): use StrictHostKeyChecking=no for Linux guest-diag SSH

Diagnostics is best-effort. Using accept-new without UserKnownHostsFile
caused the system known_hosts (~/.ssh/known_hosts) to be consulted,
which holds a stale key from a previous clone of the same IP.
Switch to no+NUL (same as Wait-VMReady) to avoid false host-key errors.
This commit is contained in:
Simone
2026-05-12 22:29:57 +02:00
parent 31a040682e
commit 74331ac301
+2 -1
View File
@@ -391,7 +391,8 @@ function Get-GuestDiagnostics {
Write-Warning "[Diagnostics] No SshKeyPath supplied for Linux guest — skipping." Write-Warning "[Diagnostics] No SshKeyPath supplied for Linux guest — skipping."
return return
} }
$sshOpts = @('-i', $SshKeyPath, '-o', 'StrictHostKeyChecking=accept-new', $sshOpts = @('-i', $SshKeyPath, '-o', 'StrictHostKeyChecking=no',
'-o', 'UserKnownHostsFile=NUL',
'-o', 'ConnectTimeout=10', '-o', 'BatchMode=yes') '-o', 'ConnectTimeout=10', '-o', 'BatchMode=yes')
try { try {
# Collect: journalctl errors, ps, df # Collect: journalctl errors, ps, df