在线精品99_中国九九盗摄偷拍偷看_91免费版在线观看_91.app_91高清视频在线_99热最新网站

MongoDB用户及权限管理之角色说明的示例分析

123次阅读
没有评论

共计 4833 个字符,预计需要花费 13 分钟才能阅读完成。

这篇文章给大家分享的是有关 MongoDB 用户及权限管理之角色说明的示例分析的内容。丸趣 TV 小编觉得挺实用的,因此分享给大家做个参考,一起跟随丸趣 TV 小编过来看看吧。

mongodb 安装完后默认是不开启 auth 模块的,普通用户和超级管理员均不通过认证就可操作。当然裸奔有风险,安全起见还是开启 auth ???。

首先需要了解下面几点:

1、mongodb 是没有默认管理员账号,所以要先添加管理员账号,然后开启权限认证。

2、切换到 admin 数据库,添加的账号才是管理员账号。

3、用户只能在用户所在数据库登录,包括管理员账号。

4、管理员可以管理所有数据库,但是不能直接管理其他数据库,要先在 admin 数据库认证后才可以。这一点比较怪。

1. 用户权限角色说明

1.1 Database User Roles

read

允许用户读取指定数据库

Provides the ability to read data on allnon-system collections and on the following system collections: system.indexes,system.js, and system.namespaces collections.

拥有如下权限:

aggregate,checkShardingIndex,cloneCollectionAsCapped,collStats

count,dataSize,dbHash,dbStats,distinct,filemd5

geoNear,geoSearch,geoWalk,group

mapReduce (inline output only.),text (beta  feature.)

readWrite

允许用户读写指定数据库

Provides all the privileges of the readrole and the ability to modify data on all non-system collections and thesystem.js collection.

除了具有 read 权限,还拥有以下权限:

cloneCollection (as the target  database.),convertToCapped

create (and to create collections implicitly.)

drop(),dropIndexes,emptycapped,ensureIndex()

findAndModify,mapReduce (output to a collection.)

renameCollection (within the same database.)

read 和 readWrite 只要就是对库中表的操作权限

1.2 Database Administration Roles

dbAdmin

允许用户在指定数据库中执行管理函数,如索引创建、删除,查看统计或访问 system.profile

Provides the ability to performadministrative tasks such as schema-related tasks, indexing, gatheringstatistics. This role does not grant privileges for user and role management.

拥有如下权限:

clean,collMod,collStats,compact,convertToCapped

create,db.createCollection(),dbStats,drop(),dropIndexes,ensureIndex()

indexStats,profile,reIndex,renameCollection  (within a single database.),validate

dbOwner

Provides the ability to perform anyadministrative action on the database. This role combines the privilegesgranted by the readWrite, dbAdmin and userAdmin roles.

userAdmin

允许用户向 system.users 集合写入,可以找指定数据库里创建、删除和管理用户

Provides the ability to create and modifyroles and users on the current database. Since the userAdmin role allows usersto grant any privilege to any user, including themselves, the role alsoindirectly provides superuser access to either the database or, if scoped tothe admin database, the cluster.

1.3 Cluster Administration Roles

clusterAdmin

只在 admin 数据库中可用,赋予用户所有分片和复制集相关函数的管理权限。

Provides the greatest cluster-managementaccess. This role combines the privileges granted by the clusterManager,clusterMonitor, and hostManager roles. Additionally, the role provides thedropDatabase action.

拥有如下权限:

addShard,closeAllDatabases,connPoolStats,connPoolSync,_cpuProfilerStart

_cpuProfilerStop,cursorInfo,diagLogging,dropDatabase

enableSharding,flushRouterConfig,fsync,db.fsyncUnlock()

getCmdLineOpts,getLog,getParameter,getShardMap,getShardVersion

hostInfo,db.currentOp(),db.killOp(),listDatabases,listShards

logRotate,moveChunk,movePrimary,netstat,removeShard,unsetSharding

repairDatabase,replSetFreeze,replSetGetStatus,replSetInitiate

