{"id":230,"date":"2016-02-25T11:55:07","date_gmt":"2016-02-25T16:55:07","guid":{"rendered":"http:\/\/underhost.com\/blog\/?p=230"},"modified":"2025-03-15T04:46:33","modified_gmt":"2025-03-15T08:46:33","slug":"how-to-install-and-configure-csf-firewall-on-your-server","status":"publish","type":"post","link":"https:\/\/underhost.com\/blog\/how-to-install-and-configure-csf-firewall-on-your-server\/","title":{"rendered":"How to Install and Configure CSF Firewall on Your Server"},"content":{"rendered":"<h3>Step 1: Download the CSF Package<\/h3>\n<p>Log in to your server via SSH and retrieve the package files using the following command:<\/p>\n<pre class=\"bash\">wget https:\/\/download.configserver.com\/csf.tgz<\/pre>\n<h3>Step 2: Unpack the Archive<\/h3>\n<p>Extract the downloaded CSF package:<\/p>\n<pre class=\"bash\">tar xfz csf.tgz<\/pre>\n<h3>Step 3: Navigate to the CSF Directory<\/h3>\n<p>Move into the extracted CSF directory:<\/p>\n<pre class=\"bash\">cd csf<\/pre>\n<h3>Step 4: Run the Installer<\/h3>\n<p>Execute the installation script:<\/p>\n<pre class=\"bash\">sh install.sh<\/pre>\n<p>Once installed, CSF will be in <strong>Test Mode<\/strong> by default.<\/p>\n<p>&#8212;<\/p>\n<h3>Step 5: Disable CSF Testing Mode<\/h3>\n<p>To fully enable CSF, you need to disable Test Mode. Follow these steps:<\/p>\n<ul>\n<li>Log in to <strong>WHM<\/strong> and go to <strong>ConfigServer Security &#038; Firewall<\/strong>.<\/li>\n<li>Open <strong>Firewall Configuration<\/strong>.<\/li>\n<li>Change <code>TESTING = \"1\"<\/code> to <code>TESTING = \"0\"<\/code>.<\/li>\n<li>Click <strong>Save<\/strong> and restart CSF.<\/li>\n<\/ul>\n<p>&#8212;<\/p>\n<h3>Managing IP Addresses in CSF<\/h3>\n<p>You can manually allow or block specific IP addresses using the following SSH commands:<\/p>\n<h4>Allow an IP Address<\/h4>\n<pre class=\"bash\">csf -a 136.1.1.105<\/pre>\n<h4>Block an IP Address<\/h4>\n<pre class=\"bash\">csf -d 136.1.1.105<\/pre>\n<p>&#8212;<\/p>\n<h3>Need Help with CSF Firewall?<\/h3>\n<p>If you need assistance configuring your firewall, <a href=\"https:\/\/customerpanel.ca\/client\" target=\"_blank\">@CustomerPanel<\/a> is available 24\/7. For secure and optimized server management, explore our <a href=\"https:\/\/underhost.com\/dedicated-servers-offshore.php\">Dedicated Servers<\/a> and <a href=\"https:\/\/underhost.com\/cloud-vps.php\">Cloud VPS<\/a> at <strong>UnderHost.com<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ConfigServer Security &#038; Firewall (CSF) is a popular firewall for Linux servers that includes a login failure daemon (lfd) to detect and block brute-force attacks. This guide will walk you through installing and configuring CSF on your server.<\/p>\n","protected":false},"author":1,"featured_media":4440,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,11],"tags":[7,4,6,13,12,14,9,15],"class_list":["post-230","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-controlpanel","category-how-to","tag-centos","tag-cpanel","tag-cpinstall","tag-csf","tag-firewall","tag-plugins","tag-wget","tag-whm"],"_links":{"self":[{"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/posts\/230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/comments?post=230"}],"version-history":[{"count":5,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/posts\/230\/revisions"}],"predecessor-version":[{"id":5178,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/posts\/230\/revisions\/5178"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/media\/4440"}],"wp:attachment":[{"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/media?parent=230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/categories?post=230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/tags?post=230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}