summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xshare/hydractl/ssh-finger9
1 files changed, 8 insertions, 1 deletions
diff --git a/share/hydractl/ssh-finger b/share/hydractl/ssh-finger
index edc5909..fac694b 100755
--- a/share/hydractl/ssh-finger
+++ b/share/hydractl/ssh-finger
@@ -22,9 +22,16 @@ hydra_config_load
# Command line arguments
BASENAME="`basename $0`"
+HOST="$1"
# Get the fingerprints
-if [ -d "/etc/ssh" ]; then
+if [ ! -z "$HOST" ]; then
+ if [ -f "/etc/ssh/ssh_known_hosts" ]; then
+ ssh-keygen -l -f /etc/ssh/ssh_known_hosts -F $HOST
+ fi
+
+ ssh-keygen -l -f ~/.ssh/known_hosts -F $HOST
+elif [ -d "/etc/ssh" ]; then
for i in /etc/ssh/*.pub; do
ssh-keygen -l -f $i
done