{"id":1105,"date":"2025-08-14T12:25:31","date_gmt":"2025-08-14T12:25:31","guid":{"rendered":"https:\/\/blog.vavencloud.com\/?p=1105"},"modified":"2025-08-14T12:25:31","modified_gmt":"2025-08-14T12:25:31","slug":"how-to-secure-whm-with-csf-firewall-two-factor-authentication","status":"publish","type":"post","link":"https:\/\/blog.vavencloud.com\/?p=1105","title":{"rendered":"How to Secure WHM with CSF Firewall &#038; Two-Factor Authentication"},"content":{"rendered":"<p data-start=\"236\" data-end=\"453\">When you manage multiple cPanel accounts and websites through WHM, security should be your top priority. Since WHM has root-level access to your server, any compromise could affect all your clients, sites, and data.<\/p>\n<p data-start=\"455\" data-end=\"506\">Two of the most effective ways to secure WHM are:<\/p>\n<ol data-start=\"507\" data-end=\"727\">\n<li data-start=\"507\" data-end=\"600\">\n<p data-start=\"510\" data-end=\"600\"><strong data-start=\"510\" data-end=\"552\">CSF (ConfigServer Security &amp; Firewall)<\/strong> \u2014 A robust server firewall and security tool.<\/p>\n<\/li>\n<li data-start=\"601\" data-end=\"727\">\n<p data-start=\"604\" data-end=\"727\"><strong data-start=\"604\" data-end=\"639\">Two-Factor Authentication (2FA)<\/strong> \u2014 An extra login layer that requires both your password and a time-based security code.<\/p>\n<\/li>\n<\/ol>\n<p data-start=\"729\" data-end=\"807\">In this guide, we\u2019ll walk you through setting up CSF and enabling 2FA for WHM.<\/p>\n<hr data-start=\"809\" data-end=\"812\" \/>\n<h2 data-start=\"814\" data-end=\"853\"><strong data-start=\"817\" data-end=\"853\">Why Security is Critical for WHM<\/strong><\/h2>\n<p data-start=\"855\" data-end=\"968\">WHM isn\u2019t just another web app \u2014 it\u2019s the control center for your entire hosting environment. With it, you can:<\/p>\n<ul data-start=\"969\" data-end=\"1106\">\n<li data-start=\"969\" data-end=\"1006\">\n<p data-start=\"971\" data-end=\"1006\">Create and delete cPanel accounts<\/p>\n<\/li>\n<li data-start=\"1007\" data-end=\"1031\">\n<p data-start=\"1009\" data-end=\"1031\">Manage DNS and email<\/p>\n<\/li>\n<li data-start=\"1032\" data-end=\"1064\">\n<p data-start=\"1034\" data-end=\"1064\">Change system configurations<\/p>\n<\/li>\n<li data-start=\"1065\" data-end=\"1106\">\n<p data-start=\"1067\" data-end=\"1106\">Restart services like Apache or MySQL<\/p>\n<\/li>\n<\/ul>\n<p data-start=\"1108\" data-end=\"1245\">If attackers gain access to WHM, they gain access to <strong data-start=\"1161\" data-end=\"1175\">everything<\/strong>. That\u2019s why hardening WHM with multiple security layers is essential.<\/p>\n<hr data-start=\"1247\" data-end=\"1250\" \/>\n<h2 data-start=\"1252\" data-end=\"1296\"><strong data-start=\"1255\" data-end=\"1296\">1. Install and Configure CSF Firewall<\/strong><\/h2>\n<p data-start=\"1298\" data-end=\"1427\"><strong data-start=\"1298\" data-end=\"1314\">What is CSF?<\/strong><br data-start=\"1314\" data-end=\"1317\" \/>ConfigServer Security &amp; Firewall (CSF) is a free and powerful Linux firewall with a WHM plugin. It provides:<\/p>\n<ul data-start=\"1428\" data-end=\"1535\">\n<li data-start=\"1428\" data-end=\"1457\">\n<p data-start=\"1430\" data-end=\"1457\">IP-based allow\/deny lists<\/p>\n<\/li>\n<li data-start=\"1458\" data-end=\"1484\">\n<p data-start=\"1460\" data-end=\"1484\">Brute-force protection<\/p>\n<\/li>\n<li data-start=\"1485\" data-end=\"1512\">\n<p data-start=\"1487\" data-end=\"1512\">Login failure detection<\/p>\n<\/li>\n<li data-start=\"1513\" data-end=\"1535\">\n<p data-start=\"1515\" data-end=\"1535\">Port scanning alerts<\/p>\n<\/li>\n<\/ul>\n<h3 data-start=\"1537\" data-end=\"1564\"><strong data-start=\"1541\" data-end=\"1564\">Step 1: Install CSF<\/strong><\/h3>\n<p data-start=\"1565\" data-end=\"1606\">Login to your server via SSH as <strong data-start=\"1597\" data-end=\"1605\">root<\/strong>:<\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<ul>\n<li class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-bash\"><span class=\"hljs-built_in\">cd<\/span> \/usr\/src<\/code><code class=\"whitespace-pre! language-bash\"><\/code><code class=\"whitespace-pre! language-bash\"><\/code><code class=\"whitespace-pre! language-bash\"><\/code><\/li>\n<li class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-bash\"><span class=\"hljs-built_in\">rm<\/span> -fv csf.tgz<\/code><code class=\"whitespace-pre! language-bash\"><\/code><\/li>\n<li class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-bash\">wget https:\/\/download.configserver.com\/csf.tgz<\/code><code class=\"whitespace-pre! language-bash\"><\/code><\/li>\n<li class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-bash\">tar -xzf csf.tgz<\/code><code class=\"whitespace-pre! language-bash\"><\/code><code class=\"whitespace-pre! language-bash\"><\/code><\/li>\n<li class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-bash\"><span class=\"hljs-built_in\">cd<\/span> csf<\/code><code class=\"whitespace-pre! language-bash\"><\/code><\/li>\n<li class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-bash\">sh install.sh<br \/>\n<\/code><\/li>\n<\/ul>\n<\/div>\n<hr data-start=\"1732\" data-end=\"1735\" \/>\n<h3 data-start=\"1737\" data-end=\"1770\"><strong data-start=\"1741\" data-end=\"1770\">Step 2: Enable CSF in WHM<\/strong><\/h3>\n<ol data-start=\"1771\" data-end=\"1991\">\n<li data-start=\"1771\" data-end=\"1822\">\n<p data-start=\"1774\" data-end=\"1822\">Log in to WHM at <code data-start=\"1791\" data-end=\"1820\">https:\/\/your-server-ip:2087<\/code><\/p>\n<\/li>\n<li data-start=\"1823\" data-end=\"1888\">\n<p data-start=\"1826\" data-end=\"1888\">In the search bar, type <strong data-start=\"1850\" data-end=\"1886\">ConfigServer Security &amp; Firewall<\/strong><\/p>\n<\/li>\n<li data-start=\"1889\" data-end=\"1942\">\n<p data-start=\"1892\" data-end=\"1942\">Open the interface and click <strong data-start=\"1921\" data-end=\"1940\">Enable Firewall<\/strong><\/p>\n<\/li>\n<li data-start=\"1943\" data-end=\"1991\">\n<p data-start=\"1946\" data-end=\"1991\">Click <strong data-start=\"1952\" data-end=\"1971\">Restart csf+lfd<\/strong> to apply settings<\/p>\n<\/li>\n<\/ol>\n<hr data-start=\"1993\" data-end=\"1996\" \/>\n<h3 data-start=\"1998\" data-end=\"2044\"><strong data-start=\"2002\" data-end=\"2044\">Step 3: Configure Basic Firewall Rules<\/strong><\/h3>\n<p data-start=\"2045\" data-end=\"2063\">Inside CSF in WHM:<\/p>\n<ul data-start=\"2064\" data-end=\"2300\">\n<li data-start=\"2064\" data-end=\"2136\">\n<p data-start=\"2066\" data-end=\"2136\">Allow your IP under <strong data-start=\"2086\" data-end=\"2103\">&#8220;Quick Allow&#8221;<\/strong> to prevent accidental lockouts<\/p>\n<\/li>\n<li data-start=\"2137\" data-end=\"2215\">\n<p data-start=\"2139\" data-end=\"2215\">Close unused ports (keep only necessary ones like 2087, 2083, 22, 80, 443)<\/p>\n<\/li>\n<li data-start=\"2216\" data-end=\"2300\">\n<p data-start=\"2218\" data-end=\"2300\">Enable <strong data-start=\"2225\" data-end=\"2258\">Login Failure Detection (lfd)<\/strong> to block repeated failed login attempts<\/p>\n<\/li>\n<\/ul>\n<hr data-start=\"2302\" data-end=\"2305\" \/>\n<h2 data-start=\"2307\" data-end=\"2356\"><strong data-start=\"2310\" data-end=\"2356\">2. Enable Two-Factor Authentication in WHM<\/strong><\/h2>\n<p data-start=\"2358\" data-end=\"2528\"><strong data-start=\"2358\" data-end=\"2374\">What is 2FA?<\/strong><br data-start=\"2374\" data-end=\"2377\" \/>Two-Factor Authentication adds an extra login step. Even if someone guesses your password, they cannot log in without the code generated by your phone.<\/p>\n<hr data-start=\"2530\" data-end=\"2533\" \/>\n<h3 data-start=\"2535\" data-end=\"2570\"><strong data-start=\"2539\" data-end=\"2570\">Step 1: Access 2FA Settings<\/strong><\/h3>\n<ol data-start=\"2571\" data-end=\"2697\">\n<li data-start=\"2571\" data-end=\"2589\">\n<p data-start=\"2574\" data-end=\"2589\">Log in to WHM<\/p>\n<\/li>\n<li data-start=\"2590\" data-end=\"2648\">\n<p data-start=\"2593\" data-end=\"2648\">In the search bar, type <strong data-start=\"2617\" data-end=\"2646\">Two-Factor Authentication<\/strong><\/p>\n<\/li>\n<li data-start=\"2649\" data-end=\"2697\">\n<p data-start=\"2652\" data-end=\"2697\">Click <strong data-start=\"2658\" data-end=\"2679\">Manage My Account<\/strong> (for your user)<\/p>\n<\/li>\n<\/ol>\n<hr data-start=\"2699\" data-end=\"2702\" \/>\n<h3 data-start=\"2704\" data-end=\"2749\"><strong data-start=\"2708\" data-end=\"2749\">Step 2: Set Up Your Authenticator App<\/strong><\/h3>\n<ol data-start=\"2750\" data-end=\"2946\">\n<li data-start=\"2750\" data-end=\"2797\">\n<p data-start=\"2753\" data-end=\"2797\">Click <strong data-start=\"2759\" data-end=\"2795\">Set Up Two-Factor Authentication<\/strong><\/p>\n<\/li>\n<li data-start=\"2798\" data-end=\"2829\">\n<p data-start=\"2801\" data-end=\"2829\">WHM will display a QR code<\/p>\n<\/li>\n<li data-start=\"2830\" data-end=\"2886\">\n<p data-start=\"2833\" data-end=\"2886\">Open your <strong data-start=\"2843\" data-end=\"2867\">Google Authenticator<\/strong> or <strong data-start=\"2871\" data-end=\"2880\">Authy<\/strong> app<\/p>\n<\/li>\n<li data-start=\"2887\" data-end=\"2946\">\n<p data-start=\"2890\" data-end=\"2946\">Scan the QR code and enter the generated code into WHM<\/p>\n<\/li>\n<\/ol>\n<hr data-start=\"2948\" data-end=\"2951\" \/>\n<h3 data-start=\"2953\" data-end=\"2994\"><strong data-start=\"2957\" data-end=\"2994\">Step 3: Enforce 2FA for All Users<\/strong><\/h3>\n<ol data-start=\"2995\" data-end=\"3125\">\n<li data-start=\"2995\" data-end=\"3068\">\n<p data-start=\"2998\" data-end=\"3068\">In WHM\u2019s <strong data-start=\"3007\" data-end=\"3036\">Two-Factor Authentication<\/strong> menu, select <strong data-start=\"3050\" data-end=\"3066\">Manage Users<\/strong><\/p>\n<\/li>\n<li data-start=\"3069\" data-end=\"3125\">\n<p data-start=\"3072\" data-end=\"3125\">Enable \u201cRequire 2FA\u201d for all root\/reseller accounts<\/p>\n<\/li>\n<\/ol>\n<hr data-start=\"3127\" data-end=\"3130\" \/>\n<h2 data-start=\"3132\" data-end=\"3169\"><strong data-start=\"3135\" data-end=\"3169\">3. Extra Tips for WHM Security<\/strong><\/h2>\n<ul data-start=\"3170\" data-end=\"3394\">\n<li data-start=\"3170\" data-end=\"3237\">\n<p data-start=\"3172\" data-end=\"3237\">Change WHM\u2019s default port from <strong data-start=\"3203\" data-end=\"3211\">2087<\/strong> to a custom port in CSF<\/p>\n<\/li>\n<li data-start=\"3238\" data-end=\"3286\">\n<p data-start=\"3240\" data-end=\"3286\">Use strong, unique passwords for WHM and SSH<\/p>\n<\/li>\n<li data-start=\"3287\" data-end=\"3333\">\n<p data-start=\"3289\" data-end=\"3333\">Restrict WHM access to specific IPs in CSF<\/p>\n<\/li>\n<li data-start=\"3334\" data-end=\"3394\">\n<p data-start=\"3336\" data-end=\"3394\">Enable automatic system updates to patch vulnerabilities<\/p>\n<\/li>\n<\/ul>\n<hr data-start=\"3396\" data-end=\"3399\" \/>\n<h2 data-start=\"3401\" data-end=\"3418\"><strong data-start=\"3404\" data-end=\"3418\">Conclusion<\/strong><\/h2>\n<p data-start=\"3419\" data-end=\"3657\">By combining <strong data-start=\"3432\" data-end=\"3448\">CSF Firewall<\/strong> and <strong data-start=\"3453\" data-end=\"3482\">Two-Factor Authentication<\/strong>, you add two strong layers of security to WHM. CSF blocks unwanted traffic and brute-force attempts, while 2FA ensures that even if your password leaks, hackers can\u2019t get in.<\/p>\n<p data-start=\"3659\" data-end=\"3721\">A secure WHM means secure cPanel accounts \u2014 and happy clients.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you manage multiple cPanel accounts and websites through WHM, security should be your top priority. Since WHM has root-level access to your server, any compromise could affect all your clients, sites, and data. Two of the most effective ways to secure WHM are: CSF (ConfigServer Security &amp; Firewall) \u2014 A robust server firewall and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1106,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-1105","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server-management"],"_links":{"self":[{"href":"https:\/\/blog.vavencloud.com\/index.php?rest_route=\/wp\/v2\/posts\/1105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.vavencloud.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.vavencloud.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.vavencloud.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.vavencloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1105"}],"version-history":[{"count":0,"href":"https:\/\/blog.vavencloud.com\/index.php?rest_route=\/wp\/v2\/posts\/1105\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.vavencloud.com\/index.php?rest_route=\/"}],"wp:attachment":[{"href":"https:\/\/blog.vavencloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.vavencloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.vavencloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}