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

can any one send me one project on linux ...?

2564


How is grep so fast?

753


How many cmd commands are there?

720


Is llvm a virtual machine?

767


How use linux command line?

781


What is the difference between command ‘ping’ and ‘ping6’?

770


What is the difference between find and locate command in linux?

758


Which command is used to compare the files?

756


Explain about system and user utilities?

751


What command is used to check the number of files, disk space, and each user’s defined quota?

758


What is whois command in linux?

781


You issue the command head * what would the resulting output be?

749


What does uname do in linux?

791


How do I navigate in cmd?

723


What is whois command?

787