SCRAM-SHA-256 not supported on mongodb 4.4



我正在尝试使用db.updateUser()更新使用密码。假设mongo在使用passwordDigestor: "server"时应该从4.0开始支持SHA-256。然而,当我尝试时,我会得到以下错误:

uncaught exception: Error: Updating user failed: SCRAM-SHA-256 not supported in authMechanisms :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DB.prototype.updateUser@src/mongo/shell/db.js:1436:11
@(shell):1:1

以下是我在副本集的单个节点上使用的命令:

use admin
db.updateUser(
"the_username",
{
pwd: passwordPrompt(),
mechanisms: [ "SCRAM-SHA-256" ],
passwordDigestor: "server"
}
)

我正在运行4.4.15二进制文件,功能兼容性版本是4.4

原来有一个配置文件(在每个单独的节点上,我的在/etc中(,它明确地将机制设置为仅sha-1:

setParameter:
authenticationMechanisms: SCRAM-SHA-1

如果我把它改成愚蠢的,它会像预期的那样工作:

setParameter:
authenticationMechanisms: SCRAM-SHA-256,SCRAM-SHA-1

最新更新