Git connection to the Jenkins server on Azure: Host key Verification failed

Asked

Viewed 153 times

-1

In the repository in the URL:

git@xxxxx:root/ghnetsoft-utilitario.git

Made this mistake:

Failed to connect to repository : Command "git ls-remote -h git@ xxxxxx :root/ghnetsoft-utilitario.git HEAD" returned status code 128:
stdout:
stderr: Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Imagery:

inserir a descrição da imagem aqui

Successful connection

inserir a descrição da imagem aqui

1 answer

0

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.