computing-offload/generic_vdpa/qemu/tests-vm-use-o-IdentitiesOnly-yes-for-ssh.patch
jiangdongxu 79c4324644 add generic_vdpa basecode
Change-Id: I2d302dda68298877c65c99147f5bf22186a59aac
2024-09-19 17:19:46 +08:00

36 lines
1.5 KiB
Diff

From 09ebd704c71b855a1c5732d4e4816aa9aed3fe13 Mon Sep 17 00:00:00 2001
From: jianchunfu <jianchunfu_yewu@cmss.chinamobile.com>
Date: Tue, 22 Nov 2022 16:47:27 +0800
Subject: [PATCH 02/29] tests/vm: use -o IdentitiesOnly=yes for ssh
When one has a lot of keys in ~/.ssh directory, the ssh command will
try all of them before the one specified on the command line, and this
may cause the remote ssh server to reject the connection due to too
many failed authentication attempts.
Fix by adding -o IdentitiesOnly=yes, which makes the ssh client
consider only the keys specified on the command line.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: jianchunfu <jianchunfu_yewu@cmss.chinamobile.com>
---
tests/vm/basevm.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index 254e11c932..4003bc5fef 100644
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -228,7 +228,8 @@ def _ssh_do(self, user, cmd, check):
"-o", "UserKnownHostsFile=" + os.devnull,
"-o",
"ConnectTimeout={}".format(self._config["ssh_timeout"]),
- "-p", str(self.ssh_port), "-i", self._ssh_tmp_key_file]
+ "-p", str(self.ssh_port), "-i", self._ssh_tmp_key_file,
+ "-o", "IdentitiesOnly=yes"]
# If not in debug mode, set ssh to quiet mode to
# avoid printing the results of commands.
if not self.debug:
--
2.27.0