Magento Reset Admin Password

password
In this blog, we will see how you can reset magento admin password in case you have lost it and cannot recover it using Forgot Password option.

We will assume that you have server access to magento i.e database or ftp access.

Using Database

Changing magento password using database is very easy. Open your database in phpmyadmin, and open the “admin_user” table. There you will see a row, with your admin username. Before, resetting the password you need to decide on two things,

  • New Password
  • Salt (any 2 letter word)

In my case i will take my new password to be “yourpassword” and salt to be “XY”. Next go to any md5 generator site and generate md5 of string “XYyourpassword”. The md5 in my case being “e21ffc5b40e40077ba94c5ee63733655″. Now, edit the table row, in admin_user table, for whom you want to change the password. In the password column, put in the md5:salt i.e in my case “e21ffc5b40e40077ba94c5ee63733655:XY” and then save the changes. Now you should be able to login with your new password through admin.

Only FTP Access

To login into magento admin, using only ftp access is a little tricky. Through FTP open the class Mage_Admin_Model_User located at app\code\core\Mage\Admin\Model\User.php
Next find the authenticate() function around line no: 225. Inside the authenticate function, this code is written

$this->loadByUsername($username);


You need to add the line return true; after this i.e

$this->loadByUsername($username);
return true;

And that’s it, now you login in admin using any password. Since, we have skipped the code for password checking, login using any password and then change the password in admin from System -> Permission -> Users.

  • http://www.facebook.com/austinDancer Anup Pandey

    done not work, perhaps new code needed for 1.7

  • http://www.facebook.com/hacker.thiha Kelvin Thomas

    for 1.7.2 is appcodecoreMageAdminModeUser.php on line 336
    Cheers!

  • Hoang Vuong

    Can you write a detail post about “website, group, store view in Magento”? if you can, i need example for your post.
    Nice to wait, thanks you!

  • Manikandan

    you can directly do it in mysql command line by using md5(‘New Password
    ‘)

  • vivek shingala

    very nice!!!!
    working fine brother…