]> gitweb.fluxo.info Git - hydra.git/commitdiff
Adding hydractl ssh-finger with argument support
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 11 Jun 2013 14:19:37 +0000 (11:19 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 11 Jun 2013 14:19:37 +0000 (11:19 -0300)
share/hydractl/ssh-finger

index edc590939ff7691920a4f028f4fbf3296c89e8e2..fac694b6e3e14ab5adcf9db9c8d8a64b68c4cc08 100755 (executable)
@@ -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