Docs 菜单

Docs 主页MongoDB Ops Manager

加密用户凭证

在此页面上

  • 运行 shell 命令创建一对加密档案。
  • 根据提示输入密码。
  • 将加密凭据添加到 conf-mms.properties 文件中。

对于存储凭证的配置设置,您可以以纯文本形式存储凭证,也可以使用 Ops Manager credentialstool 对凭证进行加密。如果选择以纯文本形式存储凭证,请降低每台服务器上 conf-mms.properties 文件的权限。

此过程仅对 SCRAM 用户名和密码身份验证以及 (LDAP) PLAIN 身份验证有效。它不适用于 MONGODB-X509GSSAPI 身份验证,这两种身份验证都使用用户名但不使用密码。

注意

保护纯文本密码

如果选择以纯文本形式存储凭证,请降低每台服务器上 conf-mms.properties 文件的权限。

sudo chmod 600 <install_dir>/conf/conf-mms.properties

重要

当与 rpmdeb 包一起在 Linux 系统上安装时,credentialstool 工具需要 root(sudo)权限,因为它会读取 /etc/mongodb-mms/gen.key 文件。Ops Manager 使用 gen.key 加密数据库和配置文件中的敏感数据。

使用 credentialstool 为 MongoDB 部署生成加密凭据:

1
sudo <install_dir>/bin/credentialstool --username <username>
--password
变量
定义
<username>
您的 MongoDB 用户名
<install_dir>
Ops Manager 的安装路径。
2

然后,credentialstool 输出加密凭据对。

3
  1. 根据需要在 mongo.mongoUri 设置中输入加密凭证对。

  2. 添加 mongo.encryptedCredentials 设置并将其设置为 true

    例子

    mongo.mongoUri=mongodb://da83ex3s:a4fbcf3a1@mydb1.example.net:40000/admin
    mongo.encryptedCredentials=true

    重要

    conf-mms.properties 文件可包含多个 mongo.mongoUri 设置。如果 mongo.encryptedCredentialstrue,则您必须对各种 mongo.mongoUri 设置中找到的所有用户凭据进行加密。

← 管理 Ops Manager 主机名和端口