Block SSH Server Attacks (Brute Force Attacks) Using DenyHosts

If you have any questions or problems regarding this article and want help within 24 Hours? Ask Now

Support TecMint: Did you find this tutorial helpful?. Please help to keep it alive by donating. Every cent counts! - Donate Now

Ravi Saive

Simple Word a Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

Receive Your Free Complimentary eBook NOW! -

Download Free Linux eBooks

Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Introduction to Linux - A Hands on Guide

You may also like...

14 Responses

  1. Chacko Abraham says:

    Hi All

    Can we block multiple services on denyhosts like BLOCK_SERVICE = sshd,proftpd and also can these block public IP’s as well.


    • Ravi Saive says:

      Using DenyHosts, you can only block SSH attacks, but if you want to block other services such as ftp, mail, etc, you can use xinetd functionality called hosts.deny.

  2. Fahad Rafiq says:

    Password crackers are using automated scripts to target websites to hack the passwords and Brute Force Attacks have become a common thing, but many don’t know the concept behind it and how these attacks are so successful at cracking the passwords of the websites.

    The easiest method to block such attacks is by blacklisting the IPs that carry out such abuses, many hosting providers have added Brute Force Attacks protection in their added security features.

    For more information about these attacks read:

  3. Shaun says:

    Thank you!

  4. Mohammad Farooque says:

    HI All,

    Every day morning iptables rules would be automatically flushed. I dont know how,,,

    Please help me to resolve this issue.

  5. No denyhosts available in EPEL for RHEL7/CentOS7 yet.

  6. cosgunvistas says:

    Very Nice article. I have one suggestion. This article work just fine for Ubuntu 12.04 Server, except installation which can be done with

    sudo apt-get install denyhosts

    So i recomment just add Ubuntu to the list. And add the installation method.

  7. ashutoshh says:

    great work…

  8. Bharath says:

    Hi, am using CentOS release 5.7 (Final), i can’t install denyhosts with yum, provided i have enabled epel repo and logged in as root.

    when i run #yum install denyhosts

    it gives,
    “Setting up Install Process
    No package denyhosts available.
    Nothing to do”

    what is the problem here. pls advice.

  9. Rifat Rahman says:

    It works nice. Played with the thing and it is fantastic for ssh securities.. Thanks for keeping all things at one place.

  10. I do trust all of the concepts you’ve offered to your post. They’re really convincing and will certainly work. Still, the posts are too brief for newbies. May you please prolong them a bit from next time? Thanks for the post.

Leave a Reply

Your email address will not be published. Required fields are marked *

Join Over 95000+ Linux Users
  1. 66,682
  2. 3,836
  3. 31,647

Enter your email to get latest Linux Howto's