How to Reset Drupal Admin Logins via SSH

The steps below only apply to Drupal websites installed in Virtual Private Servers (VPS) and dedicated hosting servers.  

Drupal 9 

Follow the steps below if you have Drupal website version 9 or later.  

  1. Connect to SSH on your Windows computer or on your Mac computer.   
  2. Access the file directory of the website by entering the command below. Replace public_html with the correct file directory of your website if it is not in the public_html folder.  
    cd ~/public_html  
  3. Press Enter key on your computer. 
  4. Enter the command below. Replace the newpassword with your new password for Drupal login and replace admin with its username. 
    drush upwd admin "newpassword"  
  5. Press Enter key on your computer. 

Drupal 8 

Follow the steps below if you have Drupal website version 8. 

  1. Connect to SSH on your Windows computer or on your Mac computer.   
  2. Access the file directory of the website by entering the command below. Replace public_html with the correct file directory of your website if it is not in the public_html folder.  
    cd ~/public_html  
  3. Press Enter key on your computer. 
  4. Enter the command below. Replace the newpassword with your new password for Drupal login and replace admin with its username. 
    drush upwd admin --password=”newpassword”  
  5. Press Enter key on your computer. 

If your Drupal website version is not mentioned above try other ways to reset your Drupal admin logins.  

Try accessing your Drupal admin page with the new logins via the link yourdomain.com/user/login (replace yourdomain.com with the domain of your website) or via Softaculous Apps Installer in cPanel.

Do not hesitate to contact our Singapore or Australia Support Team if you have further questions. 

(Visited 177 times, 1 visits today)