문제

How to add a user with userAdmin role in Atlas?

The Cluster Security "Add New User" UI https://cloud.mongodb.com/v2/.....#clusters/security/users shows only limited set of built-in roles without any option to enter role name manually:

enter image description here

So I am a bit stuck here - there are no options in the UI, and non of the existing roles allow to add users in a shell.

UPDATE:

To make it crystal clear I went To "Security" tab in MongoDB Atlas cluster, from there I clicked "Add a new User", clicked "Show advanced options" and got the screenshot above.

UPDATE 2:

None of the roles in the list have userAdmin privilege.

The most "powerful" atlasAdmin covers only:

  • readWriteAnyDatabase
  • readAnyDatabase
  • enableSharding
  • dbAdminAnyDatabase
  • clusterMonitor

and doesn't have enough privilege to execute db.createUser() command.

도움이 되었습니까?

해결책

You cannot grant this role. The only way to create new MongoDB users in Atlas is either via the UI or the API. See Add MongoDB Users for details and note that this page states:

Atlas rolls back any user modifications not made through the UI or API. You must use the Atlas UI or API to add, modify, or delete MongoDB users on Atlas clusters.

See Create a Database User for details on how to create MongoDB users via the API.

다른 팁

Go To "Security" tab in MongoDB Atlas cluster, from there you can "edit" or "Add a new User".

@Alex Blex, Let's start from Beginning, You want to create the 'user' admin. For what purpose you want to add the user. At "MongoDB Atlas Cluster" there is lists of "Role" Available like

Roles/Privileges

backup
clusterMonitor
dbAdmin
dbAdminAnyDatabase
enableSharding
read
readAnyDatabase
read
readAnyDatabase
readWrite
readWriteAnyDatabase

Suppose that you want to create a new "User" with "readWriteAnyDatabase" Role.

Step 1 : First Login to "MongoDB Atlas Cluster" through your User ID & Password Credential. enter image description here

Step 2 : After login at first time you shall find the two Tab

  1. Overview
  2. Security

Click on the "Security" tab.

enter image description here

Step 3 : On the Right side above corner you shall find out the button "ADD NEW USER" click on that.

Step 4 : After click on "ADD NEW USER" , you shall find the screen as mention below. enter image description here

Step 5 : Noted Down here, at this screen you decide what you want to do. I mean to say that what kind of User role you want to assigned.

If you shall not select "Show Advanced Options" then three tab

  1. Atlas admin
  2. Read and write any database
  3. Only read any database

Will be available. And according to your requirement you can choose the option and their respective "User ID" and Password.

eg; Like "Atlas Login"

enter image description here

& "Read and write any database" enter image description here

Step 6: If you shall click on "Advanced Roles/Privileges" the you shall find out option like enter image description here

And the "Advanced Roles/Privileges" enter image description here

Select the "Role" according to your requirement and set their "User ID" and "Password".

I hope so that it will help out to you.

After chat with @Alex i am creating the "Alex Blex" User with "dbAdmin" role for "AlexBlexDatabase".

See the screen shot below

enter image description here

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 dba.stackexchange
scroll top