具体报错如下: + ssh -t -t -i /home/tool/myh.pem centos@52.24.23.121 rm -rf /ROOT/www/vue/static @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. The fingerprint for the ECDSA key sent by the remote host is SHA256:39LQr5vlVre4J5vD3MvJVf5n0t7Aew3bnqGM. Please contact your system administrator. Add correct host key in /var/jenkins_home/.ssh/known_hosts to get rid of this message. Offending ECDSA key in /var/jenkins_home/.ssh/known_hosts:11 remove with: ssh-keygen -f "/var/jenkins_home/.ssh/known_hosts" -R 52.24.23.121 ECDSA host key for 52.24.23.121 has changed and you have requested strict checking. Host key verification failed. Build step '执行 shell' marked build as failure Finished: FAILURE
我的是加上这个就可以了,红色部分:
scp -r -i '/home/tool/myh.pem' -oStrictHostKeyChecking=no /home/tool/myh.pem centos@52.24.23.121:/ROOT/www/xd