SSH: Help preventing "Too many authentication failures" errors

When an ssh-agent offers many different identities, the maximum
authentication attempts the server permits may be exceeded, resulting in
the above error. With IdentitiesOnly enabled, just the explicitly
specified identities will be used.

Change-Id: Ic10d7032893a38c608989f957b5e91b7dc15c24c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Martin Kampas
2020-10-06 14:56:39 +02:00
committed by Martin Kampas
parent ebb4755753
commit 790a8bc78d

View File

@@ -128,8 +128,10 @@ struct SshConnection::SshConnectionPrivate
"-o", "Port=" + QString::number(connParams.port())};
const bool keyOnly = connParams.authenticationType ==
SshConnectionParameters::AuthenticationTypeSpecificKey;
if (keyOnly)
if (keyOnly) {
args << "-o" << "IdentitiesOnly=yes";
args << "-i" << connParams.privateKeyFile;
}
if (keyOnly || SshSettings::askpassFilePath().isEmpty())
args << "-o" << "BatchMode=yes";
if (sharingEnabled)