Introduction
A few months ago, I began seeing our Apache log files fill up with entries, stating: "Failed password for illegal user [username]". Being somewhat alarmed about this I decided to search the Internet to find out if others were experiencing these or similar attacks and to hopefully find a solution.
I did find a lot of information but only a few script-based solutions. Most of the cures included: 1) Moving the ssh port to another number — not much better; 2) Allowing only specific IP addresses — not workable for a road-warrior; 3) Systematically blocking each offending IP address (imagine the eventual buildup). None of these solutions seemed... well... elegant.