How-to block ssh attacks, automatically

Finally there’s an easy, automatedand a distributed method of stomping those annoying automated ssh attacks Every system admin can tell you from their sys logs that they’re getting hit hundreds or thousands of times a day. There’s no end to the number of people trying to break into your machine through ssh. Most of the time the attacker is using known system account and weak dictionary passwords. It’s always annoyed me to no end that ssh is “secure” as in encrypted, but boy is it targeted. Over the last few months I’ve decided to do something about it. I first tried a script called knock that adds to ipchains. But it never did quite work for me. There were all sorts of scripts that will automatically add entries (ip of the attacker) to hosts.deny. The one I finally chose is denyhosts at http://www.denyhosts.net. This little script is awesome!!! It can be configured to run as a daemon. There’s loads of options and it works!!! It’ll even upload the results on your box to a central server, then distribute the results out to any of the servers that want the central list for blocking. I checked it out last night and within a hour I had it configured and running on all my servers. Even the old Fedora Core 3 still kickin.  HaHa! I don’t know how long this will work, but right now I’m loving it. You know that it’s only a matter of time with dic attacks. If you’re the admin of even one live server in the wild you owe it to yourself to check it out. The included README.txt explains all the setup params. Check this out, I can’t say enough good about. I’m hoping tonight I’ll see a significant decrease of failed logins reported.

2 Responses to “How-to block ssh attacks, automatically”

  1.  Kelly Says:

    Hi Jon! I can see that your blog has actual important information to share with people, whereas my blog consists mostly of me musing over movies and boogers, but it’s always good to meet a fellow blogger anyway.

    And besides, you fixed my computer so you’re forever my hero. Thank you. It works great, and I downloaded the antivirus software, and so far (it’s been about an hour), I haven’t received one virus!

    It was really nice meeting you, too. Even IF my dogs didn’t like you. :o)

  2.  rjmolesa Says:

    Thanks, I try to help where I can. I checked out your blog and perhaps you can get back into it when time allows and the desire returns. Thanks for checking me out.

Trackbacks

Leave a Reply


Creative Commons License
This work is licensed under a Creative Commons Attribution-NoDerivs 2.5 License.