Permission denied when accessing EC2 instance

I am having a similar problem, but no passphrase is being asked for:

$ ssh -i elasticbamboo.pk ec2-user@ec2-54-234-XXX-XXX.compute-1.amazonaws.com
The authenticity of host 'ec2-54-234-78-100.compute-1.amazonaws.com (54.234.XXX.XXX)' can't be established.
RSA key fingerprint is a3:37:bf:ac:fc:e3:28:8e:34:75:53:f5:e2:5a:de:f7.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ec2-54-234-XXX-XXX.compute-1.amazonaws.com,54.234.XXX.XXX' (RSA) to the list of known hosts.
Permission denied (publickey).

4 answers

0 votes

Looks like a key mismatch, maybe someone else regenerated that key on your acount. The resolution is the same - just delete the key pair (or find someone who regenerated it).

How do I delete the key pair? I have deleted the instance and created a new one over and over. I have also changed the configuration to use custom private key and certificate, but still that does not work.

I was refering to Bamboo Admin -> Elastic Bamboo -> Configuration -> AWS Credentials Management

I uploaded both X509 files but that didn't change anything.

I've also tried to ssh with ec2-user, root and bamboo users, but I always get the same error:

$ ssh -i elasticbamboo.pk ec2-user@ec2-50-16-84-24.compute-1.amazonaws.com
Permission denied (publickey).

0 votes

You can't delete the keypair from Bamboo. You have to access AWS console.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Monday in Jira Ops

Jira Ops Early Access Program Update #1: Announcing our next feature and a new integration

Thanks for signing up for Jira Ops! I’m Matt Ryall, leader for the Jira Ops product team at Atlassian. Since this is a brand new product, we’ll be delivering improvements quickly and sharing updates...

304 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you