Skip to content

Instantly share code, notes, and snippets.

@b4hand
Last active December 3, 2015 19:50
Show Gist options
  • Select an option

  • Save b4hand/02c2fff11363833c1ae5 to your computer and use it in GitHub Desktop.

Select an option

Save b4hand/02c2fff11363833c1ae5 to your computer and use it in GitHub Desktop.
Clears out old ssh keys in ~/.ssh/known_hosts
#!/usr/bin/env bash
hostname=$1
ip=`host $hostname | head -1 | awk '{print $4}'`
ssh-keygen -R $hostname
ssh-keygen -R $ip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment