{"id":13776,"date":"2019-11-11T12:26:47","date_gmt":"2019-11-11T09:26:47","guid":{"rendered":"https:\/\/www.hyyat.com\/knowledgebase\/%d8%a7%d9%88%d8%a7%d9%85%d8%b1-%d8%ac%d8%af%d8%a7%d8%b1-%d8%a7%d9%84%d8%ad%d9%85%d8%a7%d9%8a%d8%a9-csf-%d8%a7%d9%84%d9%85%d9%87%d9%85%d8%a9-%d8%b9%d9%86-%d8%b7%d8%b1%d9%8a%d9%82-ssh\/"},"modified":"2022-05-30T12:07:07","modified_gmt":"2022-05-30T09:07:07","password":"","slug":"important-csf-firewall-commands-via-ssh","status":"publish","type":"docs","link":"https:\/\/www.hyyat.com\/en\/knowledgebase\/important-csf-firewall-commands-via-ssh\/","title":{"rendered":"Important CSF firewall commands via SSH"},"content":{"rendered":"<p><span style=\"color: #ff0000;\"><strong>Important CSF firewall commands via SSH<\/strong><\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-10560 size-full\" src=\"https:\/\/www.hyyat.com\/zasogooh\/2019\/11\/ConfigServer_SecurityFirewall_csf_logo.png\" alt=\"\u0627\u0648\u0627\u0645\u0631 \u062c\u062f\u0627\u0631 \u0627\u0644\u062d\u0645\u0627\u064a\u0629 CSF \u0627\u0644\u0645\u0647\u0645\u0629 \u0639\u0646 \u0637\u0631\u064a\u0642 SSH\" width=\"317\" height=\"127\" title=\"\" srcset=\"https:\/\/www.hyyat.com\/zasogooh\/2019\/11\/ConfigServer_SecurityFirewall_csf_logo.png 317w, https:\/\/www.hyyat.com\/zasogooh\/2019\/11\/ConfigServer_SecurityFirewall_csf_logo-300x120.png 300w\" sizes=\"(max-width: 317px) 100vw, 317px\"><\/p>\n<p>In Linux servers, it is necessary to install a firewall that blocks suspicious processes on the server.<\/p>\n<p>From blocking any IP addresses we would like to block easily and one of the best free programs that work as a firewall that<\/p>\n<p>It can be installed is the ConfigServer Security &amp; Firewall program, known as csf, and it is always preferred to use it on servers.<\/p>\n<p>Which works in the control panel whm\/cpanel, as it is designed in such a way that it works automatically by blocking IP addresses that try to<\/p>\n<p>Log in with wrong information a lot and you can see all csf details through the following <a href=\"https:\/\/www.configserver.com\/cp\/csf.html\" target=\"_blank\" rel=\"noopener\"><strong>link<\/strong><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong>In this lesson, we will review important CSF firewall commands via SSH<\/strong><\/p>\n<h4><span style=\"color: #ff0000;\">To get a list of all options, please use these commands<\/span><\/h4>\n<p><code>csf --help<br \/>\nman csf<\/code><\/p>\n<p>Firewall installation path : \/etc\/csf<br \/>\nmain settings file : \/etc\/csf\/csf.conf<\/p>\n<h4><span style=\"color: #ff0000;\">Restart the firewall<\/span><\/h4>\n<p><code>csf -r<\/code><\/p>\n<h4><span style=\"color: #ff0000;\">Turn on the firewall<\/span><\/h4>\n<p><code>csf -s<\/code><\/p>\n<h4><span style=\"color: #ff0000;\">Enable CSF (meaning when the server restarts, the csf is running)<\/span><\/h4>\n<p><code>csf -e<\/code><\/p>\n<h4><span style=\"color: #ff0000;\">Disable CSF (meaning when the server restarts, the csf does not work)<\/span><\/h4>\n<p><code>csf -x<\/code><\/p>\n<h4><span style=\"color: #ff0000;\">Remove and unblock all IPs on the server<\/span><\/h4>\n<p><code>csf -df<\/code><\/p>\n<h4><span style=\"color: #ff0000;\">ip ban one<\/span><\/h4>\n<p><code>csf -d 000.000.000.000<\/code><\/p>\n<p><strong>000.000.000.000 =IP to be blocked<\/strong><\/p>\n<h4><span style=\"color: #ff0000;\">Activate one IP<\/span><\/h4>\n<p><code>csf -a 000.000.000.000<\/code><\/p>\n<p><strong>000.000.000.000 = IP to activate (remove from ban)<br \/>\n<\/strong><\/p>\n<h4><span style=\"color: #ff0000;\">Clear all IP addresses from temporary IP entries<\/span><\/h4>\n<p><code>csf -tf<\/code><\/p>\n<p>Now if you want to manually search for a specific IP to unblock it, unblock it, or even attend and stop it<\/p>\n<p>You find all the IP that is blocked on the server you find it in this file<\/p>\n<p>&nbsp;<\/p>\n<p><code>nano \/etc\/csf\/csf.deny<\/code><\/p>\n<p>All IPs where the white is located are not or the trusted IP<\/p>\n<p><code>nano \/etc\/csf\/csf.allow<\/code><\/p>\n<p><span style=\"color: #339966;\"><strong>Note: The IP addresses listed in this file will not be ignored by lfd, so it can still be blocked. If you don&#8217;t want to lfd block an IP address, you should add it to csf.ignore<\/strong><\/span><\/p>\n<h4>Greetings from the <a href=\"\/\/www.hyyat.com\/en\" target=\"_blank\" rel=\"noopener\">Hyyat Host<\/a> team for hosting<\/h4>\n","protected":false},"excerpt":{"rendered":"<p>Important CSF firewall commands via SSH In Linux servers, it is necessary to install a firewall that blocks suspicious processes on the server. From blocking any IP addresses we would like to block easily and one of the best free programs that work as a firewall that It can be installed is the ConfigServer Security [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_eb_attr":"","inline_featured_image":false,"wprm-recipe-roundup-name":"","wprm-recipe-roundup-description":"","footnotes":""},"doc_category":[2734],"doc_tag":[2796],"class_list":["post-13776","docs","type-docs","status-publish","hentry","doc_category-whm-cpanel-control-panels","doc_tag-csf-en"],"year_month":"2026-04","word_count":342,"total_views":"4425","reactions":{"happy":"1","normal":"0","sad":"0"},"author_info":{"name":"ahmed fathy","author_nicename":"ahmed-fathy","author_url":"https:\/\/www.hyyat.com\/en\/author\/ahmed-fathy\/"},"doc_category_info":[{"term_name":"whm\/cpanel control panels","term_url":"https:\/\/www.hyyat.com\/en\/kb\/whm-cpanel-control-panels\/"}],"doc_tag_info":[{"term_name":"CSF","term_url":"https:\/\/www.hyyat.com\/en\/docs-tag\/csf-en\/"}],"knowledge_base_info":[],"knowledge_base_slug":[],"_links":{"self":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/docs\/13776","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/comments?post=13776"}],"version-history":[{"count":0,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/docs\/13776\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/media?parent=13776"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/doc_category?post=13776"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/doc_tag?post=13776"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}