MongoDB Documentation, Release 3.0.4 Configure MongoDB Step 1: Add user to MongoDB for authentication. Add the user to the $external database in MongoDB. To specify the user’s privileges, assign roles (page 324) to the user. db.getSiblingDB("$external").createUser( { user : <username>, roles: [ { role: "read", db: "records" } ] } ) For example, the following adds a user with read-only access to the records database. Add additional principals as needed. For more information about creating and managing users, see http://docs.mongodb.org/manual/reference/command/nav-user-management . Step 2: Configure MongoDB server. To configure the MongoDB server to use the saslauthd instance for proxy authentication, start the mongod with the following options: • --auth , • authenticationMechanisms parameter set to PLAIN , and • saslauthdPath parameter set to the path to the Unix-domain Socket of the saslauthd instance. Configure the MongoDB server using either the command line option --setParameter or the configuration file . Specify additional configurations as appropriate for your configuration. If you use the authorization option to enforce authentication, you will need privileges to create a user. Use specific saslauthd socket path. For socket path of /<some>/<path>/saslauthd , set the saslauthdPath to /<some>/<path>/saslauthd/mux , as in the following command line example: mongod --auth --setParameter saslauthdPath=/<some>/<path>/saslauthd/mux --setParameter Or if using a YAML format configuration file , specify the following settings in the file: Or, if using the older configuration file format$^{57}$: security: authorization: enabled setParameter: saslauthdPath: /<some>/<path>/saslauthd/mux authenticationMechanisms: PLAIN auth=true setParameter=saslauthdPath=/<some>/<path>/saslauthd/mux setParameter=authenticationMechanisms=PLAIN Use default Unix-domain socket path. To use the default Unix-domain socket path, set the saslauthdPath to the empty string "" , as in the following command line example: mongod --auth --setParameter saslauthdPath="" --setParameter authenticationMechanisms=PLAIN Or if using a YAML format configuration file , specify the following settings in the file: $^{57}$http://docs.mongodb.org/v2.4/reference/configuration-options 368 Chapter 6. Security