CyberPanel Community

ClosedMade a mistake on firewall and need help

JM
John Martin #1

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?

7 replies
AK
Asma Khalid #2

If you have ssh access, run

systemctl stop firewalld

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

JM
John Martin #3

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

FA
Farhan Ali #4

Did you remove iptable rules? or firewalld

MK
Mirza Khadnezar S [sick] #5

please mark solved if your problem is solved

btw:

answer

JM
John Martin #6

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

JM
John Martin #7

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

AK
Asma Khalid #9

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.

Sign in to reply