Problem when trying to connect to GitHub from a Windows slave

24 views
Skip to first unread message

Sébastien Hinderer

unread,
May 27, 2019, 10:50:59 AM5/27/19
to jenkins...@googlegroups.com
Dear all,

Recently, I wanted my slaves to fetch our GitHub repository through
authenticated ssh coneections rather than through HTTPS unauthenticated
connections.

I created the appropriate Jenkins credential with ssh keys, replaced the
HTTPS URL of the repo by an ssh-based one and requested the use of the
newly created credential.

On our Unix machines everything works like a charm.

On our Windows machines, though, I get an "invalid format" message while
trying to read a .key file.

In case it's useful, our Windows hosts are running git 2.17.0 and
OpenSSH 7.8p1.

Many thanks in advance for any hint!

Sébastien.

Geoffroy J

unread,
May 27, 2019, 12:18:06 PM5/27/19
to Jenkins Users
Hello

Have you tried cloning manually using the ssh key on windows?

Also, what username have you configured for your git credential on Jenkins?
I faced ssh issues on windows because of change in SSH/GIT and it was necessary to set credential username to 'git' instead of the real github username. See https://issues.jenkins-ci.org/browse/JENKINS-50573

BR

Sébastien Hinderer

unread,
May 27, 2019, 4:32:55 PM5/27/19
to Jenkins Users
Hi,

Many thanks for your response.

Geoffroy J (2019/05/27 09:18 -0700):
> Hello
>
> Have you tried cloning manually using the ssh key on windows?

Yes, and it worked.
Sorry I forgot to mention this.

> Also, what username have you configured for your git credential on
> Jenkins?

The GitHub user name. But the 'git@' part in the URL of the repository.
Additionnally, as I mentionned, this setting works perfectly well for
the Unix machines.

> I faced ssh issues on windows because of change in SSH/GIT and it was
> necessary to set credential username to 'git' instead of the real github
> username. See https://issues.jenkins-ci.org/browse/JENKINS-50573

Thanks! Actually, my GitHub plugin is up-to-date so I'd expect this to
be fixed, right?

Also my error message is different from the one reported in the bug,
mine explicitly mentions an "invalid format" in the keyfile.

But many thanks for helping out, I really appreciate and hope we willl
find the problem!

Sébastien.

Sébastien Hinderer

unread,
May 27, 2019, 4:43:03 PM5/27/19
to jenkins...@googlegroups.com
Hello David,

Many thanks for your response!

eyal david (2019/05/27 18:37 +0300):
> Hi
> Try to recreate new keys from the windows slave using the git bash ...

What do you mean by git bash ?

> than create credentails id in jenkins master based on the your private key
> created on the windows slave

And hten of course the public key needs to be added on GitHub. Well
since the manual clone worked I'm a bit reluctant to do all this, I have
to say.

Sébastien.
Reply all
Reply to author
Forward
0 new messages