qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: "Ilya Leoshkevich" <iii@linux.ibm.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Beraldo Leal" <bleal@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH] tests/vm: use -o IdentitiesOnly=yes for ssh
Date: Thu, 27 Oct 2022 14:19:15 +0200	[thread overview]
Message-ID: <e52e6240-00c0-c6ee-7cb6-fbd7073f5315@redhat.com> (raw)
In-Reply-To: <20221027113026.2280863-1-iii@linux.ibm.com>

On 27/10/2022 13.30, Ilya Leoshkevich wrote:
> 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>
> ---
>   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 4fd9af10b7f..2276364c42f 100644
> --- a/tests/vm/basevm.py
> +++ b/tests/vm/basevm.py
> @@ -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:

Ah, great, I've run into this problem in the past already, too, but I didn't 
find that config switch! Good to know that there is a solution!

Reviewed-by: Thomas Huth <thuth@redhat.com>



  reply	other threads:[~2022-10-27 12:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-27 11:30 [PATCH] tests/vm: use -o IdentitiesOnly=yes for ssh Ilya Leoshkevich
2022-10-27 12:19 ` Thomas Huth [this message]
2022-10-27 15:48 ` Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e52e6240-00c0-c6ee-7cb6-fbd7073f5315@redhat.com \
    --to=thuth@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=bleal@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=iii@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wainersm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).