2

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.

Kenster
  • 23,465
  • 21
  • 80
  • 106
javad26897
  • 353
  • 1
  • 4
  • 8
  • Expect will help you out here. https://stackoverflow.com/questions/28461713/how-to-ignore-or-pass-yes-when-the-authenticity-of-host-cant-be-established-i – SteveK Apr 12 '20 at 15:40
  • Use this option https://stackoverflow.com/a/28469910/7822767 – THG Apr 12 '20 at 17:54

1 Answers1

2

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

karikevinod
  • 633
  • 7
  • 16