Skip to content

Instantly share code, notes, and snippets.

@a-abella
Last active April 6, 2023 09:54
Show Gist options
  • Save a-abella/9d6c91a56a892e4c74933d17d380aa01 to your computer and use it in GitHub Desktop.
Save a-abella/9d6c91a56a892e4c74933d17d380aa01 to your computer and use it in GitHub Desktop.
Remove all github (v4) from known_hosts
#!/bin/bash
##
## IP list generated from api.github.com/meta .git block , https://gist.github.com/a-abella/fb31a028943b804e8ada6cda4efbe9b6
##
KNOWN_HOSTS_FILE="${1:-"$HOME"/.ssh/known_hosts}"
for entry in github.com $( curl -s https://gist.githubusercontent.com/a-abella/fb31a028943b804e8ada6cda4efbe9b6/raw/1fde650fd0e1005a61439065fdedcafde7730bc0/github_git_ip4.txt) ; do
ssh-keygen -f "$KNOWN_HOSTS_FILE" -R "$entry"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment