Created
October 20, 2013 16:07
-
-
Save Avyd/7071592 to your computer and use it in GitHub Desktop.
Checks SSH logins (Success, Auth_Fail, Etc)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for host in $(cat nodes) | |
do | |
status=$(ssh -l root -o BatchMode=yes -o ConnectTimeout=5 $host 2>&1) | |
if [[ $status != *"Permission denied"* ]] ; then | |
echo "$host - $status" >> Succeeded | |
elif [[ $status == *"Permission denied"* ]] ; then | |
echo $host - $status >> Auth_failed | |
else | |
echo $host - $status >> Etc | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment