How to ban IP address from the server?

How to ban IP address from the server?

Login to the server

su- root

for ip tables –

iptables -A INPUT -s -j DROP

For APF firewall is installed –

apf -d

after rebooting, the ban will be removed and in case if you have APF, to open the deny host files, type in the following –

pico /etc/apf/deny_hosts.rules

At the bottom, put in the IP address, thereafter save changes.

To restart APF,

/etc/apf/apf -r

Latest posts by shane (see all)

Sharing

Leave your comment

Pin It on Pinterest

Shares
Share This

Please Share

Please be social and share this post with your friends!