The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    19
    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:
    817
    Likes Received:
    22
    Trophy Points:
    18
    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.
     
  3. Host NIT

    Host NIT Member

    Joined:
    Apr 25, 2014
    Messages:
    19
    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:
    14,451
    Likes Received:
    195
    Trophy Points:
    63
    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
     
  5. Host NIT

    Host NIT Member

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

Share This Page