Anyone, please help me with how to disable the Two-factor Authentication module using a command-line.



please run below command in terminal Magento root path :

bin/magento module:disable Magento_TwoFactorAuth
bin/magento cache:flush 
| improve this answer | |
  • +1 accepted. ... yes thanks for the answer.. – MageSoftech Jul 31 at 16:33
  • i would not recommend to force disable the module, rather use new module which extend the configuration so there should always be an option to control the configurations from admin panel. – Zeeshan Khuwaja Aug 14 at 4:02
  • @ZeeshanKhuwaja it's useful to disable this in development to avoid having to perform 2FA on your development machine when logging into admin. I wouldn't disable in production as it's a useful security feature. – BugHunterUK Sep 5 at 19:50

Mark Shust created a module for this purpose which is developer-friendly while keeping secure defaults in place; ref his comments about it

| improve this answer | |
  • Definitely the better option to use this module than to generally disable 2FA. – codedge Sep 12 at 16:55

I found a way, by adding a system configuration to Enable/Disable it. I made a module, you can download it with composer:

composer require wolfsellers/module-enabledisabletfa

Or check it at: https://github.com/wolfsellers/module-enabledisabletfa

| improve this answer | |
  • You have copied same answer to two questions, please do some changes at content to make two answers are different – Amit Bera Aug 6 at 9:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.