How to Block An IP from Accessing My Linux Server?

How to block an IP from accessing my Linux Server

In this tutorial we will learn how to block an IP or subnet address from your linux server or operating system.
In order to block an IP on Linux, we need to make use of the 'iptables' tool

Step 1. Log into the Linux shell as the root user.

Step 2 Type in the following command :

iptables -A input -s IP.ADD.RE.SS -j drop
service iptables save

Replace IP.ADD.RE.SS with the address you wish to block.

If you wish to unblock an IP address from the server, simply replace 'IP.ADD.RE.SS' with the address you wish to Unblock :

iptables -D input -s  IP.ADD.RE.SS  -j drop
service iptables save
WPOven
© 2024 WPOven Inc. All rights reserved. WPOven® and WordPress® are registered trademarks.
WPOven is the best Managed WordPress hosting for agencies and businesses that want to succeed. With Unlimited sites hosting option, its easy to use and manage, so you can focus on growing your business. 
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram