GIT jenkins integration issues -Permission denied(Public Key)

2,170 views
Skip to first unread message

jaychandran subramanian

unread,
Jan 13, 2020, 11:43:38 PM1/13/20
to Jenkins Users
Hi ,

While integrating GIT and Jenkins , getting the below error .

Failed to connect repository : Command "git ls-remote -h git@remote-server:/home/fab.git HEAD" returned status code 128.

stderr:git@ip Permission denied (Public Key)


Kindly let us know the resolution .

Thanks
Jay

Mark Waite

unread,
Jan 14, 2020, 12:32:53 AM1/14/20
to Jenkins Users
The message means that the remote repository is secured by a private key and will be cloned using the git ssh protocol.  That private key needs to be defined in a Jenkins credential and the credential needs to be used in the Jenkins job definition.

Jenkins credentials are best maintained by the Jenkins credentials plugin.

Some of the possible failure modes include:
  • No credential assigned to the repository in the Jenkins job definition
  • Wrong private key credential assigned to the repository in the Jenkins job definition
  • Wrong type of credential assigned to the repository in the Jenkins job definition.  A username / password credential will not work with ssh clone of a git repository.  The credential must be a private key credential
  • No passphrase provided in the Jenkins credential definition for a private key that is secured with a passphrase
  • Wrong passphrase provided in the Jenkins credential definition for a private key that is secured with a passphrase
  • Private key type (for example ed25519) not supported by the remote ssh server (possibly due to a very old OpenSSH implementation on the remote server)
I'm sure there are other failure modes, but those are the types of failure modes that I've seen in the past.

If you've checked all those failure modes and verified that they are not the issue, then you might use the diagnostic instructions at https://support.cloudbees.com/hc/en-us/articles/115000618372-How-to-trace-git-connections- to investigate more deeply.


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b4f8aba5-f0bb-46b7-8246-f2ee1413ce71%40googlegroups.com.


--
Thanks!
Mark Waite
Reply all
Reply to author
Forward
0 new messages