Free Control Panels

Enable CSF Firewall on CentOS Web Panel (CWP)

Enable CSF Firewall on CentOS Web Panel (CWP)

Introduction

CentOS Web Panel, or CWP, is a powerful, free web hosting control panel that provides an easy to use and manage server interface with many management tasks. It is designed for use with CentOS, RHEL and CloudLinux. This article will walk you through Enable CSF Firewall on CentOS Web Panel (CWP).

What is CSF firewall

Config Server Firewall (or CSF) is a free and advanced firewall for most Linux distributions and Linux based VPS.

CSF (ConfigServer Security & Firewall) is the default firewall that comes with CentOS Web Panel. As of writing this article, CSF is installed but it’s not enabled

Enable CSF Firewall on CentOS Web Panel (CWP)

1 – Login to CWP Admin page as root :

Enable CSF Firewall on CentOS Web Panel (CWP)

After that the installation of CWP on CentOS 7 has finished, let’s go to the URL https://your_server_ip:2031 and provide the credentials that were made available at the end of the installation.

See the following link

How to Install CentOS Web Panel (CWP) on CentOS 7

How to Install CentOS Web Panel (CWP) on CentOS 7

 

Note: that the URL begins with https:// and not http://. It means that we are accessing CWP over a secure connection. Since we have not yet set up any certificates, a certificate generated by default by the unsigned server is used, which is why you will receive a warning message from your browser and you can safely add it to your exceptions list and proceed with logging CWP.

 

When logging in to CWP you will see a warning:

When logging in to CWP you will see a warning:

Message id [8dfeb6386ed1dfa9aee22f447e45e544]: === SECURITY WARNING === CSF/LFD Firewall is NOT enabled on your server, click here to enable it!

 

2 – Navigate to Security->Firewall Manager

Security and Firewall Manager

3 – Click the Enable Firewall button. You will see a log like:

 

Enable Firewall

Running /usr/local/csf/bin/csfpost.sh
Starting lfd:[ OK ] csf and lfd have been enabled

4 – Now CSF and lfd (Login Failure Daemon) have been enabled.

(you can now close the warning message from the CWP Dashboard)

you can now close the warning message from the CWP Dashboard

You can also enable CSF via the command line. Use csf -e command:

[[email protected] ~]# csf -e
By default, the open ports are:
TCP
IN: 20, 21, 22, 25, 53, 80, 110, 143, 443, 465, 587, 993, 995, 2030, 2031, 2082, 2083, 2086, 2087, 2095, 2096
OUT: 20, 21, 22, 25, 53, 80, 110, 113, 443, 2030, 2031, 2082, 2083, 2086, 2087, 2095, 2096, 587, 993, 995
UDP
IN: 20, 21, 53
OUT: 20, 21, 53, 113, 123

The movie tutorial for this KB article:

Conclusion

The CentOS Web Panel offers a huge number of options and features for server management in its control panel package. In this article we show Enable CSF Firewall on CentOS Web Panel (CWP), but you can explore the official CWP wiki.

Have you Enable CSF Firewall yet? Are you using it to host your websites? Share your experience in the comment section below.

About the author

Avatar

jon snow

Jon is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, and currently a content creator for ERRORHAT who loves working with computers and strongly believes in sharing knowledge.

Add Comment

Click here to post a comment