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

Do i need convert generated key (ssh-keygen RSA PRIVATE KEY ) to another format in Bitbucket ?

In pipeline i got this error -

 

(umask 077 ; echo $PREPROD_SSH_KEY | base64 --decode > ~/.ssh/id_rsa)base64: invalid input

variable $PREPROD_SSH_KEY contains RSA PRIVATE KEY in format

-----BEGIN RSA PRIVATE KEY-----

key body

-----END RSA PRIVATE KEY-----

3 answers

1 accepted

In that way i dont have access to private key , but i need it either.

problem solved, i created new key with these options :

ssh-keygen -t rsa -b 4096 -N  -f bitbucket_key2021

 

call from bitbucket-pipelines.yml

- (umask 077 ; echo $STAGE_SSH_KEY | base64 --decode > ~/.ssh/id_rsa)

- chmod 400 ~/.ssh/id_rsa

- export SSHPASS=$(~/.ssh/id_rsa)

- sshpass -e ssh -o stricthostkeychecking=no $USER@$REMOTE_IP "echo Ok"

What are you trying to do? Create a key to be used with Pipelines?

 

Did you do this in the UI? 

2021-08-06_17-11-05.png

(I'm not great with Pipelines but been using it all day, figured I'd ask...)

I have created keys in different ways -

ssh-keygen -t rsa -b 4096 -m pem -C your_email@example.com

or convert my previous key

openssl pkcs8 -topk8 -v2 des3 -in ./my_key -out ./encrypted_my_key

Suggest an answer

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

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

209 views 2 5
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