---
title: Important CSF firewall commands via SSH
description: "**Important CSF firewall commands via SSH** ![اوامر جدار الحماية CSF المهمة عن طريق SSH](https://www.hyyat.com/wp-content/uploads/2019/11/ConfigServer_SecurityFirewall_csf_logo.png) 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…"
url: "https://www.hyyat.com/en/knowledgebase/important-csf-firewall-commands-via-ssh/"
updated: "2026-10-21"
category: Server management / whm/cpanel control panels
tags:
  - CSF
---

# Important CSF firewall commands via SSH

**Important CSF firewall commands via SSH**

![اوامر جدار الحماية CSF المهمة عن طريق SSH](https://www.hyyat.com/wp-content/uploads/2019/11/ConfigServer_SecurityFirewall_csf_logo.png)

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 & Firewall program, known as csf, and it is always preferred to use it on servers.

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

Log in with wrong information a lot and you can see all csf details through the following [**link**](https://www.configserver.com/cp/csf.html)

 

**In this lesson, we will review important CSF firewall commands via SSH**

#### To get a list of all options, please use these commands

`csf --help
man csf`

Firewall installation path : /etc/csf
 main settings file : /etc/csf/csf.conf

#### Restart the firewall

`csf -r`

#### Turn on the firewall

`csf -s`

#### Enable CSF (meaning when the server restarts, the csf is running)

`csf -e`

#### Disable CSF (meaning when the server restarts, the csf does not work)

`csf -x`

#### Remove and unblock all IPs on the server

`csf -df`

#### ip ban one

`csf -d 000.000.000.000`

**000.000.000.000 =IP to be blocked**

#### Activate one IP

`csf -a 000.000.000.000`

**000.000.000.000 = IP to activate (remove from ban)**

#### Clear all IP addresses from temporary IP entries

`csf -tf`

Now if you want to manually search for a specific IP to unblock it, unblock it, or even attend and stop it

You find all the IP that is blocked on the server you find it in this file

 

`nano /etc/csf/csf.deny`

All IPs where the white is located are not or the trusted IP

`nano /etc/csf/csf.allow`

**Note: The IP addresses listed in this file will not be ignored by lfd, so it can still be blocked. If you don't want to lfd block an IP address, you should add it to csf.ignore**

#### Greetings from the [Hyyat Host](//www.hyyat.com/en) team for hosting

**Related service:** [server management](https://www.hyyat.com/%d8%a5%d8%af%d8%a7%d8%b1%d8%a9-%d8%a7%d9%84%d8%b3%d9%8a%d8%b1%d9%81%d8%b1%d8%a7%d8%aa/) from Hyyat Host, with technical support that replies within 24 hours.

 **Related guides**

- [Optimizing Apache web server on WHM?](https://www.hyyat.com/knowledgebase/%d8%aa%d8%ad%d8%b3%d9%8a%d9%86-%d8%ae%d8%a7%d8%af%d9%85-%d8%a7%d9%84%d9%88%d9%8a%d8%a8-%d8%a7%d8%a8%d8%a7%d8%aa%d8%b4%d9%8a-%d8%b9%d9%84%d9%8a-whm%d8%9f/)
- [Limiting the number of mails sent per hour in WHM?](https://www.hyyat.com/knowledgebase/%d8%aa%d8%ad%d8%af%d9%8a%d8%af-%d8%b9%d8%af%d8%af-%d8%a5%d8%b1%d8%b3%d8%a7%d9%84-%d8%b1%d8%b3%d8%a7%d8%a6%d9%84-%d8%a7%d9%84%d8%a8%d8%b1%d9%8a%d8%af-%d8%a8%d8%a7%d9%84%d8%b3%d8%a7%d8%b9%d8%a9-%d9%81/)
- [Fix CC Error: Country Code Lookups setting MM_LICENSE_KEY must be set](https://www.hyyat.com/knowledgebase/%d8%a7%d8%b5%d9%84%d8%a7%d8%ad-%d8%ae%d8%b7%d8%a3-cc-error-country-code-lookups-setting-mm_license_key-must-be-set/)

  **Need this service from Hyyat Host?**Our team handles it for you, with support replying to tickets within 24 hours at most.[Server Management](https://www.hyyat.com/en/server-management/)[dedicated server](https://www.hyyat.com/en/dedicated-server/)
