Add an IP blacklist to automatically lock DirectAdmin background

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.