Need to quickly log into a Drupal site (useful for local dev sites) from the command line?
The drush user:login (uli) command generates one-time login URLs, allowing you to access your site quickly.
To log in as the admin user, simply run:
$ drush uli
This will open your site in a browser window, logged in as user 1.
If you prefer to get the login URL without automatically opening a browser, add the --no-browser option:
$ drush uli --no-browser
Need to log in as a specific user?
You can specify the username, user ID, or email address with the --name, --uid or --mail options. For example:
$ drush uli --name=john_doe
By default, Drush will attempt to determine the correct URL for your local site. If it can't, you'll get a partial URL that you can complete manually.
However, you can specify the exact local URL using the --uri option:
$ drush uli --uri=http://mysite.local
With these simple Drush commands, you can streamline logging into your local Drupal site during development. Whether you need to log in as the admin or a specific user account, drush uli saves time and effort.
#drupal #drush
~~~
If you found this post helpful.
♻️ Please repost and follow.
📧 Join my newsletter; link in the first comment.
Watch video Using Drush user:login Command online without registration, duration hours minute second in high quality. This video was added by user WebWash 06 September 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 148 once and liked it 11 people.