Skip to content

Instantly share code, notes, and snippets.

@Avyd
Created October 20, 2013 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Avyd/7071592 to your computer and use it in GitHub Desktop.
Save Avyd/7071592 to your computer and use it in GitHub Desktop.
Checks SSH logins (Success, Auth_Fail, Etc)
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