Nearly perfect iptables firewall rules for cpanel

in cPanel, Linux / Unix, Networking & Routing, Security, Servers and Hosting

Our network gets a lot of nasty traffic. Namely, was the ftp issue we had on our cPanel servers. We disable ftp and blocked ports 20 to 21. However, it just was not working, even with ftp uninstalled on the server, there was another isntall of pure-ftp that one could telnet into anonymously. So, I put this into the end of our /etc/rc.local file to load with the default firewall on reboot.

If you have any comments on anything I missed, please let me know. Feedback is appreciated!

Putting this into /etc/rc.local will give you outstanding protection against most attacks. I coded this a few months ago and this is the stripped down version. Do not use this with APF or other firewall managers please. This iptables ruleset is for use on a cPanel server and blocks ftp, ssh, WHM and a few other ports from the public. At the bottom you can enter your ip address to whitelist yourself so that only you can access such ports. This is great against brute force attacks and the like.

I also posted this at the site I helped co-found, ABCWebSiteMovers.Com in a text file, becuase WordPress corrupts the code:

http://abcwebsitemovers.com/iptablesCpanel.txt

© 2011, Crackfeed.Com. No reposting authorized.

0 Comments

Leave a Reply

You must be logged in to post a comment.

Using Gravatars in the comments - get your own and be recognized!

XHTML: These are some of the tags you can use: <a href=""> <b> <blockquote> <code> <em> <i> <strike> <strong>