How to block IP addresses

To block an IP address from accessing your server, you use SSH (Secure Shell) to connect as a root user or an account with sudo access.

After you are logged in, run the following command:

iptables -I INPUT -s IP -j DROP

*Replace ‘IP’ with the IP you want to block.