Is it possible to change a user's Drupal password from the command-line with Drush?
Drush is a tool in Drupal 8, which helps perform various tasks like website installation, configuration, and update from the command line. A website may require an update due to several reasons, such as security issues. Choosing to update the modules via conventional methods proves to be time-consuming task.
If you're running Drupal 7, using md5 won't work as passwords are salted. However, if you have drush 4.x, you can use the user-password command:
drush user-password someuser --password="gr3@tP@$s"
Yes. Here's an example for resetting the password of the Drupal admin user given that you know the UserID (uid):
drush sqlq "update {users} set pass=md5('new_password_here') where uid=1"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With