Created
January 15, 2019 10:07
-
-
Save silverbeak/df858fd3ba8f3f491ca57ffc78b7d701 to your computer and use it in GitHub Desktop.
At work, we keep reinstalling our test servers. I use this script to remove outdated known_host keys
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# When the error message says something to the effect of | |
# Offending ECDSA key in /Users/xxx/.ssh/known_hosts:52 | |
# Use the script like this: | |
# > rmhost 52 | |
# to remove line 52 from the known_hosts file | |
# NB! Naturally, make sure to KNOW that the key is ok to be removed. Like the warning says | |
# IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! | |
sed -i "" "${1}d" /Users/kristoferjarl/.ssh/known_hosts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment