gpt4 book ai didi

postgresql - 默认的 PostgreSQL 密码加密方法

转载 作者:行者123 更新时间:2023-11-29 12:09:40 27 4
gpt4 key购买 nike

如果我在创建用户或更改角色时未指定ENCRYPTED,我想知道 PostgreSQL 使用的默认加密方法(如果有)是什么。

我在 PostgreSQL 网站上阅读了以下内容:

密码存储加密默认情况下,数据库用户密码存储为 MD5 哈希值,因此管理员无法确定分配给用户的实际密码。如果 MD5 加密用于客户端身份验证,则未加密的密码甚至永远不会暂时出现在服务器上,因为客户端会在通过网络发送之前对其进行 MD5 加密。

但我不确定是否只有当我在创建/更改角色/用户时使用ENCRYPTED时才使用MD5加密方法。

我正在使用 PostgreSQL 9.5

谢谢

最佳答案

来自 the docs

These key words control whether the password is stored encrypted in the system catalogs. (If neither is specified, the default behavior is determined by the configuration parameter password_encryption.) If the presented password string is already in MD5-encrypted format, then it is stored encrypted as-is, regardless of whether ENCRYPTED or UNENCRYPTED is specified (since the system cannot decrypt the specified encrypted password string). This allows reloading of encrypted passwords during dump/restore.

password_encryption defaults to true. , 尽管您可以使用 SHOW password_encryption 检查它。

根据encryption options,

Password Storage Encryption By default, database user passwords are stored as MD5 hashes, so the administrator cannot determine the actual password assigned to the user. If MD5 encryption is used for client authentication, the unencrypted password is never even temporarily present on the server because the client MD5-encrypts it before being sent across the network.

关于postgresql - 默认的 PostgreSQL 密码加密方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43331434/

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