Learn the CSF command line options

Rob —  July 23, 2013 — 4 Comments

You have CSF installed and use the GUI to do most things.  (If you don’t have it installed yet, you can read our article on how to install csf).  BUT – knowing the csf (ConfigServer Firewall) flags will help you to quickly get things done via command line – instead of loading up the GUI every single time.

Here are some of the ones I use all the time.

csf -r (Restart CSF)
csf -d (quick deny an ip: csf -d xxx.xxx.xxx.xxx)
csf -a (quick allow / whitelist an ip: csf -a xxx.xxx.xxx.xxx)
csf -dr (unblock an ip and remove from the deny list: csf -dr xxx.xxx.xxx.xxx)

Here are all of them:

Related posts from Linux Brigade!

  • Search previous commands typedSearch previous commands typed If you want to see a collection of your previous commands used in Linux, you can always type ‘history’ for a listing of them. You can even search through history by grepping for the […]
  • LFD: Excessive resource usage If you run the CSF/LFD firewall on your server then you’ve no doubt seen the emails complaining about high resource usage for various accounts. This small tutorial will show you how to […]
  • Import MySQL database from command lineImport MySQL database from command line You’ll need to import a database via command line from time to time – I’ll normally opt for this anyway. After seeing how easy it is, you’ll probably end up using the command line instead […]
  • Enable statistics in Configserver Firewall (CSF) I’ve noticed recently that a new install of CSF won’t have statistics enabled by default.  Here’s how to enable them…

    Edit your /etc/csf/csf.conf file and change:

    ST_ENABLE = […]

  • cPanel / CSF: Fix 500 internal server error or 404 for the CSF GUI I’ve run into this a couple times – where I’ll spin up a CentOS/cPanel machine, then run a cpupdate (/scripts/upcp) to get cpanel up to date.  I’ll then go into the configserver firewall […]

4 responses to Learn the CSF command line options

  1. Thank you for the very informative article. I’m a bit of a newbie with Linux and your articles provide valuable help and information. Just like mentioned in the article I used to load up the GUI every time but now I can do things much simpler and faster. Keep the good articles coming.

  2. Phew, this has saved me a lot of time waiting for my GUI to load during syn_ack attack

  3. How would you add a c class to CSF?

Trackbacks and Pingbacks:

  1. Learn the CSF command line options | Webmaster Brigade - July 23, 2013

    […] Knowing the csf (ConfigServer Firewall) flags will help you to quickly get things done via command line – instead of loading up the GUI every single time. You can read the full article on our Linux blog: CSF Command Line […]

Leave a Reply to AMiRU Cancel reply

Text formatting is available via select HTML.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url=""> 

*