How to open ports in WHM/SSH firewall?

Opening a Port in CSF Firewall via SSH

  1. Access your Linux server through SSH. Use any text editor to open the csf.conf file.

    /etc/csf/csf.conf

  2. Insert the port you want to open and restart the CSF firewall for the changes to take effect.

    # Allow incoming TCP ports
    TCP_IN = "20,443,465,21,22,587,993,25,53,80,110,143,995"
    # Allow outgoing TCP ports
    TCP_OUT = "20,21,443,587,22,25,80,110,43,53"

  3. csf -r  // This command restarts the CSF firewall


Opening a Port in CSF Firewall via WHM


  1. Log in to WHM.
  2. Enter firewall in the Find bar and click on the ConfigServer Security&Firewall link.
  3. Click the Firewall Configuration button.
  4. Scroll down to find the Allow incoming TCP ports section. Input the port you wish to open and click on the Change button at the bottom to save your changes.
  5. Finally, you will need to restart CSF by clicking on the Restart csf+lfd button.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.