[DOCS-857] create HOWTO on adding a read only user with authentication enabled Created: 07/Dec/12  Updated: 30/Oct/23  Resolved: 24/Jan/13

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Task Priority: Minor - P4
Reporter: Barrie Segal Assignee: sam.helman@10gen.com
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Participants:
Days since reply: 11 years, 10 weeks, 6 days ago

 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)



 Comments   
Comment by Scott Hernandez (Inactive) [ 07/Dec/12 ]

How is this not covered already on this page? http://docs.mongodb.org/manual/tutorial/control-access-to-mongodb-with-authentication/

Generated at Thu Feb 08 07:39:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.