gpt4 book ai didi

postgresql - 将 PostgreSQL 密码加密从 MD5 更改为 SHA

转载 作者:行者123 更新时间:2023-11-29 11:47:00 25 4
gpt4 key购买 nike

有没有办法将 PostgreSQL 密码的加密方式从 MD5 改为 SHA?

如果是,你能告诉我怎么做吗?

我正在使用 PostgreSQL 9.5

最佳答案

第 10 页

使用 PostgreSQL 10,您可以将 password_encryption 设置为 scram-sha-256。来自 the docs

When a password is specified in CREATE ROLE or ALTER ROLE without writing either ENCRYPTED or UNENCRYPTED, this parameter determines whether the password is to be encrypted. The default value is md5, which stores the password as an MD5 hash. Setting this to plain stores it in plaintext. on and off are also accepted, as aliases for md5 and plain, respectively. Setting this parameter to scram-sha-256 will encrypt the password with SCRAM-SHA-256.

See this post for information about iterations using scram-sha-256

第 9.x 页

如果不实际修改源代码,这是无法完成的。

关于postgresql - 将 PostgreSQL 密码加密从 MD5 更改为 SHA,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43333053/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com