summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-06-11 11:19:37 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-06-11 11:19:37 -0300
commit83be2c10f11e8ba6c78d2afa2bc2e43ea68ba97c (patch)
tree41f60d8b14c90f841ab71788e2790e03fa81a0fb
parentfb247bc26059b958d56eaecc7f5df5458b85228f (diff)
downloadhydra-83be2c10f11e8ba6c78d2afa2bc2e43ea68ba97c.tar.gz
hydra-83be2c10f11e8ba6c78d2afa2bc2e43ea68ba97c.tar.bz2
Adding hydractl ssh-finger with argument support
-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