문제

I have a bash script, amongst other things, attempts to SCP a file from current host (Windows/Cygwin) to a remote host (Suse).

When I run the script in Cygwin myself, the script performs perfectly. Transfers the file via SCP, then SSH to the remote machine to run some further commands (to do with deploying the file to application server).

When the script is run by Maven as part of a Jenkins CI build it fails with an error about the key pair being rejected.

From the Jenkins job log:

Host key verification failed.
lost connection
도움이 되었습니까?

해결책

Let your job run once with StrictHostKeyChecking:

scp -o 'StrictHostKeyChecking no' ...

This will log something like:

Warning: Permanently added '<host>, <ipaddr>' (<keytype>) to the list of known hosts.

After that, remove the StrictHostKeyChecking.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top