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

Explain about sh?

582


What is the ipconfig command for linux?

516


Why is it called bash?

498


What does make clean command do?

521


Which command will show you free/used memory?

554






What is p command?

565


How use more command in linux?

542


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

525


The command ‘umask -S’

588


How to activate / deploy licence in RHEL 6 and what will happen if you don't activate / deploy licence in RHEL 6 ?

2271


How do I get to root directory in linux?

571


How do I start ms dos?

525


What are the command prompt commands?

520


Explain about lprm job number?

643


What command used for showing user info like Login Name, Canonical Name, Home Directory,Shell etc..?

671