This will show you how to protect a folder in cPanel using password authentication. Anyone who has a password will be able to log in and view contents of this folder. Otherwise they will receive an unauthorized message.
- Log in to your cPanel
- Click the link icon that says Password Protect Directories
- Locate the folder you would like to protect. You can also protect the public_html which will put your entire website under protection. Just remember if you password protect the public_html folder, nothing on the site is accessible until people log in.
- Click the password protect this directory checkbox. You can type a name for the directory if you choose. It is not necessary. Click Save.
- Next, create a login. On the same screen, locate the Create user section. Enter a username and password of choice. Click Add/Modify Authorized User.
- You’re done. Next time you visit the site, you’ll be asked to login with the username and password you just created. You can create more users if you wish.
- To remove password protection you simply uncheck the checkbox in step 4 and Save. Deleting users is optional and might be a good idea if you are no longer using that username and password.