Cpanel Security

Disable Direct Root Login Where Appropriate – Cpanel Security

26 Sep 2026 2 min read

Disabling direct root login forces a more secure authentication path. Learn when and how to implement this hardening step safely.

What Direct Root Login Means

Direct root login allows someone to authenticate straight into the root account via SSH using just the root password. This is convenient but risky, since it’s also the exact login method automated brute-force bots target most aggressively.

Why Disabling It Helps

By disabling direct root SSH login and requiring administrators to log in as a standard user first, then elevate privileges with sudo, you add an extra identity-verification step and create an audit trail showing exactly which user escalated to root, rather than an anonymous “root” login.

How to Disable Direct Root SSH Login

  1. Connect to your server via SSH as root (one final time) or through WHM’s terminal feature.
  2. Open the SSH configuration file, typically located at /etc/ssh/sshd_config.
  3. Locate the line PermitRootLogin yes and change it to PermitRootLogin no.
  4. Ensure at least one non-root administrative user exists with sudo privileges before saving.
  5. Restart the SSH service to apply changes: systemctl restart sshd.
  6. Test by attempting to log in as root directly (it should fail) and then as your sudo user, elevating with sudo -i.

When to Be Cautious

  • Confirm your sudo user works correctly before closing your current root session, to avoid being locked out.
  • On managed hosting where WHM manages SSH configuration, check with your provider before making manual changes.

Long-Term Benefit

Disabling direct root login doesn’t eliminate root access — it simply forces every root action to pass through an identifiable, auditable user account first, which is a meaningful gain for both security and accountability.

Get a free quote for your project.

Tell us your goal - a faster site, more leads, or a security check - and we will reply with a clear plan and price.

Achi Systems · Madonna House, Westlands, Nairobi

Reach us directly