Skip to content

Instantly share code, notes, and snippets.

@bast
Created June 21, 2018 12:54
Show Gist options
  • Save bast/0b881f86ce960aba6b173b2e7aed25eb to your computer and use it in GitHub Desktop.
Save bast/0b881f86ce960aba6b173b2e7aed25eb to your computer and use it in GitHub Desktop.
Script to get SSH key fingerprints for a trusted hostname.
#!/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