If your cPanel is not working or license has expired and you want to change cPanel user or FTP password then it can be done using Shell.
The following steps should help you to change / reset / update cPanel password of particular account from shell:
1) Login to server using SSH as root user
2) Execute following command
# /scripts/chpass username password
where
username : cPanel account username
password : new password you wish to set
Note: password should not contain special characters such as #!
3) To sync FTP password, synchronize the new password with the default FTP user
# /scripts/ftpupdate
That’s it! You can now use the new password.