From: Silvio Rhatto Date: Tue, 11 Jun 2013 14:19:37 +0000 (-0300) Subject: Adding hydractl ssh-finger with argument support X-Git-Tag: 0.1~14 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=83be2c10f11e8ba6c78d2afa2bc2e43ea68ba97c;p=hydra.git Adding hydractl ssh-finger with argument support --- 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