You Did Not Sign In Correctly Or Your Account Is Temporarily Disabled


Sometimes, when you try to login to your Magento admin, you will get a message saying “You did not sign in correctly or your account is temporarily disabled”. In this guide, we will show you how to resolve this problem.

 

Solution 1:

 

Using this command for Magento 2.x, we can unlock the admin user if it gets locked.

Connect to the server through SSH and go to Magento root directory then run command the command. You will get a message that the user is unlocked.

php bin/magento admin:user:unlock <username>



Solution 2: 

 

Another option is to create a new user for admin through the command line. Once you are in your root directory of Magento instance, run below command to create a new admin user.

php bin/magento admin:user:create –admin-user=”newadmin″ –admin-password=”NewAdmin123″ –admin-email=”newadmin@gmail.com” –admin-firstname=”New″ –admin-lastname=”Admin″

After this command runs successfully, our new admin user will be created into our Magento website and you will be able to log in using that user.


For Magento 1.x, you will need to create a new user using the below script. Copy and paste it to a new file at the Magento document root create_admin.php and run it with php create_admin.php.

 

<?php

$mageFilename = 'app/Mage.php';

if (!file_exists($mageFilename)) {

echo $mageFilename." was not found";

exit;

}

require_once $mageFilename;

Mage::app();

try {

 

//Create new user by providing details below. Change the details as required

 

$user = Mage::getModel('admin/user')

->setData(array(

'username' => 'newadmin',

'firstname' => 'New',

'lastname' => 'Admi',

'email' => 'newadmin@example.com',

'password' => 'NewAdmin123',

'is_active' => 1

))->save();

} catch (Exception $e) {

echo $e->getMessage();

exit;

}

try {

//Create new role

$role = Mage::getModel("admin/roles")

->setName('Inchoo')

->setRoleType('G')

->save();

 //Give "all" privileges to role

Mage::getModel("admin/rules")

->setRoleId($role->getId())

->setResources(array("all"))

->saveRel();

 } catch (Mage_Core_Exception $e) {

echo $e->getMessage();

exit;

} catch (Exception $e) {

echo 'Error while saving role.';

exit;

}

try {

//assign user to role

$user->setRoleIds(array($role->getId()))

->setRoleUserId($user->getUserId())

->saveRelations();

 } catch (Exception $e) {

echo $e->getMessage();

exit;

}

echo 'Admin User sucessfully created!<br /><br /><b>THIS FILE WILL NOW TRY TO DELETE ITSELF, BUT PLEASE CHECK TO BE SURE!</b>';

@unlink(__FILE__);

?>

  

It is advisable to clear the website cache and session after all these.

rm -rf var/cache/mage*

rm -rf var/session/sess*

 

 

 

  • Magento, disabled, temporarily
  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

503 Error (Service Temporarily Unavailable)

If you see a 503 Service Temporarily Unavailable error, go to the directory you install...

500 Error (Internal Server Error)

If you see a 500 Internal Server Error error, your Disk Space usage is most likely full. You...

Magento Built-In Backup System (Magento Backup)

We do not recommend clients to use the Magento Built-In Backup System (Magento Backup) as there...

403 Error (Forbidden)

If you see a 403 Forbidden error, there can be a few reasons that causes it:-1. Wrong File...

Magento Cron Job

With Magento version 1.8.x and 1.9.x, some users are facing issues where the Magento Cron Job is...