Skip to content

Instantly share code, notes, and snippets.

@andrewspiers
Created January 12, 2015 00:01
Show Gist options
  • Save andrewspiers/7c7b09383a959b29005a to your computer and use it in GitHub Desktop.
Save andrewspiers/7c7b09383a959b29005a to your computer and use it in GitHub Desktop.
function to get the fingerprints of remote servers
function ssh-keyscan-fingerprint {
#function to get the fingerprints of remote servers
orig_umask=$(umask)
umask 0077
t=$(mktemp)
chmod 0700 ${t}
while [ ! -z $1 ] ; do
ssh-keyscan "$1" > ${t}
ssh-keygen -l -f ${t}
shift
done
rm $t
umask ${orig_umask}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment