You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Bamboo version 8.2.5 build 80211
I cannot not get SCP Task to work, not even once.
on the remote host "someserver55" I generated:
ssh-keygen -t rsa
with a passphrase. (I have also generated another key with no passphrase, same issue).
I upload the private key : choose "Authentication Type: SSH private key"
I include "SSH Passphrase" on the field.
I have tried other remote hosts and same issue eveytime!
"Exhausted available authentication methods.."
28-Sep-2022 11:11:50 Connecting to someserver55 on port: 22
28-Sep-2022 11:11:50 Failed to connect to host
28-Sep-2022 11:11:50 net.schmizz.sshj.userauth.UserAuthException: Exhausted available authentication methods
28-Sep-2022 11:11:50 at net.schmizz.sshj.SSHClient.auth(SSHClient.java:227)
28-Sep-2022 11:11:50 at net.schmizz.sshj.SSHClient.authPublickey(SSHClient.java:342)
28-Sep-2022 11:11:50 at com.atlassian.bamboo.plugins.scp.ScpTask.execute(ScpTask.java:176)
I recreated the PEM key:
ssh-keygen -t rsa -m PEM
Confirmed its in PEM format:
foo: PEM RSA private key
Same issue :(
but this article does not mention the key format requirements (PEM, etc).
After generating the private key on the target server "ssh-keygen -t rsa -m PEM" it created a file that I called "foo". I uploaded this key to bamboo SCP Task, but first I had to change the read permissions to 644 (chmod 644 foo). Else it cant be read by Bamboo. (is this correct?)
Am I suppose to do something after generating the private key besides uploading this "foo" file to bamboo? (no passphrase).
When you create an OpenSSH key pair, two files are generated, one is the private key (foo) and the other is the public key (foo.pub).
Your client (Bamboo) should use the PRIVATE KEY (foo), whilst your target server should have the equivalent PUBLIC KEY (foo.pub) added to its authorization file.
You need to add the contents of foo.pub to your target host's <username>/.ssh/authorized_keys file.
Atlassian Support APAC
I have just done this just now, with and without a passphrase, exact same issue.
I feel like this should not be this difficult and pretty straight forward. I'm not sure what I am missing.
I confirmed that the authorized_keys file does have the foo.pub entry.
Do the permissions on any of the files under "/root/.ssh" matter? (the default perms ok?)
Does it matter that my target host is a Linux box (myLinuxServer ) and the bamboo agent is on a Windows server? ("On agent: someWindowsServer.com" below):
started building on agent someWindowsServer.com (2), bamboo version: 8.2.5
Release: release-1 master
TriggerManual run by Carlo
Completed 03 Oct 2022 10:24 AM
Duration< 1 second
On agent: someWindowsServer.com
Webhooks: No webhooks have been recorded
03-Oct-2022 10:24:30 Connecting to myLinuxServer on port: 22
03-Oct-2022 10:24:31 Failed to connect to host
03-Oct-2022 10:24:31 net.schmizz.sshj.userauth.UserAuthException: Exhausted available authentication methods
Check your target SSH host logs and validate if any message can give you a clue.
I noticed you are using root as the account, OpenSSH does not Allow Root login by default. And you will have to explicitly allow it by setting:
Atlassian Support APAC
Confirmed: PermitRootLogin yes
I ran the deployment and then got the logs
Oct 04 16:31:17 myLinuxServer sshd: error: Could not load host key: /etc/ssh/ssh_host_dsa_key
Oct 04 16:31:17 myLinuxServer sshd: Connection from [someIP] port 22568 on [someIP] port 22
Oct 04 16:31:17 myLinuxServer sshd: Failed publickey for root from [someIP] port 22568 ssh2: RSA SHA256:[random 44 char string here]
"Could not load host key: /etc/ssh/ssh_host_dsa_key" hmmm
Still checking into this...
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
This created two files:
ssh_host_dsa_key (PEM format confirmed)
ssh_host_dsa_key.pub: OpenSSH DSA public key
Reuploaded the priv key to Bamboo (no passphrase)
Appended the ".pub" into /root/.ssh/authorized_keys
Oct 06 11:09:26 myLinuxServer sshd: Failed publickey for root from [someIPaddr] port 22929 ssh2: DSA SHA256:[some random chars]
Welcome to Atlassian Community!
If appears the SSH server is rejecting any authentication tentatives. Are you able to connect to the SSH host by using ssh along with the private key on the command line?
Bamboo expects the Private key to be in PEM format. Did you convert/exported the private key to PEM before importing it on Bamboo? If not please run the following and re-import the private key:
ssh-keygen -p -f /location/of/private_key_file -e -m pem > private_key.pem
Atlassian Support APAC
--please don't forget to Accept the answer if the reply is helpful--