CSF firewall is a popular security tool for Linux servers. It allows you to control the incoming and outgoing network traffic by opening or closing ports. Ports are like doors that let different types of data pass through.
Follow the instructions below to add a port into your CSF Firewall:
- First, log in to your server and open the file /etc/csf/csf.conf with your editor of choice. For example, if we use nano, we will use nano /etc/csf/csf.conf. This command will open the CSF configuration file.
- Within the configuration file, we will need to find the following section as listed below.
- Here we can add the port number at the end of each line before the quote mark (“). As an example, view the change made below where I’ve added port 8252.
- Once that is done, save the file, and exit.
- Proceed to restart the firewall using systemctl restart csf or service csf restart (Depending on the OS), as shown below.