How to ensure ports are open via command line for WHM

This article explains how to open ports on your server in CSF.

Be aware that opening ports on your server can be a security risk, so please be aware of the risk before opening specific ports on your server. 

To open ports on your server there are ways of doing this. You can open ports via WHM, or via the command line. 

How to open ports in WHM

  1. Login to WHM: SERVER-IP/WHM
  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. 

The above steps will reset your firewall, and enable ports to be open.

How 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"
  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.
Was this answer helpful? 0 Users Found This Useful (0 Votes)