• Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How to Install CSF (ConfigServer & Security Firewall) on cPanel

Written by Rahul, Updated on January 26, 2018

ConfigServer & Security Firewall (CSF) is getting more popularity for cPanel servers security. It prevents your server from DDOS attacks. This article will help you for installing and configuring CSF firewall on cPanel servers.

  • Read: How to Install Iptables on CentOS/Redhat 7
  • Step 1 – Install CSF Firewall

    First download latest source code of CSF firewall and extract on your system using following commands.

    wget https://download.configserver.com/csf.tgz
    tar xfz csf.tgz
    cd csf
    

    After extracting latest code from your system. Execute install.sh script to install CSF on your system. The installer will automatically detect for cPanel server and install required modules for it.

    sh install.sh
    

    Step 2 – Configure CSF Firewall

    Now edit /etc/csf/csf.conf configuration file and disable TESTING mode by setting value to “0”.

     TESTING = “0”
    

    Let’s restart csf service

    csf -r
    

    Now you can visit to WHM interface Home » Plugins » ConfigServer Security & Firewall to access CSF graphical interface for more configuration options.

  • Read: How to Add Custom Iptables Rules with CSF
  • Step 3 – Manage CSF with Command Line

    We can also manage CSF firewall using command line. For example below is some

    To allow an IP. Ip will be added to /etc/csf/csf.allow

    csf -a 11.22.33.44
    [or]
    csf --add 11.22.33.44
    

    To deny an IP. Ip will be added to /etc/csf/csf.deny

    csf -d 11.22.33.44
    [or]
    csf --deny 11.22.33.44
    

    To search for specific IP, CIDR in iptables rules.

    csf -g 11.22.33.44
    [or]
    csf --grep 11.22.33.44
    

    Start the firewall rules

    csf -s
    [or]
    csf --start
    

    Flush/Stop firewall rules (Note: lfd may restart csf)

    csf -f
    [or]
    csf --stop
    

    Restart CSF firewall rules

    csf -r
    [or]
    csf --restart
    
  • Read: How to Disable/Block Ping Responses in Linux
  • Share it!
    Share on Facebook
    Share on Twitter
    Share on LinkedIn
    Share on Reddit
    Share on Tumblr
    Share on Whatsapp
    Rahul
    Rahul
    Connect on Facebook Connect on Twitter

    I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

    1 Comment

    1. Avatar amir Reply
      September 24, 2017 at 10:19 am

      thanks

    Leave a Reply Cancel reply

    Popular Posts

    • How To Install Python 3.9 on Ubuntu 20.04 5
    • How To Install Python 3.9 on Ubuntu 18.04 0
    • How to Use AppImage on Linux (Beginner Guide) 2
    • How to Install Python 3.9 on CentOS/RHEL 7 & Fedora 32/31 0
    • How To Install VNC Server on Ubuntu 20.04 1
    © 2013-2020 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy