I wrote a simple script to prevent IP attacks-general Linux technology-Linux programming and kernel information. The following is a detailed description. I wrote a simple script to prevent IP attacks.
I wrote a simple script to prevent IP attacks, which can prevent some minor IP attacks on linux virtual hosts.
The system is based on RHEL's centos, including 3, 4, and 5 versions. Of course, I am also a beginner in shell. There are certainly a lot of stupid methods in the middle, and the results are not necessarily good. Please give us some comments.
Note: This script is based on the server-status of the apache server and the dmesg analysis result of the system. Therefore, non-apache users and friends who have not enabled server-status cannot use this script.
You can set the script to run every minute in the crontab of the server,
Copy the following script to autoblock. sh,
Root User # chmod u + x autoblock. sh