You can lock directory with a password by using the cPanel Password Protected Directories option.
- Log into your cPanel account.
- In the Security section, click on the IP Blocker Icon.
- Under Add an IP or Range, you should enter the IP Address you wish to block.
- Click on the Add button.
Here is an Example:
Single IP Address: 192.168.0.1
Implied Range: 192.168.0.1-40