This guide will help you reset cPanel account passwords using the command line. This is particularly useful for server administrators who need to manage multiple accounts efficiently.
Log into your server via SSH as the root user:
ssh root@<yourserversip>
Enable the allow password change option by exporting it:
export ALLOW_PASSWORD_CHANGE=1
Run the cPanel chpass
script with the cPanel account name and new password:
/scripts/chpass <cpanel_account_name> <new_password>
Replace <cpanel_account_name>
with the actual cPanel account name and <new_password>
with the new password you want to set. Ensure that the new password is secure and randomly generated.
Example:
/scripts/chpass khtechs newpassword
In this example, khtechs
is the cPanel account name and newpassword
is the new password being assigned.
Confirmation:
You will see a warning and a confirmation message indicating that the password has been successfully changed.
ALLOW_PASSWORD_CHANGE
environment variable is correctly set.Log into your server via SSH Terminal as the root user.
ssh root@<yourserversip>
You’ll need to enable the allow password change option, by exporting it. Type or copy and paste the following command:
export ALLOW_PASSWORD_CHANGE=1
Then run the cPanel chpass script with the cPanel account name and new password:
/scripts/chpass khtechs newpassword
khtechs is the cPanel account name and newpassword is the new password being assigned. Remember to use a secure, randomly generated password.
You’ll see a ‘warning’ and confirmation of the password change.