By applying cPanel “Password Protected Directories You can lock directory with a password.

1. Log into your cPanel account.
2. In the “Security” area, press on “IP Blocker” Icon.

chwkb-ip-deny-manager-icon

3. Under “Add an IP or Range” you should fill the IP Address you want to block.
4.Press on the “Add” button.

chwkb-denyip

Here is Example:
Single IP Address: 192.168.0.1
Range: 192.168.0.1-192.168.0.40
Implied Range: 192.168.0.1-40
CIDR Format: 192.168.0.1/32
Implies 10.*.*.* — 192.