With GitHub command I have:
ssh -T [email protected] Hi (MyName)! You've successfully authenticated, but GitHub does not provide shell access.
My connection with GitHub is ok (no problem), but with Jenkins I have this error:
ERROR: Error cloning remote repo 'origin' : Could not clone [email protected]:Name-MysRepo/MyRepo.git hudson.plugins.git.GitException: Could not clone [email protected]:Name-MysRepo/MyRepo.git at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.clone(CliGitAPIImpl.java:219) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1001) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:942) at hudson.FilePath.act(FilePath.java:904) at hudson.FilePath.act(FilePath.java:877) at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:942) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1101) at hudson.model.AbstractProject.checkout(AbstractProject.java:1369) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:676) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:581) at hudson.model.Run.execute(Run.java:1575) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:241) Caused by: hudson.plugins.git.GitException: Command "git clone --progress -o origin [email protected]:Name-MysRepo/MyRepo.git /root/.jenkins/jobs/TestKRGDAOV01/workspace" returned status code 128: stdout: Cloning into '/root/.jenkins/jobs/TestKRGDAOV01/workspace'... stderr: Permission denied (publickey). fatal: The remote end hung up unexpectedly
Is this problem with public key?
I use Jenkins
under Tomcat 7
/ Ubuntu 12
.
First, we need to add a Credential option there. For that purpose, we need to click on the Manage Jenkins option. Step 2: Then, a new tab will open. There we need to click on the Manage Plugin option to add the Credential option there.
This error:
stderr: Permission denied (publickey). fatal: The remote end hung up unexpectedly
indicates that Jenkins is trying to connect to github with the wrong ssh key.
You should:
<jenkins user home>/.ssh
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With