Skip to main content

Block a port on certain IPs using CSF

Comments

4 comments

  • cPanelMichael
    Hello :) There are no native features that allow you to control which IP addresses cpsrvd listens on. Feel free to submit a feature request for this via: Submit A Feature Request As a workaround, you would have to use a firewall to restrict access to the cPanel ports for particular IP addresses. You may want to ask on the CSF forums if you don't receive user-feedback for specific rules. Thank you.
    0
  • DanH42
    I asked this question on the CSF forums last week, but haven't heard anything back. I was hoping maybe someone here would have a solution, since the cPanel forums are generally more responsive. I'll look into a feature request for the issue.
    0
  • quizknows
    Should be able to do it with CSF. in /etc/csf/csf.deny: tcp|in|d=2087|d=123.123.123.2
    This would deny port 2087 on 123.123.123.2 but not other IPs allocated to the server. Create more rules to block other ports on other specific IP addresses. Keep in mind if your remote IP is in csf.allow you'll bypass csf.deny; test from a non-whitelisted IP. I just checked with this rule on my server and it works fine to deny WHM on the non-main IP.
    0
  • DanH42
    Thanks, that's exactly what I was looking for!
    0

Please sign in to leave a comment.