Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Getting invalid format for the private key when using bitbucket pipeline

Ritesh Kumar
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!
July 21, 2025

actually Deploying SpringBoot to hostinger kvm

using the option for environment creation  by bitbucket  {deploy springboot to aws}

Tested the login, with id_rsa private key which is successful .

But when using the bitbucket pipeline its giving error that is invalid format:

 

scp -i ~/.ssh/id_rsa target/Sri-Ram-Mega-Store-0.0.1-SNAPSHOT.jar user@$EC2_HOST:/Sri-Ram-Mega-Store-new.jar

 

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 23, 2025

Hi Ritesh and welcome to the community!

If I understand correctly, you are using this scp command in your bitbucket-pipelines.yml file in Pipelines, and you get the error that the key is in an invalid format.

I would like to ask a few questions so I can better help you:

  1. Does this Pipelines step with the scp command run on Atlassian's infrastructure, or with one of our self-hosted runners?

  2. If it is running with a self-hosted runner, which type of runner are you using? Linux Docker (x86_64), Linux Docker (arm 64), Windows, MacOS, or Linux Shell runner?

  3. How did you configure the SSH keys for this Pipelines step?
    • Did you do this from Repository settings > SSH keys? If so, did you generate a new SSH key pair from this page, or did you add your own?
    • Did you configure the private SSH key as a variable and then created the id_rsa file from this variable?
    • Or did you do something different?

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events