Skip to content

cPanel

Hardening a cPanel account

Practical login, access, and backup steps that reduce the chance of a compromised cPanel site.

Updated Aug 29, 20263 min read11 reads
Hardening a cPanel account
Practical steps to harden a cPanel account

Hardening a cPanel account means tightening logins, limiting file write access, and keeping backups you can restore with confidence. Most compromised sites begin with a stolen or shared password, not a rare exploit. You harden cPanel with unique passwords, two-factor authentication on the main user, API tokens for deploy work, and directories that are not world-writable.

Lock down the cPanel login first

Use a long, unique password stored in a password manager, and turn on two-factor authentication for the cPanel user today. TOTP apps are stronger than SMS, though SMS still beats having no second factor at all. If you ever shared the cPanel password in chat or email, change it right away and sign out other sessions. Protect your domain registrar login with the same care, because that account can redirect the whole site.

Give contractors a jailed FTP or SFTP account limited to one folder, then remove it when the work ends. For scripts and panels such as WHMCS, create a revocable API token instead of handing out the human password. Do not reuse the main cPanel password for WordPress admin, email, or deploy tools.

Reduce what can write to the site

On WordPress accounts, set DISALLOW_FILE_EDIT in wp-config so theme and plugin editors cannot change code from the dashboard. Disable XML-RPC if you do not need the mobile app or remote posting. Delete old copies of the site left in folders such as /old, and remove unused themes and plugins. Prefer updating what you already run over stacking more security plugins on top of a weak login.

  • Need a contractor in: create a jailed FTP or SFTP user, one folder only, then delete it after.
  • Need automated deploy: use an API token or deploy key, not the main cPanel password.
  • Need “more security plugins”: usually no. Keep core, themes, and plugins current first.

Treat backups as part of hardening

JetBackup is part of a hardened account because a clean restore often matters more than a lock you never tested. Backups that exist only inside the same account are easy ransom targets, so keep off-box copies when you can. Restore one ordinary file on a quiet day so you know the process works before you need it in a hurry.

If Imunify quarantines files, do not restore them without checking what they were. Imunify is a strong layer on our shared hosting, but you still need solid passwords, 2FA, and careful access for people and tools. AutoSSL and Let’s Encrypt keep HTTPS current on cPanel; they do not replace login hygiene.

A short checklist you can finish today

  1. Set a unique cPanel password and enable TOTP two-factor authentication.
  2. Replace shared passwords with FTP/SFTP users or API tokens, then revoke old access.
  3. Turn off file editing in WordPress, drop unused installs, and avoid world-writable directories.
  4. Confirm a JetBackup restore of a single file, and keep an off-box copy of critical data.

Work through that list in order. Plugins and scanners help after the account itself is locked down, not before.

Share

Send this article

Need someone else to do this? Send them the link — the commands are in the article.

Was this article helpful?

Be the first to rate this article.