Sometimes, you don’t have access to a GUI but you got yer grubby little paws on a terminal. I’ve had several of these occasions and have had to reset email passwords for clients.

How do we do this? Pretty easy, guys:

First, let’s set the scene:

The domain is :
Cpanel username is : zz9usr
Email account is :

We want to reset the password for from the command line

Step 1:

Log into the server in question and switch user to root.

Step 2:

Type in the following command:


You should see the following (or similar) prompt:

zz9usr@example [~]# openssl


Step 3

Type in:

passwd -1 "your_new_email_password"

Where “your_new_email_password” is replaced with the password of your choice:

OpenSSL> passwd -1 “ThisIsMyNewPassword”


OpenSSL> quit

PLEASE NOTE: The option in the command (-1) is not the lower case L in the alphabet(l), but it is the numeric one (1)

The above command will give you the MD5 encrypted format version of your password, write it down somewhere exactly as is.

Step 4

Change to the Cpanel account home folder,

Change to the etc folder within the Cpanel account home folder:

zz9usr@example [~]# cd /home/zz9/etc/
zz9usr@example [/home/zz9/etc/]# 

If you do a list within the current working folder, you’ll see a couple of files and among them will be:

passwd, passwd,v , quota, quota,v , shadow, shadow,v

Step 5

We’re working with the following files:



Let’s open it up with nano:

nano shadow

Look for the line containing the username that we are looking for, in this specific case it would be “example” and it would like similar to this:


The part between the first colon and the second colon would be the password that we want to update. Replace the string with the MD5 password string that you copied down earlier:

example: $1$8K8Ou607$6glWjTx8ZuLU6F8pSyc8i1 :16673::::::

Save and close the file.

Step 6

Open up the shadow,v file with your favourite editor, for this example we will use nano

nano shadow,v

Look for the entries that match the email account that you are modifying, in this case it is “example”:

@”Modified by /usr/local/cpanel/cpanel “

Replace the above with the same details as per the shadow file:

@”Modified by /usr/local/cpanel/cpanel “

Save the file, exit the file and you’re all done!

Log into the webmail portion and win.

If you get stuck, please let me know.

What do you think of this post?
  • Sucks (0)
  • Boring (0)
  • Useful (0)
  • Interesting (0)
  • Awesome (0)