Complete Guide to Blacklist or Whitelist an IP Address via SSH

Complete Guide to Blacklist or Whitelist an IP Address via SSH

At times, you’ll feel the need to blacklist a particular IP address or multiple IP addresses. They may carry out spam attacks on you because of which they’re flagged as dangerous. You can blacklist an IP address via through your Web Host Manager. But that’s also possible through your SSH. After blacklisting, you can whitelist them as and when necessary. In this guide, we explain how to blacklist and whitelist an IP address via SSH.

Blacklisting IP Address Using SSH

To blacklist IP address using SSH, here are the steps involved:

With root credentials, connect to you remote server using the SSH

Use this command while replacing the IP address with the address you want to get blacklisted -
Code:
/scripts/cphulkdblacklist 37.21.75.92
ssh.png


When you see the message that reads “37.21.75.92” has been blacklisted, you’ve successfully blacklisted that IP

You need to repeat the steps for every IP that you want to blacklist. That was all that’s needed to blacklist an IP address.

Whitelisting IP Address Using SSH

To whitelist an IP address with SSH connection, here are the steps involved:

With root credentials, connect to your remote server using SSH

Run this command and replace the IP address with the IP address you want to whitelist -
Code:
/scripts/cphulkwhitelist 37.21.75.92
Repeat the process for as many IP addresses you want to whitelist.

You can follow the process to blacklist that IP address once again if it violates your policies.
Author
kumkumsharma
Views
4,424
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from kumkumsharma

Top