Last active
December 16, 2015 07:43
-
-
Save lyndell/c2f53d0c3e3c0e37af70 to your computer and use it in GitHub Desktop.
rmkey
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/bash | |
# | |
# Name: rmkey.sh | |
# Desc: Remove an IP's fingerprint from the SSH known_hosts file | |
# URL: https://gist.github.com/lyndell/c2f53d0c3e3c0e37af70 | |
# | |
# Author: Lyndell Rottmann | |
# WWW: http://Lyndell.US | |
# Copyright (c) 2015 Lyndell Rottmann | |
# | |
# Debug mode on/off: (default off) | |
set +x | |
if [ -z $1 ] | |
then | |
echo "Please provide an IP." | |
exit; | |
else | |
IP=$1 # IP from comand line | |
sed -i -e "/${IP}/D" ~/.ssh/known_hosts | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment