有没有办法将 PostgreSQL 密码的加密方式从 MD5 改为 SHA?
如果是,你能告诉我怎么做吗?
我正在使用 PostgreSQL 9.5
最佳答案
第 10 页
使用 PostgreSQL 10,您可以将 password_encryption
设置为 scram-sha-256
。来自 the docs
When a password is specified in
CREATE ROLE
orALTER ROLE
without writing eitherENCRYPTED
orUNENCRYPTED
, 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/