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!

preventing being locked out from system?

Discussion in 'General Discussion' started by Mo, Oct 15, 2003.

  1. Mo

    Mo Active Member

    Nov 21, 2001
    Likes Received:
    Trophy Points:
    Is there any sure way of preventing a firewall / iptables from locking up and not allowing anyone access to the server via SSH? I remember a cron script running might help but cant seem to find it?

    Any help is appreciated! Support Ticket Number:
  2. haze

    haze Well-Known Member

    Dec 21, 2001
    Likes Received:
    Trophy Points:
    If you aren't very familiar with iptables you might want to get a script to help you manage it. I use and recommend APF from You can add your IP to the allow_hosts.rules script which will allow access from your IP. Support Ticket Number:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. hostit1

    hostit1 Well-Known Member

    Jul 24, 2003
    Likes Received:
    Trophy Points:
    I think I know what you mean. Possibly

    Are you running into the problem of creating a firewall rule, applying it, then being locked out?

    Create a small sh script with the following:

    service iptables start
    sleep 10
    service iptables stop

    chmod it 755

    Run it by typing in ./filename

    What it will do is start ip tables for 10 seconds, then it will kill the service. If you get locked out, then you know that there is a issue with your rule.
    In 10 seconds, you should be able to ssh back into the box and fix the rule. If after you apply then start the iptables service and you don't get locked out, then you can do a service iptables start

    This is what i do at least.


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