Skip to content
Snippets Groups Projects
Commit 29113f30 authored by nimrod's avatar nimrod
Browse files

ssh-forget-host script.

parent 08c95c68
Branches
No related tags found
No related merge requests found
#!/bin/sh
set -eu
usage () {
echo "Usage: $0 HOST"
exit 1
}
remove () {
until [ -z "$(ssh-keygen -R "$1" 2>/dev/null)" ]
do
true
done
}
if [ "$#" -ne 1 ]
then
usage
fi
host="$1"
for i in "$host" $(dig +short "$host")
do
remove "$i"
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment