I'm trying to start mongodb(3.0.2) with authentication enabled on mac osx 10.10 from the doc. Starting monodb manually with --auth works and starts without any error. I installed mongodb using homebrew and want to place the auth switch in configuration file. I could not find anything appropriate in Configuration Options. I tried auth: true in the config file but mongodb failed to start.

Anybody has got it working, I'm looking for config file option(rather than --auth) to run mongodb with authentication enabled to prevent anonymous access.

2 Answers 2


It is actually

authorization: enabled

in you config file it needs to be under security: and your config file should look like

  authorization: enabled

For more information see : http://docs.mongodb.org/master/reference/configuration-options/#security.authorization


Close, it's actually this:


Also, if you're running a replicaset and enable the keyfile, it will enable auth as well.

  • Unrecognized option: auth=true, may be this worked upto 2.4.
    – user53864
    May 8, 2015 at 10:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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