4

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.

  • I have update my answer. I hope so that it will clarify all your query. – Md Haidar Ali Khan Dec 6 '17 at 12:01
  • See the my update answer after the edit statement. – Md Haidar Ali Khan Dec 6 '17 at 13:06
2

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.

  • Thanks, sorry I missed this bit in the docs. Apparently even with the API I can't use any of my custom roles =( – Alex Blex Dec 7 '17 at 9:30
0

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

  • Thanks, apparently the question is not clear enough that the screenshot was taken exactly from this page. There is still no option to add user with userAdmin role. – Alex Blex Dec 6 '17 at 10:11
  • @Alex Blex, What "Role" you want to That user "atlasAdmin" Or "readWriteAnyDatabase". – Md Haidar Ali Khan Dec 6 '17 at 11:24
  • No sir, I want userAdmin role. Really appreciate your efforts, but it doesn't answer the question. I have updated it again to elaborate why I need this particular role. root or any other that includes user management privileges would work as well. – Alex Blex Dec 6 '17 at 11:50
  • Sorry mate, your Suppose that you want to create a new "User" with "readWriteAnyDatabase" Role. is totally wrong assumption, so all the steps after that answer the question I didn't ask. I want to create a user with "userAdmin" role, not "readWriteAnyDatabase". – Alex Blex Dec 6 '17 at 12:08
  • @Alex Blex, You just select the "dbAdmin" Role from the "Advanced Roles/Privileges" menu options. And as per your desire select "user id" and "password". For example i have shown "readWriteAnyDatabase" role and created in my "MongoDB Atlas Cluster". – Md Haidar Ali Khan Dec 6 '17 at 12:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.