Created
June 21, 2018 12:54
-
-
Save bast/0b881f86ce960aba6b173b2e7aed25eb to your computer and use it in GitHub Desktop.
Script to get SSH key fingerprints for a trusted hostname.
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
#!/usr/bin/env bash | |
hostname=$1 | |
echo "SSH key fingerprints for hostname: $hostname" | |
echo "hexadecimal format" | |
ssh-keygen -lf <(ssh-keyscan -t rsa $hostname 2> /dev/null) -E md5 | |
ssh-keygen -lf <(ssh-keyscan -t ecdsa $hostname 2> /dev/null) -E md5 | |
echo "base64 format" | |
ssh-keygen -lf <(ssh-keyscan -t rsa $hostname 2> /dev/null) | |
ssh-keygen -lf <(ssh-keyscan -t ecdsa $hostname 2> /dev/null) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment