Script to change password of all cPanel accounts

Need our help to fix the issue for just 20$ ? Buy an hour Now

Here is a bash script to update password of all cPanel Accounts

#! /bin/bash
rm New-Password.txt
echo " " >> New-Password.txt
echo " " >> New-Password.txt
echo "======================================" >> New-Password.txt
echo "Thank you for using iServerSupport.com" >> New-Password.txt
echo "======================================" >> New-Password.txt
echo " " >> New-Password.txt
echo "Passwords of all your cPanel account has changed below are the new passwords" >> New-Password.txt
echo " " >> New-Password.txt
cat /etc/domainusers|awk -F: '{print $1}' | while read user; do
pass=`</dev/urandom tr -dc A-Za-z0-9 | head -c 20`
echo $user $pass >> New-Password.txt
/scripts/realchpass $user $pass > /dev/null
/scripts/ftpupdate > /dev/null
done
echo " " >> New-Password.txt
echo " " >> New-Password.txt
cat New-Password.txt

Create a file called changepassword.sh and copy above contents into it

vi changepassword.sh

Give execution permission for the file

chmod +x changepassword.sh

Run the script

sh  changepassword.sh

Monthly server support with Unlimited tickets, 24×7 monitoring, Security Audit and lot more for just $59

Server Management at just $59

Leave a Reply

Your email address will not be published. Required fields are marked *