Details
-
Task
-
Resolution: Duplicate
-
Minor - P4
-
None
-
None
Description
It should be more clear on what the order of operations is to create a new read only user with auth enabled.
---------
How to add a new read only user when you have authentication enabled:
1. Make sure there is already a user in the admin database:
-start mongod without the --auth flag
-start up the mongodb shell (./mongo)
>use admin
>db.addUser("name", "password")
2. Make sure this admin user has been authenticated
-start up the instance of mongod with --auth flag
-start up the mongodb shell
>use admin
>db.auth("adminuser", "password")
(NB: this should return '1' in the shell)
3. Add readonly user
>use <collectionname>
>db.addUser("newuser", "NewPassword", true)