As we continue our series on the cPHulk security features, we will show you the steps to blacklist and whitelist IP addresses via SSH. In the last guide we showed you how to blacklist and whitelist IP addresses in the Web Host Manager or WHM. But doing this with command line using SSH can save time since you do not have to go through the WHM interface.
Blacklist IP Address
- Connect to your server via SSH as the ‘root’ user.Â
- Run the following command, but be sure to replace the example IP address (123.45.67.89) with the address you want to blacklist.
/scripts/cphulkdblacklist 123.45.67.89
You will then see a response similar to the following:
123.34.56.78 has been blacklisted
ÂAt this time the IP address has been blacklisted. repeat these steps for any IP addresses you want to blacklist.
Â
Now that you know how to blacklist an IP address via SSH, we will show you how to whitelist IP addresses.
Whitelist IP Address
- Connect to your server via SSH as the ‘root’ user.Â
- Run the following command, but be sure to replace the example IP address (123.45.67.89) with the address you want to whitelist.
/scripts/cphulkdwhitelist 123.45.67.89
You will then see a response similar to the following:
123.34.56.78 has been whitelisted
ÂAt this time the IP address has been whitelisted. repeat these steps for any IP addresses you want to whitelist.
Â
Congratulations, now you know how to whitelist and blacklist IP addresses via SSH!
Secure your websites with our Dedicated Server Hosting and a hardware firewall today.