You can delete unauthorized (or possibly compromised) SSH keys to ensure that an attacker no longer has access to your repositories. You can also approve existing SSH keys that are valid.
-
In the upper-right corner of any page on GitHub, click your profile picture, then click Settings.
-
In the "Access" section of the sidebar, click SSH and GPG keys.
-
Under "SSH keys", take note of the SSH keys associated with your account. For those that you don't recognize, or that are out-of-date, click Delete. If there are valid SSH keys you'd like to keep, click Approve.
Note
If you're auditing your SSH keys due to an unsuccessful Git operation, the unverified key that caused the SSH key audit error will be highlighted in the list of SSH keys.
-
Open Terminal.
-
Start the ssh-agent in the background.
$ eval "$(ssh-agent -s)" > Agent pid 59566Depending on your environment, you may need to use a different command. For example, you may need to use root access by running
sudo -s -Hbefore starting the ssh-agent, or you may need to useexec ssh-agent bashorexec ssh-agent zshto run the ssh-agent. -
Find and take a note of your public key fingerprint.