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

Why can't I add the bitbucket key to Google Cloud?

Ioana May 30, 2020

In order to push through a pipeline the code to the Google Cloud VM I use the scp command:

scp -r ~/a.txt admin@1x.x.x.x:/home/admin/

When I add the public key (generated on the local machine ) in the user interface : VM instance details -> ssh keys I can use the scp command locally and send data to the server. On the other side if I generate the keys in bitbucket (Repository settings -> SSH ) and I try to add the public key to VM instance details -> ssh keys I get the error:

Invalid key. Required format: <protocol> <key-blob> <username@example.com> or <protocol> <key-blob> google-ssh {"userName":"<username@example.com>","expireOn":"<date>"} 

The bitbucket generated keys do not correspond the requirements of Google cloud.

I also tried to store in Bitbucket the local generated key but the pipeline returns

+ scp -r ~/a admin@x.x.x.x:/home/admin/dist/a
Host key verification failed.
lost connection

Furthermore I see when I store the public key via Google Cloud interface (so the scenario which works, the one in which I transfer files fom the local pc to the cloud) there are 3 new keys added to /home/admin/.ssh two of them different from the actual key I added..

Any ideas how to establish a scp connection between Bitbucket and Google Cloud?

Thank you a lot!

1 answer

0 votes
marvoh May 20, 2021

Hi,

 

Did you manage to resolve this? I am facing the same issue with no resources to help.

 

Kind regards,

M

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events