Circle CI how to deploy to ssh - error The authenticity can't be established

Viewed 274

I would like to deploy my code into my server using SSH.

I add ssh key to circle ci settings.

In circle ci pipeline I have code...

scp -q -r /build root@XXXXXXXX:/root/test

problem is, that I have The authenticity of host 'XXXXXXXX (XXXXXXXX )' can't be established. message. How can I skip it or confirm it?

scp -q -r /build root@XXXXXXXX:/root/test
The authenticity of host 'XXXXXXXX (XXXXXXXX )' can't be established.
ECDSA key fingerprint is SHA256:6+xxxx.
Are you sure you want to continue connecting (yes/no)? 

How can I respond to the prompt in a circle ci pipeline job? It is running somewhere on some server.

1 Answers

You are looking for option -o StrictHostKeyChecking=no. Below code should do this. scp -q -r -o StrictHostKeyChecking=no /build root@XXXXXXXX:/root/test

Related