Bamboo SSH task failing with Exhausted available authentication methods
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
When a user tries to run a build with SSH task on a destination server having SSH version of OpenSSH_8.9p1 using SSH private key as the authentication type, it fails with following error:
"net.schmizz.sshj.userauth.UserAuthException: Exhausted available authentication methods"
Environment
Bamboo 7.X.X or lower.
Diagnosis
The build fails with these errors on Bamboo's Server log
1
2
3
4
5
6
7
8
9
10
11
12
13
14
net.schmizz.sshj.userauth.UserAuthException: Exhausted available authentication methods
at net.schmizz.sshj.SSHClient.auth(SSHClient.java:230)
at net.schmizz.sshj.SSHClient.authPublickey(SSHClient.java:345)
at com.atlassian.bamboo.plugins.scp.SshTask.execute(SshTask.java:103)
at com.atlassian.bamboo.task.TaskExecutorImpl.lambda$executeTasks$3(TaskExecutorImpl.java:323)
at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:258)
at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:323)
at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:118)
at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:73)
at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.executeBuildPhase(DefaultBuildAgent.java:190)
at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:162)
INFO [19-BAM::Default Agent::Agent:pool-39-thread-1] [TransportImpl] Client identity string: SSH-2.0-SSHJ_0.27.0
INFO [19-BAM::Default Agent::Agent:pool-39-thread-1] [TransportImpl] Server identity string: SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.1
Cause
For a successful SSH session, the following stages are necessary to communicate encrypted data effectively. A detailed explanation can be found in The Secure Shell (SSH) Transport Layer Protocol.
TCP Handshake
Identification String exchange
Algorithm negotiation
Key Exchange
Exchange Hash
Encryption keys
Service Request
Secure communication
The second stage involves Identification String exchange where the client sends the SSH Protocol version and software version. For the SSH task to be successful the Bamboo agent which is the client provides its client identity string which is SSH-2.0-SSHJ_0.27.0 while the destination server provides its server identity string which is SSH-2.0-OpenSSH_8.9p1 in this scenario. If the server identity string was SSH-2.0-OpenSSH_8.2p1 or lower, the SSH communication will be successful but SSH-2.0-OpenSSH_8.9p1 will only accept authentication from SSH client using SSH-2.0-SSHJ_0.32.0 or higher which is the client identity string used in Bamboo 8.X.X and higher.
This is due to incompatibility between older client SSH identity string present in Bamboo 7.XX and the newer server SSH identity string present in latest Linux versions.
Solution
Upgrade to Bamboo version 8.X.X and 9.X.X will fix the issue.
Was this helpful?