aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2018-04-03 19:17:56 -0300
committerSilvio Rhatto <rhatto@riseup.net>2018-04-03 19:17:56 -0300
commitaa0e58fb719abf9081179ef122f93a3a11356067 (patch)
treeaa59b3ba862d7443b0fb56d16bd0c151c768f6ad /share
parent3e606f648800335787f48653e59731aabb755d7f (diff)
downloadhydra-aa0e58fb719abf9081179ef122f93a3a11356067.tar.gz
hydra-aa0e58fb719abf9081179ef122f93a3a11356067.tar.bz2
Back to classic ssh-finger method, but with file checking
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydractl/ssh-finger16
1 files changed, 11 insertions, 5 deletions
diff --git a/share/hydractl/ssh-finger b/share/hydractl/ssh-finger
index 0459fdd..2bf784a 100755
--- a/share/hydractl/ssh-finger
+++ b/share/hydractl/ssh-finger
@@ -33,10 +33,16 @@ if [ ! -z "$HOST" ]; then
ssh-keygen -l -f ~/.ssh/known_hosts -F $HOST
elif [ -d "/etc/ssh" ]; then
# Classic
- #for i in /etc/ssh/*.pub; do
- # ssh-keygen -l -f $i
- #done
+ if [ -d "/etc/ssh" ]; then
+ for i in /etc/ssh/*.pub; do
+ if [ -e "/etc/ssh/$i" ]; then
+ ssh-keygen -l -f $i
+ fi
+ done
+ fi
- # Simpler
- ls /etc/ssh/ssh_host_*.pub | xargs -n 1 ssh-keygen -l -f
+ # Simpler, but might trow errors if there's no keys
+ #if [ -d "/etc/ssh" ]; then
+ # ls /etc/ssh/ssh_host_*.pub | xargs -n 1 ssh-keygen -l -f
+ #fi
fi