{"id":588,"date":"2011-07-22T08:49:12","date_gmt":"2011-07-22T08:49:12","guid":{"rendered":"http:\/\/blog.nixwind.com\/?p=588"},"modified":"2011-07-22T08:49:12","modified_gmt":"2011-07-22T08:49:12","slug":"install-and-configure-csf-lfd","status":"publish","type":"post","link":"https:\/\/blog.nixwind.com\/?p=588","title":{"rendered":"Install and configure CSF\/LFD"},"content":{"rendered":"<p>CSF is one of the popular firewall which is based on iptables.\u00a0 CSF can be used and managed with UI of control panels like cPanel, DirectAdmin and Webmin. Here we can see how we can install and do basic configuration of CSF ( ConfigServer Security &amp; Firewall ) &amp; LFD ( Login Failure Daemon )\u00a0 on a linux server.<\/p>\n<p><strong>How to install ?<\/strong><\/p>\n<p>For downloading all the csf package.<\/p>\n<p><code># cd \/usr\/local\/src\/<br \/>\n# wget http:\/\/www.configserver.com\/free\/csf.tgz<\/code><\/p>\n<p>Uncompress the packages.<\/p>\n<p><code># tar -xvzf csf.tgz<\/code><\/p>\n<p>Running the installation script<\/p>\n<p><code># cd csf<br \/>\n# sh install.sh<\/code><\/p>\n<p><strong>Configuration<\/strong><\/p>\n<p>a) Main part of configuration is opening up the needed ports<\/p>\n<p style=\"padding-left: 30px;\">below command will give you an idea of\u00a0 current listening ports and processes in the server<\/p>\n<p style=\"padding-left: 30px;\"><code># netstat -pln<br \/>\n# ps aux<\/code><\/p>\n<p style=\"padding-left: 30px;\">find out the ports of services that you want to open and specific them on file \/etc\/csf\/csf.conf with directives<\/p>\n<p style=\"padding-left: 30px; background: #f1f1f1; border: 1px solid;\">TCP_IN\u00a0 &#8212;&gt; incoming TCP ports<br \/>\nTCP_OUT &#8212;&gt; outgoing TCP ports<br \/>\nUDP_IN &#8212;&gt; incoming UDP ports<br \/>\nUDP_OUT &#8212;&gt; outgoing UDP ports<\/p>\n<p>b) Read through the configuration, if you feel everything is okay you can disable testing by setting the first directive on configuration \/etc\/csf\/csf.conf as below<\/p>\n<p style=\"background: #f1f1f1; border: 1px solid; padding-left: 30px;\">TESTING = 0<\/p>\n<p style=\"padding-left: 30px;\">restart csf with<\/p>\n<p style=\"padding-left: 30px;\"><code># csf -r<\/code><\/p>\n<p><strong>Control Panels<\/strong><br \/>\nCSF currently has UI for cPanel, DirectAdmin and Webmin. No specific installation changes required for cPanel and DirectAdmin, once CSF is installed you can view and manage it with cPanel\/DA. You can find webmin CSF module installation instructions <a title=\"Webmin CSF\" href=\"http:\/\/blog.nixwind.com\/minimal-hosting-control-panel-with-webmin\" target=\"_blank\">here.<\/a><\/p>\n<p><strong>Uninstallation<\/strong><\/p>\n<p>On cPanel servers:<br \/>\ncd \/etc\/csf<br \/>\nsh uninstall.sh<\/p>\n<p>On DirectAdmin servers:<br \/>\ncd \/etc\/csf<br \/>\nsh uninstall.directadmin.sh<\/p>\n<p>On generic linux servers:<br \/>\ncd \/etc\/csf<br \/>\nsh uninstall.generic.sh<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CSF is one of the popular firewall which is based on iptables.\u00a0 CSF can be used and managed with UI of control panels like cPanel, DirectAdmin and Webmin. Here we can see how we can install and do basic configuration of CSF ( ConfigServer Security &amp; Firewall ) &amp; LFD ( Login Failure Daemon )\u00a0 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[87],"tags":[83,90],"_links":{"self":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/posts\/588"}],"collection":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=588"}],"version-history":[{"count":4,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/posts\/588\/revisions"}],"predecessor-version":[{"id":595,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/posts\/588\/revisions\/595"}],"wp:attachment":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=588"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=588"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=588"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}