Issue with atlassian/rsync-deploy:0.5.0
Asked by PINARD_ Alec:

Hi,

So basically, I am trying to do a simple pipeline. I succeed to deploy any update from the master branch to my server through ftp using atlassian/ftp-deploy:0.3.6.

The only thing is that all files are getting uploaded everytime. I would prefer that BitBucket only push the files that have changed. I found that I could use rsync-deploy (let me know if you have any other suggestions).

I am struggling with SSH I think. I followed this : <https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/> and it's not working.

So basically, I did:

**Step 1: Add an SSH key in Bitbucket**

![step1.PNG](/t5/image/serverpage/image-id/156392iF3208B068A334B55/image-size/large?v=v2&px=999 "step1.PNG")

**Step 2: Update the known hosts**

For this step, it's not successful. I got this error message :

![step2.PNG](/t5/image/serverpage/image-id/156394iCD167F53AFC30114/image-size/large?v=v2&px=999 "step2.PNG")

**Step 3: Add the public key to a remote host**

So I copied/pasted the Public key displayed in step 1 (inside the red rectangle)

![step3.png](/t5/image/serverpage/image-id/156395i7CE70D36296E8C2F/image-size/large?v=v2&px=999 "step3.png")

I also authorized the key :

![step4.PNG](/t5/image/serverpage/image-id/156396i7730ADBB9AE16F31/image-size/large?v=v2&px=999 "step4.PNG")

I think it's mandatory that step 2 succeed right ? How should I fix that ?

<br />

Thank you for your help.


Answers:
author: Halyna Berezovska
body: [@PINARD_ Alec](/t5/user/viewprofilepage/user-id/4519681) this is the question to bitbucket , but I will try to help you.

Here in the doc you have explanation for multiple cases.

So your choices:

- either you already have a keypair for your miravo instance and then you create OWN key pair in Bitbucket Keys. This will be if you have, e.g. , if you have ec2 instance.

- you have another server and you want to login over ssh there. I guess it is your case, but here you should check which ssh setup you have on your server. If it cannot verify fingerprint, recheck your ssh config there and try to get fingerprint from server itself. Read more about SSH fingerprint in <https://docs.bmc.com/docs/display/itda27/About+the+SSH+host+key+fingerprint>.

If you still fail with fingerprint, you may try to use rsync deploy with   
\`EXTRA_ARGS: StrictHostKeyChecking=no\`. However, we don't recommend such approach, it is less secure.

Try to fetch the fingerprint for your host on your own (another helpful link: <https://unix.stackexchange.com/questions/126908/get-ssh-server-key-fingerprint>)

and check ssh server is at least up.

By the way, step 3 also seem strange to me, when you copy somewhere your public key to be authorized, you should not have there private ssh key and its passphrase, because private ssh key is stored only at the location to be authorized, not the issuer. This is the goal of private key. Please, explain more, what you do in Step 3, if you have already generated private and public keys at step 1.

However these may be independent failures, let's firstly figure out with ssh fingerprint on your server.

Regards, Galyna

comments: author: PINARD_ Alec
body: Thank you for your answer,

I don't have the time right now to do that but I will definitely take a look at it later today.

Thank you.


author: PINARD_ Alec
body: Is there any BitBucket staff here ? seems like useless otherwise. 17 views and no answer


Tags: bitbucket-pipelines

rsync