Skip to content

Instantly share code, notes, and snippets.

@iCross
Created March 25, 2023 23:39
Show Gist options
  • Save iCross/930b78b71c04c7e55994cb42b3b6483d to your computer and use it in GitHub Desktop.
Save iCross/930b78b71c04c7e55994cb42b3b6483d to your computer and use it in GitHub Desktop.
ssh-keygen -R github.com
mv ~/.ssh/known_hosts.old /tmp/
http https://api.github.com/meta | jq -r '.ssh_keys[] | ("github.com " + .)' >> ~/.ssh/known_hosts
ssh -vT git@github.com
@iCross
Copy link
Author

iCross commented Mar 28, 2023

brew linux 版:

ssh-keygen -R github.com
mv ~/.ssh/known_hosts.old /tmp/
/home/linuxbrew/.linuxbrew/bin/http https://api.github.com/meta | /home/linuxbrew/.linuxbrew/bin/jq -r '.ssh_keys [] | ("github.com" + .)' >> ~/.ssh/known_hosts
ssh -vT git@github.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment