Content management systems always have password protection to keep unauthorized users from publishing content on your website, but sometimes you need to protect a directory on your server that contains images, important documents, or other sensitive data. Apache HTTP Server has a built-in function to password protect directories, but it requires some technical expertise. Fortunately, cPanel makes it easy to take advantage of this functionality.
To password protect a directory, login to cPanel and follow these steps:
- In the “Security” section, click “Password Protect Directories” (The file manager may prompt you to choose a default directory. Click the one you prefer).
- Click on the name of the directory you want to password protect
- Check the “password protect this directory” box
- Give the directory a name (This will appear above the login prompt)
- Click “save”
In order to grant access to the directory, you will need to create a user, which you can also do from the same form. It is important to note that this process will password protect the current directory and all sub-directories within it. If that is not your intent, you might want to consider an alternative.
With cPanel, you can password protect as many directories as you want using this easy method. Directories that are protected will have a lock icon next to them. To remove a password protection, click the protected directory and uncheck the same box you used to protect it.
Hosting automation is all about making website and server management easy and efficient. With graphical tools for tasks like password protecting directories, you can focus more attention on content and less on technical matters.