Focus on cloud service provider activities
Notes on website operation and maintenance

Linux VPS security setting 3: use DDOS deflate to resist a small number of DDOS attacks

The Internet is rich and colorful, and we can basically find the resources we need, which is why so many friends have joined the ranks of webmasters. There will also be overt and covert fights among many webmasters. In particular, our personal webmaster, due to limited technology and financial resources, is unable to defend against attacks after hard use of the host and VPS, resulting in the suspension of our account and IP suspension from our host or VPS provider. Especially in the VPS hosts we use, because they are consumed according to traffic, after running out of our traffic and encountering a large number of DDOS attacks, we are helpless, including Lao Zuo, who also saw that he had encountered DDOS attacks before.

When encountering these problems, can we handle them in VPS settings? Even a little defense. notice DDOS deflate Scripts can help VPS prevent the attack process. If you encounter a continuous attack from an IP, you can automatically set the IP to an IP blacklist. We can only say that we can give our VPS a little defense.

The first step is installation.

wget http://myvps-scripts.googlecode.com/files/deflate.sh
chmod +x deflate.sh
./deflate.sh

Step 2: Configure the/usr/local/ddos/ddos.conf file.

 ##### Paths of the script and other files PROGDIR="/usr/local/ddos" PROG="/usr/local/ddos/ddos.sh" IGNORE_IP_LIST="/usr/local/ddos/ignore.ip.list" CRON="/etc/cron.d/ddos.cron" APF="/etc/apf/apf" IPT="/sbin/iptables" ##### frequency in minutes for running the script ##### Caution: Every time this setting is changed, run the script with --cron #####          option so that the new frequency takes effect FREQ=1 ##### How many connections define a bad IP Indicate that below. NO_OF_CONNECTIONS=150 ##### APF_BAN=1 (Make sure your APF version is atleast 0.96) ##### APF_BAN=0 (Uses iptables for banning ips instead of APF) APF_BAN=0 ##### KILL=0 (Bad IPs are'nt banned, good for interactive execution of script) ##### KILL=1 (Recommended setting) KILL=1 ##### An email is sent to the following address when an IP is banned. ##### Blank would suppress sending of mails EMAIL_TO="root" ##### Number of seconds the banned ip should remain in blacklist. BAN_PERIOD=600

Label description:

NO_OF_CONNECTIONS=150 # Maximum number of connections. If it exceeds the maximum number, it will be masked. By default
APF_BAN # is 1 by default. It is recommended to use 0 to indicate iptables restrictions
EMAIL_TO="" Fill in the email account, and then some information will be sent to our email
BAN_PERIOD=600 means to limit the IP for 600 seconds

Domain name host preferential information push QQ group: six hundred and twenty-seven million seven hundred and seventy-five thousand four hundred and seventy-seven Get preferential promotion from merchants.
Like( zero )
Do not reprint without permission: Lao Zuo's Notes » Linux VPS security setting 3: use DDOS deflate to resist a small number of DDOS attacks


Scan the code to follow the official account

Get more news about webmaster circle!
Entrepreneurship, operation and new knowledge