Search Knowledge Base by Keyword
How to set Directory Privacy in cPanel
Directory Privacy allows you to protect a specific directory with a password, to prevent unauthorized users from accessing the directory through a web browser.
Once you enable this feature for a directory, whenever the user attempts to view that directory, the system asks for a login. This feature does not protect directories that users access via FTP, SFTP, Web Desk, or other access when they access files locally
Let’s see how we can set up this setting on cPanel.
First, log in to the cPanel control panel.
Now navigate to Directory Privacy in the Files section.
You’ll now see a list of the directories in your hosting account.
To select a directory to set directory privacy on, just click the name of the directory.
Now you need to fill in the name for the protected directory, as well as the login details for the new user that should have access to the private directory when they access it through their web browser.
Once you’re done, click Save to finish saving your changes.
When you attempt to access this directory from a web browser, you’ll now be prompted the enter the username and password for the user that you created, before being able to access the directory.