Skip to content

Instantly share code, notes, and snippets.

@MP0w
Created May 12, 2014 07:58
Show Gist options
  • Save MP0w/8f206d153edc0ef36179 to your computer and use it in GitHub Desktop.
Save MP0w/8f206d153edc0ef36179 to your computer and use it in GitHub Desktop.
delete a line in known hosts
knownhosts () {
cp ~/.ssh/known_hosts ~/.ssh/known_hosts_$(date +%Y%m%d-%H%M%S) ;
sed -e "$1d" ~/.ssh/known_hosts > ~/.ssh/known_hosts_new ;
mv ~/.ssh/known_hosts_new ~/.ssh/known_hosts ;
chmod 644 ~/.ssh/known_hosts
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment