how do find all failed login attempts via ssh?

Answer Posted / vimal kumar k, technomenace.co

Failed ssh logs are either written in /var/log/messages, or
/var/log/secure (configurable in /etc/syslog.conf). I am
assuming that the failed login attempts are recorded in
/var/log/secure:

grep ' authentication failure' /var/log/secure | sed -e
's/^\(.*\)\(rhost.*\)$/\2/p' | tr -s " " | cut -f2 -d"=" |
cut -f1 -d" " | sort -n | uniq -c

Will show you the count, and the IP/hostname of machines
that tried to access the system via ssh

Is This Answer Correct ?    20 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What commands are used to see all jobs running in the hadoop cluster and kill a job in linux?

543


In order to improve your system’s security you decide to implement shadow passwords. What command should you use?

528


What is the difference between diff and cmp command in unix?

470


Which command will show you free/used memory? Does free memory exist on linux?

558


How do I start ms dos?

525






How do I navigate in cmd?

533


How do you copy in linux terminal?

513


You need to see the last fifteen lines of the files dog, cat and horse. What command should you use?

526


What is option in linux command?

537


Which Command used to lock user password in Linux?

563


What is cmake in linux?

599


What is df command in linux?

536


How do I run bash on windows?

497


What does history command do in linux?

523


What is finger in networking?

533