The irectAdmin panel function is very powerful. Let's take a look at the method of automatically locking the IP blacklist added to the DirectAdmin background. I hope this tutorial will help you, as shown below.
I didn't log on to the management background for a few days. I saw hundreds of messages, which is really annoying. In addition, brute-force password cracking has always been performed on root, admin, and other users. This security issue cannot be ignored. As a result, Google added an IP address lock function to DirectAdmin according to the official method.
First, download the official iptables rules
Cd/etc/init. d # enter the Directory
Mv iptables. backup # back up the original file
Wget http://files1.directadmin.com/services/all/iptables # download the new iptables File
Chmod 755 iptables # Set File Permissions
Restart iptables.
/Etc/init. d/iptables restart
Download and lock the IP script program and set file permissions.
Cd/usr/local/directadmin/scripts/custom
Wget http://files1.directadmin.com/services/all/block_ip.sh
Wget http://files1.directadmin.com/services/all/show_blocked_ips.sh
Wget http://files1.directadmin.com/services/all/unblock_ip.sh
Chmod 700 block_ip.sh show_blocked_ips.sh unblock_ip.sh
Create a configuration text to view the locked IP column
Touch/root/blocked_ips.txt
Touch/root/exempt_ips.txt
With the above operations, you only need to go to the DA panel background-> brute force password cracking monitoring, click the IP address Info at the end of the monitored IP address, and then follow the prompts to isolate the IP address.
To automatically lock the instance, enter the following code:
Cd/usr/local/directadmin/scripts/custom
Wget http://files1.directadmin.com/services/all/brute_force_notice_ip.sh
Chmod 700 brute_force_notice_ip.sh
In addition, in the DA panel background-> administrator settings, perform the following settings in security.
Note:
The above method will cause your machine to fail to ping. If you do not mind this, you can change the configuration in iptable and delete the following two pieces of data to restore the ping.
$ IPTABLES-a input-p icmp-j DROP
$ IPTABLES-a input-p all-j DROP