change multiple accounts password

If your server is hacked or stolen your accounts password, you can use the following script to change all the cpanel accounts password. Change password via WHM and scripts.

WHM >> Account Functions >> Force Password Change then Select All,

then Submit

Change multiple accounts password via the following script /scripts/realchpass

The syntax is

/scripts/realchpass username password


Change multiple accounts password

Method : 1

Use the following shell script to change all the cpanel account password randomly.

vi /root/

#! /bin/bash
ls -1 /var/cpanel/users | while read user; do
pass=`strings /dev/urandom | tr -dc .~?_A-Z-a-z-0-9 | head -c16 | xargs`
echo “$user $pass” >> new-pass.txt
/scripts/realchpass $user $pass

Save and excute that file.

chmod +x /root/

sh /root/

You can use random string generate scripts like the following generate passwords.

pass=`date | md5sum | head -c16 | xargs`
pass=`openssl rand -base64 128 | head -c16 | xargs`
pass=`strings /dev/urandom | tr -dc .~?_A-Z-a-z-0-9 | head -c16 | xargs`

In some cases when executing /scripts/realchpass script will showing the following error.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

cPHulk Brute Force Protection

WHM/cPanel has a service, protected from Brute Force attack, which is called “cPHulk Brute Force...

Enable SSH key authorized login without root password

You need to generate SSH Key ( the private key )on your cpanel server and then update remote...

How can I Redirect URLs in cPanel

Login your cpanel 1. Click the Redirects button on the front page under the “domains” 2. Enter...

Enable Custom php.ini for Fast CGI

With fast-cgi, custom php.ini needs to be in the cgi-bin folder. 1) Move php.ini to cgi-bin...

ConfigServer Firewall CSF installation

ConfigServer firewall is a popular linux firewall security suite. It is easy to install, flexible...

Powered by WHMCompleteSolution