MongoDB uses database users to authenticate clients and grant access to your deployment. Assign roles to database users based on the level of access and tasks they need to perform.
用例
Create database users to:
允许读取和写入数据库,但限制管理访问权限。
分配管理权限以管理数据库、执行备份和配置设置。
Grant read-only access for reporting and analytics.
行为
Roles govern database user permissions. Use MongoDB's built-in roles or create custom roles.
自管理部署中的数据库用户
Grant database users in self-managed deployments one or more roles. Roles grant users privileges to perform actions on specified resources.
Users can perform actions on the following resources:
集合
Databases
集群
要在自托管部署中创建和管理用户,请使用 createUser 命令或 db.createUser() 方法。
MongoDB Atlas中的数据库用户
MongoDB Atlas中的数据库用户具有与自管理部署不同的内置角色。在MongoDB Atlas中创建数据库用户时, Atlas内置角色应用于项目中的所有数据库。
注意
Database users are separate from Atlas users. Database users access MongoDB databases. Atlas users access the Atlas application.
Create database users, assign built-in roles, and create custom roles in the Atlas CLI, Atlas Administration API, or the Atlas UI. To learn more, see Add Database Users.
开始体验
要创建和管理数据库用户,请参阅:
详情
身份验证
Specify the authentication mechanism when you create a user. MongoDB supports the following authentication mechanisms:
SCRAM | x.509 | Kerberos | LDAP | OIDC | AWS-IAM | |
|---|---|---|---|---|---|---|
MongoDB Community | ✓ | ✓ | ||||
MongoDB Enterprise | ✓ | ✓ | ✓ | ✓ | ✓ | |
MongoDB Atlas (M10 及更高版本) | ✓ | ✓ | ✓ | ✓ | ✓ | |
MongoDB Atlas (免费和灵活层级) | ✓ | ✓ | ✓ | |||
MongoDB Atlas (Flex) | ✓ | ✓ | ✓ |
要了解详情,请参阅:
授权
MongoDB uses Role-Based Access Control to verify user access to resources and operations. Database users in MongoDB Atlas have different built-in roles than self-hosted deployments. However, MongoDB builds all built-in roles from the same set of privilege actions.
要了解详情,请参阅: