Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Adding a new iptable rule through SSH

Discussion in 'Security' started by Host NIT, Apr 25, 2014.

  1. Host NIT

    Host NIT Member

    Joined:
    Apr 25, 2014
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    Question:

    When adding a new IP table rule through ssh. Let's say for IP: 1.2.3.4 /CSF is installed and it's on a Centos system.

    Would it be like this:

    Open or create this file: /etc/csf/csfpost.sh
    Insert this line for each subnet
    iptables -I INPUT -s SUBNET_HERE -p tcp -m multiport --dports 81,999 -j ACCEPT

    When you are done, save and close the file, then run:


    csf -r


    Would that be correct?

    The reason I'm not doing it through WHM is because even though the IP has been white listed, i can't telnet into it from the remote server via ssh(as a test to check incoming connections)
     
  2. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    829
    Likes Received:
    26
    Trophy Points:
    178
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    You should just be able to edit /etc/csf/csf.allow. There are examples in the file for how the entry should be formatted.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Host NIT

    Host NIT Member

    Joined:
    Apr 25, 2014
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    Hey,

    It's alreasdy added in the .etc/alow

    but I still cant seem to run a telnet xx.remorte.xx.ip

    Getting connection refused.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,234
    Likes Received:
    383
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Have you read the readme for CSF? Might be helpful to you.
    http://www.configserver.com/free/csf/readme.txt
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Host NIT

    Host NIT Member

    Joined:
    Apr 25, 2014
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice