got error: Failed to connect to repository : Error performing git command: git ls-remote -h git@mcdasatest07.isd.lacounty.gov:jenkins/ampsoaapplication.git HEAD
when connecting GitLab from Jenkins.
After installed GIT 2.32.0, got error:
Failed to connect to repository: Command “git ls-remote -h [git@mcdasatest07.isd.lacounty.gov]:jenkins/ampsoaapplication.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.
Yes, the documentation applies for GitLab and all other git providers. When the documentation is specific to a git provider, it will list the specific git providers.
Thank you for the reply.
reinstall Git, connecting to Git with Jenkins, got error:
Failed to connect to repository : Error performing git command: git ls-remote -h git@mcdasatest07.isd.lacounty.gov:jenkins/ampsoaapplication.git HEAD
Thank you slide.
Yes, I am able to find set up location.
Allan/Mark - plugins.jenkins.io/git-client page , how could I use this document ? what strategy I can use to configure? My current set up by default Known hosts file.
When I run command (git ls-remote -h [git@mcdasatest07.isd.lacounty.gov]:jenkins/ampsoaapplication.git HEAD) from server, it keep asking me the password and not recognized the password.
You might try this video tutorial from Darin Pope:
The message from command line git indicates that you’re either providing the wrong ssh private key credential or you’re providing a username / password credential instead of providing an ssh private key credential.
The git repository URL git@mcdasatest07.isd.lacounty.gov]:jenkins/ampsoaapplication.git is a URL that tells command line git to authenticate with ssh using an ssh private key. If you’ve not defined an ssh private key credential, then you need to do that. If you’ve defined a username / password credential instead of an ssh private key credential, then you need to change to use https instead of ssh for the git repository URL.
Based on the message from git ls-remote, you don’t need to change the ssh host key verification strategy. It is already working as expected.
If you’re still seeing that message, then you need to adjust your host key verification strategy. The message Host key verification failed means that you do not have a working host key verification strategy because host key verification is failing.
I created a SSH key for another application on my local. Do I need to create another SSH key for this application or I can share the same SSH key with that application.
Is there any meeting discussion in our community? that will be a big help and speed up the issue resolve process.
Appreciate your help.
I created a SSH key for another application on my local. Do I need to create another SSH key for this application or I can share the same SSH key with that application.
Each application need to have it’s own git set up? Please advise.
It is your choice whether you use the same ssh key or a separate ssh key.
The separate ssh key adds some management overhead (need to track it, etc.) but then allows that ssh key to be removed from the account or rotated without breaking any other use of that repository.