Reputation: 1
My GitHub ssh key is expired. I tried to update it, which works on GitHub's site, but my laptop just shows me the old RSA fingerprint when I try to push/pull/clone. So currently, my laptop has no access to GitHub now.
There a similar questions on StackOverflow (but they are not covering my case):
When I try to push/pull, following message appears
The authenticity of host 'github.com (140.82.121.4)' can't be established.
RSA key fingerprint is SHA256:xyz/0GFYZ+xPpuxU.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
Hitting yes
results in having no access, because the fingerprint mentioned in the message is expired. Entering a new fingerprint
seems not to work, because the message just appears again.
For sure, I tried to update the ssh key. Undertaken steps:
ssh-keygen -o
~/.ssh/id_rsa
and ~/.ssh/id_rsa
were updatedSHA265:abcdefg name@name-P452USF
~/.ssh/known_host
, because the expired fingerprint is stored here.Rebooting my device does not work too.
Entering the new fingerprint does not work (why?). After hitting [Enter]
the message appears again.
Upvotes: 0
Views: 1623
Reputation: 73
deleted content of
~/.ssh/known_host
, because the expired fingerprint is stored here.
This should usually work (though on my computer the filename is ~/.ssh/known_hosts
with an s
).
However, per the SSH man page there is also a system-wide config file with known host keys:
/etc/ssh/ssh_known_hosts Systemwide list of known host keys. This file should be prepared by the system administrator to contain the public host keys of all machines in the organization. It should be world-readable. See sshd(8) for further details of the format of this file.
If you remove the expired fingerprint from that file as well, does it work?
This command should remove just that fingerprint without affecting other known hosts in the file:
sudo ssh-keygen -f "/etc/ssh/ssh_known_hosts" -R github.com
Upvotes: 1