0

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.

4

It is actually

authorization: enabled

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

net:
  bindIp: 127.0.0.1
security:
  authorization: enabled

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

| improve this answer | |
0

Close, it's actually this:

auth=true

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

keyFile=/etc/mongod.keyfile
| improve this answer | |
  • Unrecognized option: auth=true, may be this worked upto 2.4. – user53864 May 8 '15 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.