Jenkins returned status code 128 with github

with github command i have

ssh -T
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

  • Should keep merge in the commit history?
  • Working on multiple git branches that are dependent on each other
  • GitHub: Clone succeeded, but checkout failed
  • Visual studio 2010 git extention manage remotes unable to connect
  • How to remove a forked project from my Github profile
  • Unexpected commit hash in a tarball on GitHub
  • ERROR: Error cloning remote repo 'origin' : Could not clone
    hudson.plugins.git.GitException: Could not clone
        at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.clone(
        at hudson.plugins.git.GitSCM$2.invoke(
        at hudson.plugins.git.GitSCM$2.invoke(
        at hudson.FilePath.act(
        at hudson.FilePath.act(
        at hudson.plugins.git.GitSCM.determineRevisionToBuild(
        at hudson.plugins.git.GitSCM.checkout(
        at hudson.model.AbstractProject.checkout(
        at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(
        at jenkins.scm.SCMCheckoutStrategy.checkout(
        at hudson.model.AbstractBuild$
        at hudson.model.Run.execute(
        at hudson.model.ResourceController.execute(
    Caused by: hudson.plugins.git.GitException: Command "git clone --progress -o origin /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

    why this problem with publickey
    I use jenkins under TomCat7 / ubuntu 12
    help please

  • Rename commit message after pushing to github
  • Download single files from GitHub
  • git push asks for username and password when pushed to shared private repository
  • Using Bundler with Git, is https:// or git:// better?
  • Releasing a build artifact on github
  • How does github figure out a project's language?
  • 5 Solutions collect form web for “Jenkins returned status code 128 with github”

    This error:

    stderr: Permission denied (publickey). fatal: The remote end hung up

    indicates that Jenkins is trying to connect to github with the wrong ssh key.

    You should:

    1. Determine the user that jenkins runs as, eg. ‘build’ or ‘jenkins’
    2. Login on the jenkins host that is trying to do the clone – that is, do not login to the master if a node is actually doing the build.
    3. Try you ssh to github – if it fails, then you need to add the proper key to /.ssh

    To check are the following:

    1. if the right public key ( is uploaded to the git-server.
    2. if the right private key (id_rsa) is copied to /var/lib/jenkins/.ssh/
    3. if the known_hosts file is created inside ~/.ssh folder. Try ssh -vvv to see debug logs. If thing goes well, will be added to known_hosts.
    4. if the permission of id_rsa is set to 700 (chmod 700 id_rsa)

    After all checks, try ssh -vvv

    In my case I had to add the public key to my repo (at Bitbucket) AND use git clone once via ssh to answer yes to the “known host” question the first time.

    i had sometime ago the same issue.
    make sure that your ssh key doesn’t have password and use not common user account (e.g. better to user account called jenkins or so).

    check following article

    I deleted my project (root folder) and created it again. It was the fastest and simplest way in my case.

    Do not forget to save all you changes, before you delete you project!

    Git Baby is a git and github fan, let's start git clone.