How to Password Protect a Directory in cPanel

Overview: How to Password Protect a Directory in cPanel

This guide explains How to Password Protect a Directory in cPanel step‑by‑step and why it matters for security, uptime, and performance. It’s written for small and medium businesses that rely on Blackhawk MSP for proactive, managed IT support in the Bay Area and beyond.

  • ✅ Clear, actionable steps
  • ✅ Best‑practice notes from our MSP engineers
  • ✅ Links to related services and help
Tip: If you’re short on time, contact us — we’ll handle this for you and verify everything is working.

You can lock a directory with a password using the cPanel's Directory Privacy.


1. Log in to your cPanel account.


2. In the Files section, click on Directory Privacy.


3. Click on the directory to open it.


4. Click on the Edit, showing next to the directory you want to protect.


5. Under Security Settings, check-mark Password protect this directory. Then click on Save.


6. Now click on Go back.



7. Scroll down the page. Under Create User, fill in the username and password fields or use the Password Generator option to generate a new random password and copy it to Notepad. Click on Save.



If you try to open the password-protected directory in your browser via the URL www.example.com/myfolder, your browser prompts for credentials.

You have password protected a directory in cPanel to add an extra layer of security to your website content.

Video tutorial temporarily unavailable while we refresh links. If you need more help, please call us at 1-925-218-4000.


Need help? Blackhawk MSP can do this for you, verify success, and document the change. Call 1‑925‑218‑4000 or open a ticket.

  • 0 Usuários acharam útil
Esta resposta lhe foi útil?

Artigos Relacionados

How to Block an IP Address to Deny Access to Your Website

Overview: How to Block an IP Address to Deny Access to Your Website This guide explains How...

How to Protect Website Images From Being Displayed at an External Website

Overview: How to Protect Website Images From Being Displayed at an External Website This...

How to Block Any IP Address via an htaccess Rule

Overview: How to Block Any IP Address via an htaccess Rule This guide explains How to Block...

How to Disable Directory Browsing Using the htaccess Rule

Overview: How to Disable Directory Browsing Using the htaccess Rule This guide explains How...

How to Protect the htaccess File

Overview: How to Protect the htaccess File This guide explains How to Protect the htaccess...

Powered by WHMCompleteSolution