How do I password protect a directory?
Suppose you have information in the files in your directory that you would wish to share with only a few users and not with the public. Protecting such a directory with a password can help in making the files viewable to a selected few with the corresponding password.
Directory privacy is enabled on your cPanel. You can use this to only allow the authorized users to access certain directories within your server.
1. Log in to your cPanel account.
2. Navigate to Files >Directory Privacy.
The Directory Privacy page will be displayed.
3. Select any folder that you want to protect.
The Setup Privacy page will be displayed. Whenever a user tries to access the protected directory through a browser, the site will prompt them to enter a valid username and password. Without providing these details, no user can access the directory.
4. Enter the name for the protected directory.
5. Click Save.
The name of the protected directory will be saved.
6. In the Create User section, enter the username that can be allowed to access the directory.
7. Enter the password to protect the directory.
8. Re-enter the password for confirmation.
You can also use Password Generator to automatically populate a strong password.
9. Click Save.
The directory is now protected with username and password. Anyone who wants to access this directory should provide these credentials correctly.