Skip to content

Commit

Permalink
tests/vm: use -o IdentitiesOnly=yes for ssh
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20221027113026.2280863-1-iii@linux.ibm.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20221027183637.2772968-31-alex.bennee@linaro.org>
  • Loading branch information
iii-i authored and stsquad committed Oct 31, 2022
1 parent 68406d1 commit 339bf0c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/vm/basevm.py
Expand Up @@ -233,7 +233,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:
Expand Down

0 comments on commit 339bf0c

Please sign in to comment.