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

SSH key with passphrase

Justin Jones March 3, 2023

Hi, I am attempting to use atlasian/scp-deploy and my server requires a passphrase for each key. So how do I pass the passphrase programmatically in a deployment pipeline? I am struggling to find an example that shows this usage.

I know that sshpass can be used but I'm not sure that is what the scp-deploy uses. It could certainly use sshpass if a password is set, but that is not a variable in the list of variables.

sshpass -p "password" scp file1.txt root@192.168.1.100:/mnt/

1 answer

1 accepted

1 vote
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 6, 2023

Hi @Justin Jones,

I'm afraid that it is not possible to use the pipe atlasian/scp-deploy with an SSH key that has a passphrase.

Instead of using the pipe, you can use sshpass with scp in the bitbucket-pipelines.yml file of your repo. If the Docker image you are using as a build container doesn't have sshpass or an ssh client, you can add the necessary commands to install them prior to executing the sshpass command. You can also create a custom Docker image that includes these tools and use that as a build container.

If you have any questions, please feel free to let me know!

Kind regards,
Theodora

Justin Jones March 28, 2023

ok

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events