There might be a situation where you would have to change multiple account passwords on
 a cPanel server. The following script would be of help in changing the passwords of entire accounts in cPanel. 

#!/bin/bash
export ALLOW_PASSWORD_CHANGE=1
for i in `cat /etc/trueuserdomains | cut -d " " -f 2`;
 do
   pass=`openssl rand -base64 128 | head -c16 | xargs`
   echo $i:$pass >> pass.txt
   /scripts/realchpass $i $pass;
 done;
/scripts/ftpupdate

Was this answer helpful? 0 Users Found This Useful (0 Votes)