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!

z3us
  • 129
  • 1
  • 3
  • 10
  • Is this a public repo? If so a workaround is to use Github's "Git Read-Only" link (e.g `git://github.com/myuser/myrepo.git`) – dbr Dec 26 '12 at 11:35

2 Answers2

1

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

Community
  • 1
  • 1
Gonen
  • 4,005
  • 1
  • 31
  • 39
0

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.

sti
  • 11,047
  • 1
  • 27
  • 27