0

How do you login to a Drupal site if you do not have the password of the admin user or user 1 but still have access to the command line? Can I use Drush to log in to the Drupal site?

3

You can log in to any Drupal site if you have access to the command line and Drush, knowing either the username

$ drush uli username --no-browser

OR the user ID.

$ drush uli --uid 123 --no-browser

This will return you an URL that you can copy paste into your browser address bar and login as that user. You can leave out the --no-browser option when you want the command to directly launch the browser.

| improve this answer | |
  • 1
    To update the domain, use --uri like this: drush uli username --uri=http://example.com. – hotwebmatter Oct 31 '19 at 1:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.