Today I Learned

hashrocket A Hashrocket project

Remove SSH keys from known host file by IP address

Github had a situation which caused the need to potentially remove Github's keys from your known_hosts file.

This can be done easily with the SSH command:

ssh-keygen -R

This is great... except when it isn't. I specifically ran into an issue where my connection was trying to utilize specific github IP addresses. Have no fear... it turns out that the same command can be utilized.

ssh-keygen -R

I actually had to do a few of them

ssh-keygen -R


You could potentially use github's meta information endpoint to find address ranges, but that's a problem for a more clever person.

See More #command-line TILs