My Jenkins is hosted on Ubuntu 16. I need to copy some build files from Ubuntu to my Mac machine.
In "execute shell script" I am using following command:
scp -r /home/ben/GIT/dock/MySql ben@ipaddress:/Users/ben/Desktop/MySql
I am able to run the same command from the Ubuntu terminal. But when I execute the same command from Jenkins it shows following error in console output:
Started by user admin
Building in workspace /home/ben/GIT/dock
[dock] $ /bin/sh -xe /tmp/hudson1981676562360554479.sh
+ cd /home/ben/GIT/dock/
+ pwd
/home/ben/GIT/dock
+ scp -r /home/ben/GIT/dock/MySql ben@ip_address:/Users/ben/Desktop/MySql
Host key verification failed.
lost connection
Build step 'Execute shell' marked build as failure
Finished: FAILURE
What is causing this error?