How to password protect directories on cPanel
Sometimes you want to password-protect documents to ensure that unauthorised users can't access them. Thankfully, cPanel has a feature to password-protect directories with a username and password!
You can also IP whitelist directories, follow our guide here on this.
- Log into cPanel. If you're unsure, take a look at our Logging In To cPanel guide.
- Once logged in, head over to
Files
, and thenDirectory Privacy
.
- Once there, you'll see a folder tree of all the directories on your cPanel account, you can click on their name to navigate down the folder structure.
- Navigate to the folder you want to password protect and click
Edit
.
- On this page, select
Password protect this directory
. You can change theName
to something which makes sense to you, or leave it default, then pressSave
.
- You should get a success message stating that you have set the access permissions.
- Press
Go Back
, and it'll bring you to theSet permissions for “yourdomain.tld”.
page. Now we will create the user.
- Under
Create User
, enter in the username you want, and a secure password twice. Then, pressSave
.
- You will now see a success message.
10, Press Go Back
, and check that your user is under Authorised Users
.
- Done! Your directory is now username and password protected. When a user attempts to access the directory, they will get a prompt to login with their username and password before being allowed to proceed.
Updated on: 18/11/2024
Thank you!