Skip to main content
Home
Techies Briefcase
~ by Hari Venu

Main navigation

  • Home
  • Tools
    • Placeholder Image
    • JSON Diff
    • QR Code Generator
    • Random String Generator
    • HTML to PDF Generator
  • About me
  • Photos
  • Search

Breadcrumb

  1. Home
  2. How To Login As Any User In Drupal Site Without Knowing The Password ?

How to login as any user in Drupal site without knowing the password ?

By hari, 27 December, 2022

It is necessary to debug production bug with specific user or role, for that we need password but it is production database the client will not give you the password also you can't reset it. What will be the solution to debug ? drush uli

drush uli

Tested in - Drush version:- 11.4.0


$ drush help uli
Display a one time login link for user ID 1, or another user.

Examples:
 drush user:login                           Open browser to homepage, logged in as uid=1.                                                          
 drush user:login --name=ryan node/add/blog Open browser (if configured or detected) for a one-time login link for username ryan that redirects to 
                                            node/add/blog.                                                                                         
 drush user:login --uid=123                 Open browser and login as user with uid "123".                                                         
 drush user:login --mail=foo@bar.com        Open browser and login as user with mail "foo@bar.com".                                                

Arguments:
 [path] Optional path to redirect to after logging in. 

Options:
 --name[=NAME]                 A user name to log in as.                                                                         
 --uid[=UID]                   A uid to log in as.                                                                               
 --mail[=MAIL]                 A user mail address to log in as.                                                                 
 --browser[=BROWSER]           Open the URL in the default browser. Use --no-browser to avoid opening a browser. [default: true] 
 --redirect-port=REDIRECT-PORT A custom port for redirecting to (e.g., when running within a Vagrant environment)                
 --no-browser                  Negate --browser option.                                                                          

Global options:
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug 
-y, --yes            Auto-accept the default for all user prompts. Equivalent to --no-interaction.                      
-l, --uri=URI        A base URL for building links and selecting a multi-site. Defaults to https://default.             
                     To see all global options, run `drush topic` and pick the first choice.                            

Aliases: uli, user-login

Example

Execute drush uli command then copy the output and paste on browser.

--uri is a drush command option, uri determine the domain.


$ drush uli --name=rahul --uri=https://harivenu.com
https://harivenu.com/user/reset/5/1672520691/Phjmve5mLabX8p7Q4xymk0grHtzyJVxATdsEmuD4NAg/login

Reference
  • https://www.drush.org/latest/commands/user_login/

Tags

  • Drupal
  • Drush
 

Topics

  • Form API
  • Windows
  • Drupal AI
  • Field API
  • Multilingual
  • JavaScript
  • Errors
  • professional development
  • Entity Query API
  • Mac OS
  • Drush
  • URL
  • Webform
  • Cache
  • Solar Power
  • RSA
  • Moderation
  • Coder
  • Bower
  • WSL2
  • Macbook
  • Lando
  • Permission
  • Bash Script
  • PHPSeclib
  • Articles
  • VSCode
  • Taxonomy
  • Drupal Behavior
  • Ajax API
  • Codesniffer
  • Drupal Console
  • phpcs
  • Solar Panel
  • Composer
  • Docker
  • jQuery
  • SEO
  • NPM
  • Workflow
  • Ubuntu
  • Views
  • Jellyfin
  • SSH
  • PHP
  • Android
  • Git
  • Twig
  • website
  • Neuron AI
  • MySQL
  • OOPs
  • kali
  • Commad Line Tools
  • Commad Line
  • Libraries
  • File API
  • Learning
  • Nginx
  • phpcbf
  • Drupal
  • Distribution
  • Linux
RSS Feed

Who am I !!!

Hari Venu V
harivenu.v1992@gmail.com
Mobile : +91 9895164181
Whatsapp : +91 9895164181
Linkedin
Drupal.org
Github

Document
Resume.pdf (114.38 KB)

Online Resume : Online Resume

Work !!!

Fulltime Developer @ QED42
hari.venu@qed42.com
Linkedin

Powered by Drupal & Maintained by Hari