Skip to content

Instantly share code, notes, and snippets.

@vajapravin
Created April 2, 2016 22:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vajapravin/e3d95eefa0156ec51392bcd593dfd418 to your computer and use it in GitHub Desktop.
Save vajapravin/e3d95eefa0156ec51392bcd593dfd418 to your computer and use it in GitHub Desktop.
tail -fn0 /var/log/auth.log | \
while read line ; do
echo "$line" | grep "password check failed for user"
if [ $? = 0 ]
then
echo "Wrong Login Attempt" | mail -s "Login Password Wrong - GigoLinux" vajapravin23@gmail.com
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment