The Road to Elysium

July 8, 2008

ssh-clean-keys

Filed under: Snippets — jorge @ 09:16

Simple lines of code to clean invalid hosts from your .known_hosts-file.

ssh-clean-keys () 
{ 
    for host in $1 $(dig +short $1);
    do
        echo "Cleaning $host";
        ssh-keygen -R $host 2>&1 | sed -e 's,^,I,g';
    done
}

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress