How to Reset a Webmail (cPanel Email) Password via CLI (Command Line Interface)?

  Uncategorized

Introduction

While managing a WHM/cPanel server, you may encounter a situation where a user forgets their webmail (email account) password but doesn’t have cPanel access to reset it. In such cases, the easiest method is to reset the email password directly through the server using SSH/CLI. This is fast, secure, and doesn’t require logging into the cPanel interface.

Prerequisites:

  • SSH access to the server (root or sudo privileges).
  • cPanel/WHM installed and running on the server.
  • The email account (username@domain.com) we want to reset must already exist.
  • Basic familiarity with Linux command-line operations.

Implementation

Step1:

Login to your server via SSH as root

$ ssh root@server-ip

Step 2:

Use the following command structure.

$ uapi –user=$CPANELUSER Email passwd_pop email=$EMAIL_NAME password=$NEW_PASSWORD
  • cPanel User: example
  • Email Account: info@example.com
  • New Password: NewPass@123

Note: Make sure the new password meets the server’s password strength policy.

Conclusion:

Resetting a webmail password through WHM is not always possible if you don’t have access to the user’s cPanel account. In such cases, CLI proves to be a powerful and reliable solution. Using the UAPI command, administrators can quickly reset any email password securely without needing UI access. This method is ideal for rapid support actions and secure server management.

FAQs

1. Can I reset a cPanel email account password using the command line?

Yes. A cPanel email account password can be reset from the command line using WHM API/UAPI with root access.

2. Do I need root access to reset a cPanel email password?

Yes, if you are resetting the password for another cPanel account’s email address through the server CLI, you generally need appropriate WHM/root privileges.

3. Can I reset the password without accessing Webmail?

Yes. The password can be reset directly from the server command line without logging in to the Webmail interface.

How to List Email Accounts in cPanel via the Command Line? – PheonixSolutions Knowledge-Base

How to Increase Email Account Disk Quota Using WHM API? – PheonixSolutions Knowledge-Base

Talk to our experts:

Have a technology challenge or looking for the right solution for your business? Our team can help you with cloud, DevOps, development, infrastructure, design, and more. Feel free to reach out to our experts here.

LEAVE A COMMENT