Made a mistake on firewall and need help

on firewall configuration I remove (my mistake) all the Allow incoming TCP ports, and now i don´t have cyperpanel access. Is there any way to reopen those ports on the shell?

If you have ssh access, run

systemctl stop firewalld

Then you will get CyberPanel access, you then need to fix firewall from ssh.

just perfect, but what files do i need to change using nano for example in order to fix it?

Did you remove iptable rules? or firewalld

please mark solved if your problem is solved

btw:

answer

I´ve already fixed with backup BUT it´s a great topic to understand. As no ports were open, i could not fix it on cyperpabel (port 8090 was not working). How to activate port 8090?

I tried with ufw allow but it didn´t work

UPDATE:

As CP is using CFS as firewall ufw doesn´t work.

CSF can be configured on terminal ssh by editing its configuration file csf.conf in /etc/csf:

nano /etc/csf/csf.conf

You must edit the line:

TCP_IN = “20,21,22,25,53,80,110,143,443,465,587,993,995” TCP_OUT = “20,21,22,25,53,80,110,113,443” UDP_IN = “20,21,53” UDP_OUT = “20,21,53,113,123”

The changes can be applied with command:

csf -r

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.

By the way, CyberPanel by default use firewalld unless you install csf from CyberPanel which disables firewalld.

So this solution only works if you have installed csf.

2 Likes