Skip to content

Instantly share code, notes, and snippets.

@alepez
Created May 17, 2013 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alepez/5597748 to your computer and use it in GitHub Desktop.
Save alepez/5597748 to your computer and use it in GitHub Desktop.
remove ssh known host key
function ssh-known-hosts-rm { sed -i -e "$( ssh $@ -o StrictHostKeyChecking 2>&1 | grep Offending | sed 's/.*:\([0-9]\+\).*/\1/' )d" .ssh/known_hosts }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment