How To Prevent Bruteforce And DoS Attacks On CentOS

How To Prevent Bruteforce And DoS Attacks On CentOS

This is part one of the three part tutorial on securing your CentOS server.

1. Bruteforce and DoS Attack Prevention
2. IP Tables Firewall
3. SSH Hardening



Our first step in increasing our security is preventing bruteforce attacks.

First we must install Fail2ban. This bans users that attempt to login to your server without success.

First we must install the Epel Repository

1. rpm -ivh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm

2. rpm -import https://fedoraproject.org/static/0608B895.txt

3. yum install fail2ban

Now we have to edit the configuration file to our needs.

1. vim /etc/fail2ban/jail.conf

ignoreip = 127.0.0.1


bantime = 240


findtime = 240


maxretry = 10


A host will become banned if they reach the "maxretry variable in the fidntime variable. Bantime is the amount of seconds they are banned for.

Now we must start fail2ban

1. service fail2ban start

Now that we have a nice prevention system against basic brute force methods, we are going to block basic DoS attacks.

For this section, we will be using DDoS Deflate.

1. wget http://www.inetbase.com/scripts/ddos/install.sh

2. chmod 0700 install.sh

3. chmod 0700 install.sh

4. ./install.sh

That is it! You are now protected from basic DoS attacks!

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How To Install a LAMP Stack On CentOS 6

How To Install a LAMP Stack on CentOS 6 LAMP stands for Linux Apache MySQL and PHP. It is the...

How To Install OpenSSL On CentOS

How To Install OpenSSL on a CentOS Server First, we want to install OpenSSL 1. yum install...

How To Install OpenVPN on CentOS 6.x

How To Install OpenVPN On CentOS 6.x 32/64 bit OpenVPN is the most commonly used and updated VPN...

How To Setup A Basic IPTables Firewall On CentOS - Section 2

How To Setup A Basic IPTables Firewall On CentOSThis is part two of the three part tutorial on...

How To Harden Your SSH On CentOS

How To Harden Your SSH On CentOSThis is part three of the three part tutorial on securing your...