Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-857

create HOWTO on adding a read only user with authentication enabled

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Duplicate
    • Icon: Minor - P4 Minor - P4
    • Server_Docs_20231030
    • None
    • manual
    • 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)

      Attachments

        Activity

          People

            sam.helman@10gen.com sam.helman@10gen.com
            barrie Barrie Segal
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              11 years, 10 weeks, 6 days ago