Knowledgebase

How to use Leech Protection in cPanel to stop shared passwords

If you protect a folder with a username and password, for example a downloads area for clients or a private area for staff, someone may share their login with many other people. cPanel's Leech Protection detects when one username logs in too many times in a short period and then blocks or redirects it. This guide explains how to use Leech Protection in cPanel and when it is useful.

When Leech Protection works (and when it does not)

  • It works only with folders protected by cPanel's Directory Privacy tool, which uses the browser's username and password pop-up.
  • It does not protect WordPress logins, WooCommerce customer accounts or membership plugins. Those have their own login systems. For WordPress, see how to secure your WordPress website.

Step 1: Protect the folder with a password

  1. Log in to cPanel (how to log in to cPanel).
  2. In the Files section, open Directory Privacy.
  3. Click the folder name to open it, then click Edit next to the folder you want to protect.
  4. Tick Password protect this directory, give it a name (for example "Client downloads") and click Save.
  5. Go back, and in Create User add a username and a strong password for each person who needs access.

Give each person their own username. Leech Protection counts logins per username, so one shared user for everyone would trigger it all the time.

Step 2: Turn on Leech Protection

  1. In the Security section, open Leech Protection.
  2. Click the name of the protected folder (open parent folders if needed).
  3. Fill in the settings:
    • Number of Logins Per Username Allowed in a Two-Hour Period: how many times one username may log in within two hours. The default is 4. A small team or a single client normally needs 4 to 10.
    • URL to Redirect Leech Users to: optional. A page that explains why access was stopped and how to contact you.
    • Send Email Alert to: optional. Your email address, to know when a username is flagged.
    • Disable Compromised Accounts: if ticked, the username is suspended once it goes over the limit. You must re-enable it yourself.
  4. Click Enable.
Tip: Start without Disable Compromised Accounts and with email alerts on. Watch the alerts for a week. Real users sometimes log in from phone, laptop and office, so set a limit that fits normal use before you turn on automatic suspension.

How to re-enable a suspended user

  1. Open Leech Protection and click the folder.
  2. Use the option to manage users and re-enable the suspended username. If you are not sure the person is the only one using it, change the password in Directory Privacy first.

How to turn it off

Open Leech Protection, click the folder, then click Disable. The folder stays password protected through Directory Privacy.

Common problems

  • Real users are being blocked: the limit is too low, or several people share one username. Raise the limit or create separate users.
  • The password pop-up keeps appearing: this is a Directory Privacy issue, usually a wrong password. Reset it in Directory Privacy. If the site uses Cloudflare or a cache plugin, test without them.
  • Your website gives a 500 error after protecting a folder: the folder's .htaccess may conflict with existing rules. See how to use the .htaccess file and how to fix a 500 Internal Server Error.

Frequently asked questions

Can I use Leech Protection on my whole website?

Only if the whole site is behind Directory Privacy. That is rarely a good idea for a public business site, because visitors and search engines would need a password.

Is Directory Privacy secure enough for confidential files?

It is fine for simple private areas, as long as the site uses HTTPS so the password is encrypted. For sensitive company documents, a service such as Google Workspace Drive gives better control. See Google Workspace.

Need help? Open a support ticket or message us on WhatsApp +20 127 113 3655.

  • leech protection, directory privacy, password protect directory, cpanel, security

Was this answer helpful?

0 Users Found This Useful