Using the Command Line add Open a Port in CSF Firewall

Using the Command Line Interface

Steps to open port in CSF

1) Login to the server using the SSH.

2) Open the configuration file of the CSF as follows.

vi /etc/csf/csf.conf

3) Add the required ports to the csf.conf file

# Allow incoming TCP ports

TCP_IN = “20,21,22,25,26,53,80,110,143,443,465,587,993,995”

# Allow outgoing TCP ports

TCP_OUT = “20,21,22,25,26,37,43,53,80,110,113,443,465,873”

4) Restart the CSF for the changes to take effect. Run the below command to restart the CSF.

csf -r

Site Footer

Sliding Sidebar

About Me

About Me

Hello, my name is Dũng (Johnny). Welcome to my blog.

As I’m a developer, I write about topics related to the field of programming, mainly from a technical point of view. On this blog you’ll find posts which encourage discussion, information about development trends, case studies, reviews, tutorials, tips on how to improve your effectiveness, and anything else that might be fascinating to people from the IT industry.
I love PHP,JS and Fullstack.

  • http://lcdung.top/about/
  • Mail: ledung@8bitbase.com