# "No ECDSA host key" error connecting to GitHub

**URL:** <https://community.jenkins.io/t/no-ecdsa-host-key-error-connecting-to-github/3652>\
**Category:** Using Jenkins\
**Created:** [September 6, 2022, 4:14pm UTC](https://community.jenkins.io/t/no-ecdsa-host-key-error-connecting-to-github/3652 "2022-09-06T16:14:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![koranke](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/koranke/32/2206_2.png) [@koranke](https://community.jenkins.io/u/koranke)\
**Post date:** [September 6, 2022, 4:14pm UTC](https://community.jenkins.io/t/no-ecdsa-host-key-error-connecting-to-github/3652/1 "2022-09-06T16:14:57Z")

</div>

I realize this may be more of a GitHub question, but I’m confused about how to set up Jenkins to be able to pull from GitHub. I see older instructions for using SSH keys (add deploy key in GitHub for project, add private key in Credentials Manager in Jenkins, use that credential with SSH link to project). However, that doesn’t work. I get an error about “No ECDSA host key”. I saw another post explaining that GitHub no longer allows “git” url connections and that I must use HTTPS, but if I switch the Repository URL in the Jenkins project to the https link, that also doesn’t work, “stderr: remote: Support for password authentication was removed”. The GitHub page that explains the policy change isn’t clear to me in terms of how to get things working with the new restrictions.

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [September 6, 2022, 4:30pm UTC](https://community.jenkins.io/t/no-ecdsa-host-key-error-connecting-to-github/3652/2 "2022-09-06T16:30:27Z")

</div>

> [@koranke](#):
>
> However, that doesn’t work.

“it doesn’t work” is always hard to remote debug. Try to always include these 3 things.

1. what did you try? (Code samples, command lines, screenshots, videos, etc)
2. what did happen? (Error messages, description, outputs, stuff)
3. what did you expect to happen?

Otherwise, it’s hard for us to get into your context and you’ll have to have someone who is exactly knowledgeable come along.

> [@koranke](#):
>
> “stderr: remote: Support for password authentication was removed”.

I think you want to use a personal access token ([Sign in to GitHub · GitHub](https://github.com/settings/tokens)) instead of your password.

> [@koranke](#):
>
> no longer allows “git” url connections

yes, git://github.com no longer works, you need to use ssh ([git@github.com](mailto:git@github.com):repo) or https

---

<div class="post-metadata">

**Author:** ![koranke](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/koranke/32/2206_2.png) [@koranke](https://community.jenkins.io/u/koranke)\
**Post date:** [September 6, 2022, 4:41pm UTC](https://community.jenkins.io/t/no-ecdsa-host-key-error-connecting-to-github/3652/3 "2022-09-06T16:41:28Z")

</div>

Sorry, maybe I misunderstood what is no longer supported in GitHub. If I go to a code repository in GitHub, click on the button for “code”, click on the tab for SSH, should that link work for pulling from Jenkins? If yes, that is what I originally tried, but I get an error about No ECDSA host key. That is, I’m using a link like [git@github.com](mailto:git@github.com):company/repo.git

---

<div class="post-metadata">

**Author:** ![koranke](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/koranke/32/2206_2.png) [@koranke](https://community.jenkins.io/u/koranke)\
**Post date:** [September 6, 2022, 4:50pm UTC](https://community.jenkins.io/t/no-ecdsa-host-key-error-connecting-to-github/3652/4 "2022-09-06T16:50:59Z")

</div>

I did reference the high-level steps, but in more detail…

1. ran ssh-keygen to create public/private key
2. went to github, to the rpo I want to be able to pull from, went to settings and deployment keys.
3. added a deploy key with value of the public key
4. went into Jenkins, manage, credentials.
5. for Jenkins credential, global, added new ssh credential and pasted in the private key
6. went to jenkins project, configuration
7. for source code management, added the github ssh link and selected the jenkins credentials

At this point, see an error about ECDSA.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/jenkins/original/2X/2/2f9403b42a7760609d1004e230741ba83b60e940.png)

---

<div class="post-metadata">

**Author:** ![koranke](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/koranke/32/2206_2.png) [@koranke](https://community.jenkins.io/u/koranke)\
**Post date:** [September 6, 2022, 5:07pm UTC](https://community.jenkins.io/t/no-ecdsa-host-key-error-connecting-to-github/3652/5 "2022-09-06T17:07:37Z")

</div>

Network guy provided the answer. I had to run the following command on the Jenkins server, as the Jenkins user, to get a proper known\_hosts file.

ssh -T [git@github.com](mailto:git@github.com)

After this, restarted Jenkins and it worked fine.

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [September 6, 2022, 5:12pm UTC](https://community.jenkins.io/t/no-ecdsa-host-key-error-connecting-to-github/3652/6 "2022-09-06T17:12:46Z")

</div>

> [@koranke](#):
>
> Jenkins user, to get a proper known\_hosts file.

yea, for future people, thats either [GitHub's SSH key fingerprints - GitHub Docs](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/githubs-ssh-key-fingerprints) or `ssh-keyscan -t rsa github.com` in your known\_hosts file (typically system wide in /etc/ssh)

I’m sorry I should have spotted it easier, but I saw all the comments about depreciated things and got lost.

> <https://serverfault.com/questions/856194/securely-add-a-host-e-g-github-to-the-ssh-known-hosts-file>

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [September 6, 2022, 6:21pm UTC](https://community.jenkins.io/t/no-ecdsa-host-key-error-connecting-to-github/3652/7 "2022-09-06T18:21:18Z")

</div>

Two host keys for [github.com](http://github.com) are included in the [host key verification section](https://plugins.jenkins.io/git-client/#plugin-content-ssh-host-key-verification) of the git client plugin documentation.