replSetMaintenance,replSetReconfig,replSetStepDown,replSetSyncFrom

resync,serverStatus,setParameter,setShardVersion,shardCollection

shardingState,shutdown,splitChunk,splitVector,split,top,touch

clusterManager

Provides management and monitoring actionson the cluster. A user with this role can access the config and localdatabases, which are used in sharding and replication, respectively.

clusterMonitor

Provides read-only access to monitoringtools, such as the MongoDB Cloud Manager and Ops Manager monitoring agent.

hostManager

Provides the ability to monitor and manageservers.

1.4 Backup and Restoration Roles

backup

Provides privileges needed to back up data.This role provides sufficient privileges to use the MongoDB Cloud Managerbackup agent, Ops Manager backup agent, or to use mongodump.

restore

Provides privileges needed to restore datawith mongorestore without the –oplogReplay option or without system.profilecollection data.

1.5 All-Database Roles

readAnyDatabase

只在 admin 数据库中可用,赋予用户所有数据库的读权限

Provides the same read-only permissions asread, except it applies to all but the local and config databases in thecluster. The role also provides the listDatabases action on the cluster as awhole.

readWriteAnyDatabase

只在 admin 数据库中可用,赋予用户所有数据库的读写权限

Provides the same read and writepermissions as readWrite, except it applies to all but the local and configdatabases in the cluster. The role also provides the listDatabases action onthe cluster as a whole.

userAdminAnyDatabase

只在 admin 数据库中可用,赋予用户所有数据库的 userAdmin 权限

Provides the same access to useradministration operations as userAdmin, except it applies to all but the localand config databases in the cluster.

Since the userAdminAnyDatabase role allowsusers to grant any privilege to any user, including themselves, the role alsoindirectly provides superuser access.

dbAdminAnyDatabase

只在 admin 数据库中可用,赋予用户所有数据库的 dbAdmin 权限。

Provides the same access to databaseadministration operations as dbAdmin, except it applies to all but the localand config databases in the cluster. The role also provides the listDatabasesaction on the cluster as a whole.

1.6 Superuser Roles

root

只在 admin 数据库中可用。超级账号,超级权限

Provides access to the operations and allthe resources of the readWriteAnyDatabase, dbAdminAnyDatabase,userAdminAnyDatabase, clusterAdmin, restore, and backup combined.

感谢各位的阅读!关于“MongoDB 用户及权限管理之角色说明的示例分析”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-07-19发表,共计4833字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)
主站蜘蛛池模板: 毛片网在线观看 | 两个人的视频观看www | 日韩天天操 | 小sao货揉揉你的奶真大电影 | 一个人看的www视频免费观看 | 一区二区三区四区在线免费观看 | 国产一级高清视频 | 亚洲熟女精品中文字幕 | 777久久精品一区二区三区无码 | 少妇下蹲露大唇无遮挡 | 肉色欧美久久久久久久免费看 | 中国浓毛少妇毛茸茸 | 日韩精品无码人成视频手机 | 国产一区视频在线 | 日韩欧美一区二区三区不卡视频 | 欧美一级黄视频 | 亚洲第一页色 | 曰韩美女一级视频 | 中文字幕不卡一区 | 久久精品人妻中文系列 | 久久99九九国产免费看小说 | 久久手机精品视频 | 福利四区 | 日本精a在线观看 | 亚洲欧洲日本精品 | 小嫩妇好紧好爽再快视频 | 99热r| 精品无码人妻被多人侵犯av | 日本强好片久久久久久aaa | 亚洲国产精品无码第一区二区三区 | 浴室人妻的情欲hd三级国产 | 四虎永久视频 | 日日噜噜夜夜狠狠视频免费 | 亚洲精品专区一区二区三区 | 婷婷五月深深久久精品 | 国产偷国产偷高清视频 | 特级一级片 | 亚洲欧洲av综合色无码 | 免费看a级肉片 | 熟女人妻一区二区三区免费看 | 国产精品一区久久 |