How to change cPanel account password through ssh?

Share it:


You might face issues like, you need to reset the cPanel account password and you are not able to access WHM or cPanel .

Here, cPanel account name is abc (for example).

1. Login to your server as root.

login as: root
root@server.domain.com
password:

Last login: Tue Feb 20 03:19:36 2017 from x.x.x.x

2. Run following command

root@server [~]# /scripts/chpass abc 12345234

Here:

abc:- The cPanel account username for which we need to change password.

12345234 :- New password. Make sure you set strong password.

After you execute this command, you might get following message.

warn [realchpass] Insecure passing of password on ARGV. ERROR: /usr/local/cpanel/scripts/realchpass Invocation changes only the system password and does not have any effect on other services associated with your cPanel account, including FTP, SSH, and WebDAV. It is strongly encouraged for you to change the password via the WHM & cPanel interface. You can force a password change through this script by setting the environment variable ‘ALLOW_PASSWORD_CHANGE=1’.

It generally shows this warning to make you understand that above mentioned command does not change password for FTP, SSH, and WebDAV hence it’s recommended to change password from whm itself.

To resolve it, just run following command.

root@server [~]# export ALLOW_PASSWORD_CHANGE=1

Run above command again.

root@server [~]# /scripts/chpass domain 12345234
warn [realchpass] Insecure passing of password on ARGV.
Password for “domain” has been changed.

We have changed password for the cPanel however we must sync FTP password too.

So here is the command.

root@server [~]# /scripts/ftpupdate
Updating FTP passwords for all users
FTP password files updated.
FTP vhost passwords synced

You are all set!!
Share it:

Post A Comment:

0 comments: