If you need to mass reset the password for your Drupal users, drush can help you. The drush command to reset a user’s password is:
drush upwd username --password="newpassword"
Now, let’s say you need to reset 100 user’s passwords.
- Create a file named accounts with all usernames you want to reset , one user per line.
- Run any of the following command:
while read line; do drush upwd "$line" --password="newpassword"; done < accounts.txt
for i in $(cat accounts); do echo update password for $i; drush upwd $i --password="newpassword"; done