Want to subscribe to topics you're interested in?
Become a Member

CSF Restore default csf.conf

Discussion in 'Other Centmin Mod Installed software' started by so37, Jan 9, 2018.

Tags:
  1. so37

    so37 New Member

    16
    1
    3
    Aug 27, 2015
    Ratings:
    +1
    Local Time:
    2:00 AM
    Nginx 1.13.8
    MariaDB 10.1.30
    Please fill in any relevant information that applies to you:
    • CentOS Version:CentOS 7 64bit
    • Centmin Mod Version Installed: 123.09beta01
    Hi, I did some bad manipulations about TCP, UDP rules in my csf.conf, I would like to restore the default csf.conf, as the first csf.conf when the installation of centmind is finish, if someone can copy that for me please ?

    Thanks in advance.
     
  2. eva2000

    eva2000 Administrator Staff Member

    31,643
    7,030
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,636
    Local Time:
    11:00 AM
    Nginx 1.13.x
    MariaDB 5.5
    Always best to backup original files before modifying them ;)

    Would be tricky to replicate your exact settings as Centmin Mod initial install routine auto tunes and optimises the default CSF Firewall config file at /etc/csf/csf.conf based on detected server hardware and resources available and based on your systems supported Linux Kernel features i.e. if Kernel supports IPSET or IPv6 etc.

    Centmin Mod does make a backup of the csf.conf at /etc/csf/csf.conf-bak but this backup is taken before Centmin Mod initial install routine's auto tuning/optimisation. So is missing all the relevant Centmin Mod related CSF Firewall customised configuration settings.

    I should update 123.09beta01 to make another backup after the Centmin Mod configurations are auto tuned etc.

    If you have a similar or exact server spec duplicate server i.e. VPS as your existing one, you can spin that up with same OS and version of Centmin Mod and install it there and then just copy over the /etc/csf/csf.conf from that duplicate which would be a closer match. But warning if server specs etc and virtualisation used differ, then csf.conf won't be the same i.e. OpenVZ VPS won't have Kernel IPSET support so CSF Firewall's IPSET support is disabled unlike on KVM/XEN and dedicated which most likely have Kernel IPSET support is auto enabled and configured by Centmin Mod. Also if memory installed differs will also change auto tuned values as Centmin Mod detects how much installed memory system has and auto tunes CSF Firewall settings based on that memory size.
     
  3. so37

    so37 New Member

    16
    1
    3
    Aug 27, 2015
    Ratings:
    +1
    Local Time:
    2:00 AM
    Nginx 1.13.8
    MariaDB 10.1.30
    Thanks for you reply, Yes you're right I should have saved the file before the modification, so I did a new install without forgot to backup the file :) it's better.

    If my problem permit you to add something new in the Centminmod installation I'm happy !
     
    • Like Like x 1
  4. eva2000

    eva2000 Administrator Staff Member

    31,643
    7,030
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,636
    Local Time:
    11:00 AM
    Nginx 1.13.x
    MariaDB 5.5
    • Like Like x 1