23

Is it possible to change a user's Drupal password from the command-line with Drush?

markdorison
  • 139,374
  • 27
  • 55
  • 71

3 Answers3

40

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"
jhedstrom
  • 3,378
  • 1
  • 23
  • 19
2

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"
Fitz
  • 384
  • 3
  • 14
-2

The Command goes like this:

drush user-password someuser --password="New Password-of yours"

You can change through Drsuh term

Iti Jha
  • 7
  • 1