On occasion when I inspect my server security logs I see hundreds of failed password attempts on ssh, guessing at user names, yadda yadda. I never have to worry about them getting in as root 'cause I have that blocked. I normally login as me and do su if needed, and most of my other user names are hokey enough to not just guess.
Of course when I see this I send a note to iptables to block the offending IP, but this is always after the fact and the person may never come back to try again. I am wondering if there is some option or some kind of script or something that can know if the same IP has tried to login more than X amount of time within Y minutes if it can automatically add the IP to the blocked list.
I want the timer on there only so it isn't cumulative over considerable time and I don't eventuallly lock myself out from entering my own password wrong enough times...
Anything would be easier than having to find all these and enter them in by hand all the time.
Thanks in advance.
Of course when I see this I send a note to iptables to block the offending IP, but this is always after the fact and the person may never come back to try again. I am wondering if there is some option or some kind of script or something that can know if the same IP has tried to login more than X amount of time within Y minutes if it can automatically add the IP to the blocked list.
I want the timer on there only so it isn't cumulative over considerable time and I don't eventuallly lock myself out from entering my own password wrong enough times...
Anything would be easier than having to find all these and enter them in by hand all the time.
Thanks in advance.