Automatic firewall script for csf (Linux)

This is the place to go if you need advice on customizing or integrating your GSP-Panel installation.
Post Reply
Posts: 4
Joined: Tue Oct 11, 2016 12:27 pm

Automatic firewall script for csf (Linux)

Post by Dagunchi »

ATTENTION: This script will overwrite your /etc/csf/, because it uses it, you can add to this script all exiting lines by sed or some other ways!!!

I wanted to share my firewall script what I use with csf, gsp-panel and multicraft. Use at your own risk, no support and no upgrades. It is as it is. This script automatically opens the ports in csf firewall and plus some iptables rules to increse security for like dos. udp floods and etc., not fully tested, but should work ok, because I using it at this moment for my dedicated server and already some time. Basic feature that you do not need to open or close ports in csf firewall manually when adding new server or deleting some server and many hacks are prevented from users to server via iptables. This script doing it by self.

1. It should be added to cron job - better to run every 10 or 5 minutes
2. If you do not want to modify anythink then just copy this file to /opt/Scripts
3. If you do not have multicraft then you need delete some lines from script or will be errors (Please find by self)
4. On your linux server should be installed csf firewall
5. This script uses pid file to check if all is ok for every run
6. This script use /etc/csf/ (Should be manually created plain text file (Linux conversion))

P.S. Do not forget leave my credits. Happy using.
(2.37 KiB) Downloaded 838 times
Post Reply