MongoDB Documentation, Release 3.0.4 Related Documents Additional Resources Add a User to a Database Overview Considerations Prerequisites Changed in version 2.6. Each application and user of a MongoDB system should map to a distinct application or administrator. This access isolation facilitates access revocation and ongoing user maintenance. At the same time users should have only the minimal set of privileges required to ensure a system of least privilege . To create a user, you must define the user’s credentials and assign that user roles (page 325). Credentials verify the user’s identity to a database, and roles determine the user’s access to database resources and operations. For an overview of credentials and roles in MongoDB see Security Introduction (page 317). For users that authenticate using external mechanisms, 70 you do not need to provide credentials when creating users. For all users, select the roles that have the exact required privileges (page 325). If the correct roles do not exist, create roles (page 388). You can create a user without assigning roles, choosing instead to assign the roles later. To do so, create the user with an empty roles (page 416) array. To create a user on a system that uses authentication (page 320), you must authenticate as a user administrator. If you have not yet created a user administrator, do so as described in Create a User Administrator (page 384). $^{67}$https://www.mongodb.com/lp/white-paper/mongodb-security-architecture?jmp=docs $^{68}$http://www.mongodb.com/webinar/securing-your-mongodb-deployment?jmp=docs $^{69}$https://www.mongodb.com/presentations/creating-single-view-part-3-securing-your-deployment?jmp=docs 70 Configure MongoDB with Kerberos Authentication on Linux (page 372), Authenticate Using SASL and LDAP with OpenLDAP (page 369), Authenticate Using SASL and LDAP with ActiveDirectory (page 366), and x.509 certificates provide external authentication mechanisms. Chapter 6. Security 386 • Authentication (page 320) • Security Introduction (page 317) • Enable Client Access Control (page 357) • Access Control Tutorials (page 356) • Security Architecture White Paper 67 • Webinar: Securing Your MongoDB Deployment 68 • Creating a Single View Part 3: Securing Your Deployment 69