# Updating GitHub SSH key

**URL:** <https://forum.buildkite.community/t/updating-github-ssh-key/2742>\
**Category:** General\
**Created:** [March 26, 2023, 11:06pm UTC](https://forum.buildkite.community/t/updating-github-ssh-key/2742 "2023-03-26T23:06:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcus](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/marcus/32/1215_2.png) [@Marcus](https://forum.buildkite.community/u/Marcus)\
**Post date:** [March 26, 2023, 11:06pm UTC](https://forum.buildkite.community/t/updating-github-ssh-key/2742/1 "2023-03-26T23:06:27Z")

</div>

On Friday GitHub had to rotate their public SSH key.

> **[We updated our RSA SSH host key](https://github.blog/2023-03-23-we-updated-our-rsa-ssh-host-key/)**
>
> At approximately 05:00 UTC on March 24, out of an abundance of caution, we replaced our RSA SSH host key used to secure Git operations for GitHub.com.

As a result, all Buildkite builds now fail on `git pull`.

```auto
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s.
Please contact your system administrator.
Add correct host key in /c/Users/Bamboo/.ssh/known_hosts to get rid of this message.
Offending RSA key in /c/Users/Bamboo/.ssh/known_hosts:4
RSA host key for github.com has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.

```

How do I go about updating my Buildkite agents to use the new key? The limits of my Buildkite experience are restarting existing builds via the UI, and editing .yml configuration files.

---

<div class="post-metadata">

**Author:** ![james.s](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/james.s/32/1305_2.png) [@james.s](https://forum.buildkite.community/u/james.s)\
**Post date:** [March 26, 2023, 11:17pm UTC](https://forum.buildkite.community/t/updating-github-ssh-key/2742/2 "2023-03-26T23:17:49Z")

</div>

Hello @Marcus!

Thanks for reaching out 👋

With GitHub’s change to their RSA SSH key - any agent that had an existing SSH key created for actioning git workflow commands will need to have their key updated.

Since you mentioned the experience being honed to builds/.ymls, it’ll be more a question on [setting it up](https://buildkite.com/docs/agent/v3/github-ssh-keys)!

---

<div class="post-metadata">

**Author:** ![Marcus](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/marcus/32/1215_2.png) [@Marcus](https://forum.buildkite.community/u/Marcus)\
**Post date:** [March 27, 2023, 12:25am UTC](https://forum.buildkite.community/t/updating-github-ssh-key/2742/3 "2023-03-27T00:25:36Z")

</div>

Thanks - I did this to fix my issues:

- connected to the EC2 instance running the Buildkite agents
- deleted the old GitHub SSH key entries from the `C:\Users\Bamboo\.ssh\known_hosts` file,
- then ran `ssh ` `git@github.com` command to add the new SSH keys to the list of known hosts, after verifying the new keys match those published by GitHub.

---

<div class="post-metadata">

**Author:** ![james.s](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/james.s/32/1305_2.png) [@james.s](https://forum.buildkite.community/u/james.s)\
**Post date:** [March 27, 2023, 2:45am UTC](https://forum.buildkite.community/t/updating-github-ssh-key/2742/4 "2023-03-27T02:45:09Z")

</div>

No worries @Marcus - looks exactly like the process to have done!

Please let us know if any other questions arise 👍
