How to Add a Host Access Control Rule in WHM

May 11, 2022 / cPanel & WHM

A security feature in WHM called Host Access Control enables you to grant, deny, or prevent access to particular services on your server according to IP address or network. This helps in preventing unwanted access to services like SSH, FTP, cPanel, and WHM.

Follow the steps:

  1. Log in to WHM.
  2. Select the “Security Center” section.
  3. Click on the “Host Access Control” sub-option.
    host access control
  4. Adding a Rule:
    add rule

    1. Port Number (for newer systems, such as AlmaLinux 8+).
      Example ports:

      1. WHM: 2087

      2. cPanel: 2083

      3. SSH: 22
        (Check your server’s service ports if custom.)

    2.  Enter IP Address or CIDR
      1. A single IP (e.g., 203.0.113.5)

      2. CIDR subnet (e.g., 192.168.1.0/24)

      3. Wildcards can also be used.

    3. Protocol
      Choose TCP or UDP depending on the service (most are TCP).
      tcp/udp
    4. Select Action:
      REJECT – block traffic with an error response
      DROP – block traffic silently
      ACCEPT – allow the IP(s) access
      reject

    5. Save the Rule by clicking ‘Add Rule’.
      add rule

This way, Host Access Control in WHM lets you secure server services by allowing or blocking access based on IP addresses. It is essential for hardening SSH, WHM, FTP, and other service access and must be used carefully to avoid accidental lockouts.

Feel free to contact eukhost support staff.

Spread the love