Failed to connect to repository : Command "git ls-remote -h git@ip:xxx.git HEAD" returned status code 128:
stdout:
stderr: Host key verification failed.
這需要使用jenkins用戶訪問(wèn)該git服務(wù)器添加到~/.ssh/known_hosts。
1.切換為jenkins用戶:
sudo su -s /bin/bash jenkins
2.執(zhí)行g(shù)it命令:
git ls-remote -h git@ip:xxx.git HEAD
在終端提示如下:
The authenticity of host 'ip (xxx.xxx.xxx.xx)' can't be established.
RSA key fingerprint is 84:8c:14:f2:6f:14:6d:6c:3b:fc:ac:49:a6:7c:7a:41.
Are you sure you want to continue connecting (yes/no)?
輸入yes回車(chē)。這時(shí),ip就已經(jīng)添加到~/.ssh/known_hosts。