run-vm.sh: fix SSH auth error due to agent keys

Even when an identity file (i.e. a private key) is specified, SSH
tries all keys loaded by the SSH agent first for authentication
(if an agent is running).

When the agent returns many keys this can lead to a "Too Many Failures"
auth error, because none of the agent keys are accepted by the VM SSH
server.

Fix this by only using the provided key.
This commit is contained in:
Erik Arvstedt
2026-02-06 20:07:28 +01:00
parent 5b532698ce
commit f5b2e5eb9f
+1 -1
View File
@@ -41,7 +41,7 @@ vmWaitForSSH() {
# Run command in VM # Run command in VM
c() { c() {
ssh -p "$sshPort" -i "$identityFile" -o ConnectTimeout=1 \ ssh -p "$sshPort" -i "$identityFile" -o IdentitiesOnly=yes -o ConnectTimeout=1 \
-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR \ -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR \
-o ControlMaster=auto -o ControlPath=$tmpDir/ssh-connection -o ControlPersist=60 \ -o ControlMaster=auto -o ControlPath=$tmpDir/ssh-connection -o ControlPersist=60 \
root@127.0.0.1 "$@" root@127.0.0.1 "$@"