Skip to content

Instantly share code, notes, and snippets.

@foxycode
Created May 17, 2017 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save foxycode/065c0f636c0474aed2e6e6dbfa0a81ab to your computer and use it in GitHub Desktop.
Save foxycode/065c0f636c0474aed2e6e6dbfa0a81ab to your computer and use it in GitHub Desktop.
Get SSHFP records from SSH keys
#!/bin/bash
echo "$(hostname) SSHFP 1 2 $(cut -f2 -d ' ' "/etc/ssh/ssh_host_rsa_key.pub" | base64 --decode | sha256sum | cut -f 1 -d ' ')"
echo "$(hostname) SSHFP 4 2 $(cut -f2 -d ' ' "/etc/ssh/ssh_host_ed25519_key.pub" | base64 --decode | sha256sum | cut -f 1 -d ' ')"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment