Restrict access to your server's management and communication services to specific IP addresses to enhance security. This procedure allows a WHM Server Administrator to limit who can access cPanel, WHM, SSH, FTP, and Mail services by implementing IP restrictions.
Before you begin
You will need:
Root access to the WHM interface
The specific IP addresses you wish to allow or block
A clear understanding of the services you wish to restrict
Restrict access by IP address
Log in to WHM.
Navigate to ConfigServer Security > CPacket/IP Restriction (or the equivalent ConfigServer Security module).
Select the specific service you wish to restrict (e.g., cPanel, WHM, SSH, FTP, or Mail).
Enter the IP addresses or ranges allowed to access the service.
Select Save or Apply.
Warning: Incorrectly entering your own IP address or the IP range of your office will result in an immediate lockout from the server management tools. Always verify your current IP address before applying restrictions.
Confirm the result
Verify that the service is only accessible from the authorized IP addresses.
Attempt to access the service from an unauthorized IP address; it should be blocked or rejected.
Confirm that your management tools (WHM/cPanel) remain accessible from your known, authorized IP.
If you are locked out of the server
If you are unable to access WHM or other services due to an incorrect IP restriction:
Connect to the server via a console (such as a VPS dashboard or physical terminal).
Access the command line and identify the restriction rules.
Remove the restrictive rules or add your current IP to the allowed list.
If you cannot resolve the issue via console, contact Hostek support for assistance in restoring access.
Limitations
This procedure does not replace the need for strong passwords or two-factor authentication.
Changes to IP restrictions may take a few moments to propagate across all services.
If you use a dynamic IP address, your access may be interrupted when your ISP changes your assigned IP.
