CPanel / WHM

Resetting email account password from Command line in cPanel

Resetting email account password from Command line in cPanel

1) Login to the server as root via SSH

2) Run the command “openssl” and you will see this:

[email protected] [~]# openssl

3) Now in the OpenSSL prompt give the command : passwd -1 “your_new_email_password”

[email protected] [~]# openssl
OpenSSL> passwd -1 “[email protected]
OpenSSL> quit

Please note the option in command: passwd -1 “[email protected]”. It is not alphabet “-l”. It is numeric “-1”.
You will get the MD5 encrypted format for your password. Copy it somewhere.

4) Now you need to go to cpanel account’s home directory and then into etc folder.

[email protected] [~]# cd /home/test/etc/
[email protected] [/home/test/etc/]#

5) There you will be seeing some files : passwd, passwd,v , quota, quota,v , shadow, shadow,v .
Here the file we should consider is shadow and shadow,v.

6) If you check out shadow folder, you will see

[email protected] [/home/test/etc/]# cat shadow

Please note that the dark black colored part is the password part. You need to replace it with the MD5 format of your new password which you copied from OpenSSL prompt earlier.


Save and close the file.

If shadow,v file is present then replace the encrypted part same as above. If a file is not present then try login to webmail it will work.