Jenkins couldn't clone GIT repository (MacOS X 10.8.2)

System: MacOS, standard Jenkins installation.
I can clone repository from my user. But Jenkins – can’t neither from Git, not from GitHub (my key is added to Git and GitHub). I receive: “stderr: Host key verification failed.”

I’ve copied my key into /Users/Shared/Jenkins/.ssh – but still no luck 🙁 Maybe I’ve copied it to incorrect place?
Generate ssh key from Jenkins is not an option for me.

What am I doing wrong? Thanks in advance!

  • How do I install git-imerge on OS X?
  • Git log --pretty=oneline appears to omit first 2 commits
  • Git and Rails: ignore database.yml
  • Passing variable to command in git filter-branch (when reducing repo size by removing old binaries)
  • Unsync'd Git Repository in Dropbox
  • Git not working on snow leopard
  • Macbook overheat while merging conflicts Android Studio
  • Git commands require sudo on OSX
  • 2 Solutions collect form web for “Jenkins couldn't clone GIT repository (MacOS X 10.8.2)”

    This is usually related to permissions, as Jenkins’ process runs as user ‘jenkins’.

    See here: How to run jenkins as a different user
    especially the answers of Sagar and Peter Tran .

    Cheers

    Like the error says, the problem (at least first) is with host key verification. The first time you connect to an ssh server, ssh client will prompt you to check and accept the host key. (Of course no-one does that, so I don’t know why it bothers…)

    You could

    sudo -u jenkins -i
    

    and then

    ssh git@github.com
    

    and then reply to the prompt. Alternatively you can disable host key checking. Look up StrictHostKeyChecking in man ssh_config.

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