How to set authorization in mongodb config file?

mongodb version 3.2

this is the correct config

security:
  authorization: "enabled"

with quotes since the value is a string as per the documentation


For mongod version 2.4 (ini config file)

auth = true

https://docs.mongodb.com/v2.4/reference/configuration-options/#auth

For mongod versions 2.6+ (yaml config file)

security:
    authorization: enabled

https://docs.mongodb.com/v3.2/reference/configuration-options/#security.authorization https://docs.mongodb.com/v3.0/reference/configuration-options/#security.authorization https://docs.mongodb.com/v2.6/reference/configuration-options/#security.authorization