Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save imravichaudhary/a69a064db2b2879023519822b6ec6842 to your computer and use it in GitHub Desktop.
Save imravichaudhary/a69a064db2b2879023519822b6ec6842 to your computer and use it in GitHub Desktop.
Unlock and reset account in Mongo Ops Manager when SMTP not set up

To unlock the account in Mongo Ops Manager when smtp not setup

  • Connect the Mongo Ops Manager AppDB using Mongo Shell
  • Run below command
  • use mmsdbconfig
  • db.config.users.update({"un": ""}, {$set: {"isLocked": false, lastPageView: new Date()}})

To reset the account in Mongo Ops Manager when smtp not setup

  • Click on the reset password link from the ops manager login page
  • Enter your email id and click submit
  • Connect to Mongo Ops Manager AppDB using Mongo Shell
  • Run below command
  • use mmsdbconfig
  • db.config.passwordReset.find()
  • Copy the _id value for the document which contain your email id
  • Go to the follow link
    • http://<OPS-MANAGER-HOSTNAME>:<PORT>/user/reset/password/<Replace-With-_id-value>
  • You should now be able to set your new password
@lozbrown
Copy link

lozbrown commented Jun 18, 2019

This doesn't seem to work if you have authorization set up for your app db

Error: error: {
        "operationTime" : Timestamp(1560852769, 2),
        "ok" : 0,
        "errmsg" : "not authorized on mmsdbconfig to execute command { find: \"config.passwordReset\", filter: {}, lsid: { id: UUID(\"81d7cd07-bbbf-4d0f-b23a-9b0c7d52b6d7\") }, $clusterTime: { clusterTime: Timestamp(1560852751, 4), signature: { hash: BinData(0, 00105AB3A23EAF173F83321E564E1A66FC04CE8D), keyId: 6703782055940980737 } }, $db: \"mmsdbconfig\" }",
        "code" : 13,
        "codeName" : "Unauthorized",
        "$clusterTime" : {
                "clusterTime" : Timestamp(1560852769, 2),
                "signature" : {
                        "hash" : BinData(0,"0aaZG+RYSBMPyMif0bsDQ6pusKw="),
                        "keyId" : NumberLong("6703782055940980737")
                }
        }
}

@imravichaudhary
Copy link
Author

Seems like you don’t have enough access on AppDB. This steps were written considering the fact that you will have access to AppDB.

@synetalsolutions
Copy link

What is the way to unlock the account if two factor authentication is enable.. I have mongops shell access..

@imravichaudhary
Copy link
Author

@synetalsolutions These steps performed when two-factor authentication was disabled. Maybe you can give it a shot and let us know if these steps work with 2FA enabled.

@synetalsolutions
Copy link

These steps performed when two-factor authentication was disabled. Maybe you can give it a shot and let us know if these steps work with 2FA enabled.

which steps..

@imravichaudhary
Copy link
Author

These steps performed when two-factor authentication was disabled. Maybe you can give it a shot and let us know if these steps work with 2FA enabled.

which steps..

Steps listed in this gist: https://gist.github.com/imravichaudhary/a69a064db2b2879023519822b6ec6842#to-unlock-the-account-in-mongo-ops-manager-when-smtp-not-setup

@synetalsolutions
Copy link

I have smtp configured and I also try this db.config.users.update({"un": ""}, {$set: {"isLocked": false, lastPageView: new Date()}}).

But no luck..

@imravichaudhary
Copy link
Author

@synetalsolutions Did you execute the command on mmsdbconfig DB? Also, check the configuration setting for users using db.config.users.find({}).

@imravichaudhary
Copy link
Author

@synetalsolutions I think you should be able to unlock the account using

db.config.users.update({"un": "[email protected]"}, {$set: {"isLocked": false, lastPageView: new Date()}})

Note: Update the un value as per the document.

@synetalsolutions
Copy link

db.config.users.update({"un": "[email protected]"}, {$set: {"isLocked": false, lastPageView: new Date()}})

ok that work thanks @imravichaudhary

@KevinChris7
Copy link

Opsmanager account gets locked often ,so is there any way to avoid it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment