Basic Authentication in cPanel

Updated:

Categories: ,

✅ To Turn ON Basic Authentication for a Directory

  1. Log into cPanel.
  2. Go to “Directory Privacy” (you can find it under the Files section).
  3. Navigate to and click on the directory you want to protect (e.g., public_html/ this is the folder to protect 99% of the time, it blocks the whole site).
  4. On the settings page:
    • Check the box “Password protect this directory”.
    • Give the protected area a name (any label is fine).
  5. Click “Save”.
  6. After saving, click “Go Back”.
  7. Scroll down and create a user and password that will be required to access the directory.
    • Fill in the username and password.
    • Click “Save”.

🔐 Now, when someone tries to access that directory via browser, they’ll be prompted to enter the credentials you just created.

❌ To Turn OFF Basic Authentication for a Directory

  1. Go to “Directory Privacy” in cPanel.
  2. Navigate to the protected directory.
  3. Uncheck the box labeled “Password protect this directory”.
  4. Click “Save”.

👋 This removes the authentication requirement — users can access the directory freely via browser.