Skip to content

Instantly share code, notes, and snippets.

@ryanmaclean
Created May 19, 2016 00:06
Show Gist options
  • Select an option

  • Save ryanmaclean/cb7da53fb2f8140800bef704654e5a3a to your computer and use it in GitHub Desktop.

Select an option

Save ryanmaclean/cb7da53fb2f8140800bef704654e5a3a to your computer and use it in GitHub Desktop.
Remove an Entry From known_hosts
#!/bin/bash
# Replace '1d' with the offending line number, for example '10d' would be for the 10th line
# The line number is the number after ":" in your warning, for example:
# "Offending ECDSA key in /home/root/.ssh/known_hosts:10"
sed -i '1d' ~/.ssh/known_hosts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment