Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Permission denied (publickey,password) error on SSH access for Bitbucket pipeline on remote server.

I've been banging my head on this issue for  a few days now.

I am running a Linux Ubuntu on a digital ocean server.

Here is my bitbucket-pipelines.yml

image: php:7.1.1


pipelines: branches:

master:

- step:

    deployment: staging

    caches: - composer

    script: - apt-get update -y

              - apt-get install -y ssh

              - cat ./deploy.sh | ssh username@XXX.XX.XXX.XXX

              - echo "Deploy step finished"

 What I've tried so far.

  1. Generating an ssh key directly via the pipelines SSH key settings, and copying the public key to the remote server
  2. Generating a key pair and adding it to the bitbucket pipeline SSH Key.

Both of these do not work and I get an error, Permission denied (publickey,password).

 

I've run this command ssh-add ~/.ssh/<private_key_file> on my remote server to add private key to ssh agent

When I run the command ssh -T git@bitbucket.org I am able to login to bitbucket.

I'm not sure what I'm doing wrong.

1 answer

According to Bitbucket, your should add your public key (which you can generate on Bitbucket) in 

~/.ssh/authorized_keys

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,734 views 10 16
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you