summaryrefslogtreecommitdiff
path: root/tools/write-ssh-key-fingerprints
diff options
context:
space:
mode:
Diffstat (limited to 'tools/write-ssh-key-fingerprints')
-rwxr-xr-xtools/write-ssh-key-fingerprints16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/write-ssh-key-fingerprints b/tools/write-ssh-key-fingerprints
index 7b2fc62c..5723c989 100755
--- a/tools/write-ssh-key-fingerprints
+++ b/tools/write-ssh-key-fingerprints
@@ -1,12 +1,28 @@
#!/bin/sh
+fp_blist=",${1},"
+key_blist=",${2},"
{
echo
echo "#############################################################"
echo "-----BEGIN SSH HOST KEY FINGERPRINTS-----"
for f in /etc/ssh/ssh_host_*key.pub; do
[ -f "$f" ] || continue
+ read ktype line < "$f"
+ # skip the key if its type is in the blacklist
+ [ "${fp_blist#*,$ktype,}" = "${fp_blist}" ] || continue
ssh-keygen -l -f "$f"
done
echo "-----END SSH HOST KEY FINGERPRINTS-----"
echo "#############################################################"
+
} | logger -p user.info -s -t "ec2"
+
+echo -----BEGIN SSH HOST KEY KEYS-----
+for f in /etc/ssh/ssh_host_*key.pub; do
+ [ -f "$f" ] || continue
+ read ktype line < "$f"
+ # skip the key if its type is in the blacklist
+ [ "${key_blist#*,$ktype,}" = "${key_blist}" ] || continue
+ cat $f
+done
+echo -----END SSH HOST KEY KEYS-----