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

Olusiji David October 27, 2018

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

0 votes
Surya Van Lierde November 18, 2020

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
AUG Leaders

Atlassian Community Events