How to block an IP address from accessing my Dedicated server?

In order to block an IP from accessing any service on your Dedicated server, you must first log in the server with the root user via SSH. Then execute the following command:

In the above you must replace IP_ADDRESS with the respective IP that you want to block in the firewall. Then, to save the rule so that it is not lost on restart, use this command:


You need help managing your dedicated server? We got it! SiteGround experts not only write helpful articles, but also manage the servers for our clients so they don’t have to read articles like this one. Learn more.