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.

Add IP to Host Access Control using SSH

Discussion in 'Security' started by petru, Feb 20, 2014.

  1. petru

    petru Active Member

    Joined:
    Jul 12, 2013
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hey Guys,

    The inevatible has happened.
    I locked down our server a few months back after a pretty bad security breach.
    I added 3 different IP addresses to the Host Access Control to make sure we can always have access if someones IP changes.

    Unfortunatly We just had a new Modem installed and had our lines restarted today and our IP address got changed.
    and of course the other 2 ip addresses that we had in the Host access control have also happened to change although they were static IP's. So our Host is taking forever to get back to us. We need to gain access to the server,
    And I just remembered that we have VMware access to the server. I've juct logged in via Consol to the Server as Root but I'm unsure as to what i need to enter to add the new IP to the whitelist. or what i can do to pause the HAC service.

    Can someone give me a hand?

    Regards,
    Petru
     
  2. petru

    petru Active Member

    Joined:
    Jul 12, 2013
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Solution to the Problem: Vi in to /etc/hosts.allow
    and edit the file with your new IP Address. Then save it and you can login.
    Google Vi commands to find out how to use Vi editor.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Yes, the rules configured in the "Host Access Control" option of WHM are stored in the /etc/hosts.allow file. I am happy to see you were able to resolve the issue.

    Thank you.
     
  4. myDesignGraphic

    myDesignGraphic Registered

    Joined:
    Dec 9, 2013
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    Hello,

    What do you do when you enter /etc/hosts.allow
    and then it says, -bash: /etc/hosts.allow: Permission denied
    ?


    Thanks,
    Vic
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    "/etc/hosts.allow" is the path to a file name, not a command. You have to use an editor such as "vi". EX:

    Code:
    vi /etc/hosts.allow
    Thank you.
     
Loading...

Share This Page