In your scenario you have Jenkins trying to make a git-ls
on some Git server (which you have placed xxxxxx
to hide which in your question).
Probably this mistake:
stderr: Host key verification failed.
IS because "under the covers" git is giving an error asking for confirmation if your repository xxxxxx
is a known server. For example, let’s imagine that the xxxxxx
is the Github.
If you log in with the Jenkins user and directly execute the following command (by switching the xxxxxx
by your git server, obviously):
git ls-remote -h [email protected]:root/ghnetsoft-utilitario.git HEAD
It should generate a warning similar to this:
The authenticity of host 'xxxxxxx (127.0.0.1)' can't be established.
RSA key fingerprint is 97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40.
Are you sure you want to continue connecting (yes/no)?
Choosing yes
should solve, because then it will add the github.com
to the archive ~/.ssh/known_hosts
.
Another alternative is you use this command to achieve the same objective:
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts