Drupal - How can I change a user's password?

In Drush 9, the command is drush user:password USERNAME "SOMEPASSWORD"; its aliases are user-password and upwd.

In Drush 8 (and earlier) the command is drush user-password USERNAME --password="SOMEPASSWORD"; its alias is upwd.


You can execute drush uli, this will generate a one time login link. By default it provides one-time login link for administrator.

If you execute drush uli some-username, this will generate one time login link for that user.

UPDATE:

You can also use drush upwd for updating the password. Use it like this drush upwd --password=<new password> <some-username>


If you are using Drush 4, you can use the user-password command.

drush user-password usernamehere --password="newpasswordhere"

Tags:

Drush

Users