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

Connect to ssh using bitbucket pipeline

daansk44
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 5, 2019

Hi peeps,

After we went from gitlab to bitbucket I can't really figure out how I can connect to my remote server using SSH. I have added my ssh keys.

This is my bitbucket-pipeline.yml

image: atlassian/default-image:latest

pipelines:
default:
- step:
deployment: staging
script:
- ssh-add ~/.ssh/config
- ssh-add -l
- ls | ssh kkl@flx-xxx.nl -p 4000
- echo "Deploy step finished"

But it returns with 

+ ssh-add ~/.ssh/configssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory

 

image.png

1 answer

0 votes
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 11, 2019

Hello Daan,

The SSH keys are located in /opt/atlassian/pipelines/agent/ssh. This isn't the same location as the home directory (common for other systems). Pipelines should automatically set this up with the SSH client. So, you shouldn't need to use ssh-add before using SSH. But in case you need to do any configuration, the keys are located in /opt/atlassian/pipelines/agent/ssh.

Do you have any success by only running the ls and SSH command?

ls | ssh kkl@flx-xxx.nl -p 4000

Alternatively, you can try out our SSH Pipe. Which handles the client side SSH auth (you'll still need to have it set up properly on the server). Here's some general information on Pipes: https://confluence.atlassian.com/bitbucket/pipes-958765631.html

Thanks,

Phil

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events