Exception for localhost

It is possible to create users before or after access control is activated. MongoDB supports a localhost exception if you activate access control before establishing any user. This allows you to establish a user administrator in the admin database. Once a user has been created, you must log in as the user administrator to add other users as needed.


How to Enable Authentication on MongoDB ?

Authentication is enforced when access control is enabled on a MongoDB deployment, requiring users to identify themselves. Users can only conduct activities that are defined by their roles when visiting a MongoDB deployment with access control enabled.

The following tutorial utilizes the default authentication approach to provide access control on a solo mongo instance. See Authentication Techniques for a list of all supported authentication mechanisms.

Similar Reads

Administrator of Users

If access control is enabled, make sure the admin database has a user with the userAdmin or userAdminAnyDatabase roles. This user has the ability to manage users and roles, including the ability to create new users, give or revoke roles to existing users, and create or change custom roles....

Exception for localhost

It is possible to create users before or after access control is activated. MongoDB supports a localhost exception if you activate access control before establishing any user. This allows you to establish a user administrator in the admin database. Once a user has been created, you must log in as the user administrator to add other users as needed....

Contact Us