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:

test@test [~]# openssl

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

test@test [~]# openssl
OpenSSL> passwd -1 “test@123”
OpenSSL> quit

Please note the option in command: passwd -1 “test@123”. 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.

test@test [~]# cd /home/support/etc/
test@test [/home/test/support/]#

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

test@test [/home/support/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.

By anup