🚀 Welcome to MDriven Learn –  Don’t miss the latest Release Notes.
MDrivenServer, Lost password or locked out


This text describes the scenario when you control your MDrivenServer yourself - there is also the option to manage a MDriven installation via the portal.mdriven.net - and from there you can restart, reinstall, change, or unlock the password via API.

1. Create PwdReset.txt File (Recommended)

Reset the password for User 'a' with a PwdReset.txt file on the MDriven Server by creating the file with only the new password in it and saving it in the <MDriven Server>/App_Data folder. The password will be reset on the next restart, and the PwdReset.txt file will be deleted automatically.

NOTE: Whenever you reset your password using PwdReset, don't forget to update it in the MDrivenServerOverride.xml file, as the Turnkey will try to connect to the MDriven Server with the wrong password and it will be locked out.

Whenever the PwdReset.txt is used, we also turn on the TurnOffRegistration - blocking new users from gaining access to the server. This is also the main way the new Azure deploy tool hardens your MDrivenServer on deploy and refresh.

MDrivenServer, opening the built-in database

2. Updating the Admin Database

If you have been locked out or forgotten the password to your MDrivenServer, you can stop the web server, copy the database file, and edit it.

  • On a Windows installation, stop the web server using IIS Manager.
  • On Azure, stop your site and then use the Advanced Tools to download the database file.

The database file is located in __MDrivenServer/App_Data/DatabaseCompact.sdf

Once downloaded, use the procedure here to open the database.

In the table Admin_ASP_Users, set IsLockedOut to 0 (false) if you have been locked out.

To reset the password, copy the Password field from another installation for which you know the password, and this will set it.

Once done, upload the database file again and restart the website or IIS.

Best practice set up MDrivenServer security

  1. MDrivenTurnkey will always use an account named "a" - the default pwd is 123456 on install
  2. Add another admin account to the MDrivenServer so that if "a" is locked out you still have admin access (registry page)
  3. After you have at least 2 accounts, one of which is "a", you should turn off registration of new accounts (admin page)
  4. Set up roles on your accounts in the MDrivenServer to limit what the account can do - SuperAdmin is unlimited (admin page)
  5. Change the passwords on your accounts and keep them secure (admin page)
  6. Decide if unrestricted access from internet is right for you or not and take steps; possibly put the MDrivenServer behind a firewall, only letting the turnkey frontends in, but make sure you still have access as the admin account.
  7. The Turnkey application will look for the MDrivenServer in a relative path __MDrivenServer , and use the "a" account and password given in APP_Data/TurnkeySettings(_extra, _override).xml, if your MDrivenServer is not placed relative to your Turnkey frontend you instead give the url and pwd in APP_Data/MDrivenServerOverride.xml
  8. If you forget or omit updating the pwd in Turnkey, the Turnkey will quickly use up the 5 attempts of login as "a" and then the "a" account will become locked. See above ways to unlock an account

To manually update the password

You can log in - go to settings/users - select a user whose password you know and update it to a new one in this ui:

x

Init logic - MDrivenServer

When the MDrivenServer starts, it looks for an App_Data/DatabaseCompact.sdf. If none is found, it copies App_Data/DatabaseCompact_TkStartDb.sdf to App_Data/DatabaseCompact.sdf and tries again.

The App_Data/DatabaseCompact_TkStartDb.sdf is the template DB used for new installations.

It has a user named "a" with pwd=123456. The pwd is replaced by the Portal in cloud scenarios.

See also: MDrivenServer, opening the built-in database