This article will explain how you can open ports for your server in CSF through WHM and SSH.
Please be aware that opening ports on your server can be a security risk, please be aware of any risks when opening a specific port on your server.
There are 2 different ways to open ports on your server. One way is through WHM and one is via command line.
Steps to open ports in WHM
1. Log in to your WHM: SERVER-IP/WHM or SERVER-IP:2087
2. Click "ConfigServer Security & Firewall," which is under the "Plugins" section
3. Go to “Firewall Configuration”
4. Find “TCP_IN=” under “IPv4 Port Settings”
5. Enter the port number in the list below. Make sure to separate ports with a single comma and do not enter any spaces.
6. Click “Change” at the bottom of the page.
This will reset the firewall so that the ports that you have opened will take effect.
Steps to open ports via command line
1. SSH into your server.
2. Go to the directory with the CSF configuration file.
3. Open the file “csf.conf” (In this tutorial I used "nano" editor)
4. Once you are in the configuration file, find "TCP_IN=", it will be under "# Allow incoming TCP ports"
5. Within the quotation marks, put the port number that you wish to open. Separate each IP using a single comma and no spaces.
6. Close the file and save all changes.
7. Restart the firewall.