MongoDB Db.serverstatus () still cannot prompt for authentication failure

Source: Internet
Author: User
Tags createindex
Db.createuser (
{
User: "Admin",
PWD: "Admin",
Roles: [{role: "root", DB: "admin"}]
}

);


The role can be changed to root, __system should be more.

Db.serverstatus (). connections


MongoDB role Database User role built in database role : Read, ReadWrite; Database administration roles: Dbadmin, Dbowner, useradmin; cluster management roles: Clusteradmin, Clustermanager, Clustermonitor, Hostmanager; Backup recovery role: backups, restore; All database roles: Readanydatabase, Readwriteanydatabase, Useradminanydatabase, dbadminanydatabase Super User role: root// There are also several roles that indirectly or directly provide access to the system Superuser (Dbowner, Useradmin, useradminanydatabase) internal roles: __system

Role Description:
read: Allows the user to read the specified database
ReadWrite: Allows the user to read and write to the specified database
dbadmin: Allows users to perform administrative functions in the specified database, such as index creation, deletion, view statistics, or access System.profile
useradmin: Allows the user to write to the System.users collection, can find the specified database to create, delete and manage users
clusteradmin: Only available in the Admin database, giving users administrative rights to all fragmentation and replication set-related functions.
readanydatabase: Only available in the Admin database, giving users read access to all databases
readwriteanydatabase: Only available in the Admin database, giving users read and write access to all databases
useradminanydatabase: Available only in the Admin database, giving users useradmin permissions for all databases
dbadminanydatabase: Available only in the Admin database, giving users dbadmin permissions for all databases.
root: Only available in the admin database. Super account, Super privilege

for the role, refer to the Official document extraction summary as follows:

Role Classification

role

Permissions and Roles

(This article may have some changes in capitalization, please refer to the official documentation when you use it)

Database User Roles

Read

Collstats,dbhash,dbstats,find,killcursors,listindexes,listcollections

ReadWrite

Collstats,converttocapped,createcollection,dbhash,dbstats,

Dropcollection,createindex,dropindex,emptycapped,find,

Insert,killcursors,listindexes,listcollections,remove,

Renamecollectionsamedb,update

Database Administration Roles

Dbadmin

Collstats,dbhash,dbstats,find,killcursors,listindexes,listcollections,

Dropcollection and CreateCollection in System.profile.

Dbowner

Role: ReadWrite, Dbadmin,useradmin

Useradmin

Changecustomdata,changepassword,createrole,createuser,

Droprole,dropuser,grantrole,revokerole,viewrole,viewuser

Cluster Administration Roles

Clusteradmin

Role: Clustermanager, Clustermonitor, Hostmanager

Clustermanager

Addshard,applicationmessage,cleanuporphaned,flushrouterconfig,

Listshards,removeshard,replsetconfigure,replsetgetstatus,

Replsetstatechange,resync,

Enablesharding,movechunk,splitchunk,splitvector

Clustermonitor

Connpoolstats,cursorinfo,getcmdlineopts,getlog,getparameter,

Getshardmap,hostinfo,inprog,listdatabases,listshards,netstat,

Replsetgetstatus,serverstatus,shardingstate,top

Collstats,dbstats,getshardversion

Hostmanager

Applicationmessage,closealldatabases,connpoolsync,cpuprofiler,

Diaglogging,flushrouterconfig,fsync,invalidateusercache,killop,

Logrotate,resync,setparameter,shutdown,touch,unlock

Backup and Restoration Roles

Backup

Provides insert,update permissions in Mms.backup documents in the Admin database

List all databases: listdatabases

List all collection indexes: listindexes

Provide query operations on the following: find

* Non-system collection

* System collection: System.indexes, System.namespaces, system.js

* Collection: Admin.system.users and Admin.system.roles

Restore

Non-system collections, System.js,admin.system.users and Admin.system.roles, and version 2.6 system.users provide the following permissions:

Collmod,createcollection,createindex,dropcollection,insert

List all databases: listdatabases

System.users:find,remove,update

All-database Roles

Readanydatabase

Provide read-only permission in all databases: Read

List all databases in cluster: listdatabases

Readwriteanydatabase

Provide all database read and Write permissions: ReadWrite

List all databases in cluster: listdatabases

Useradminanydatabase

Provide all user data management rights: Useradmin

Cluster:authschemaupgrade,invalidateusercache,listdatabases

Admin.system.users and Admin.system.roles:

Collstats,dbhash,dbstats,find,killcursors,plancacheread

Createindex,dropindex

Dbadminanydatabase

Provide all database administrator permissions: dbadmin

List all databases in cluster: listdatabases

Superuser Roles

Root

Role: Dbowner,useradmin,useradminanydatabase

Readwriteanydatabase, Dbadminanydatabase,

Useradminanydatabase,clusteradmin

Internal role

__system

Take any action on any database in the cluster



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.