Updated: 28 September 2026 · Applies to: cPanel & WHM 138 (WHM, root access)
As root on a cPanel server, you can change any cPanel account's password from the command line, for example when WHM is not reachable.
Change the password
whmapi1 passwd user=USERNAME password='New-Strong-Password'
The output contains result: 1 when the change worked. The password must meet the strength the server requires.
The older command still works on current versions:
ALLOW_PASSWORD_CHANGE=1 /usr/local/cpanel/scripts/realchpass USERNAME 'New-Strong-Password'
Note: Commands with passwords are saved in your shell history. Clear the line with history -d, or start the command with a space if your shell ignores such lines. To change the server's own root password, use passwd instead.