- linkend="guc-db-user-namespace"> feature. For all other users,
- md5> works the same as scram-sha-256>.
-
+ The md5 method cannot be used with
+ the feature.
+
+
+ To ease transition from the md5 method to the newer
+ SCRAM method, if md5 is specified as a method
+ in pg_hba.conf but the user's password on the
+ server is encrypted for SCRAM (see below), then SCRAM-based
+ authentication will automatically be chosen instead.
+
+
+
+
+
+ password
+
+ The method password> sends the password in clear-text and is
+ therefore vulnerable to password sniffing> attacks. It should
+ always be avoided if possible. If the connection is protected by SSL
+ encryption then password> can be used safely, though.
+ (Though SSL certificate authentication might be a better choice if one
+ is depending on using SSL).
+
+
+
+
PostgreSQL database passwords are
catalog. Passwords can be managed with the SQL commands
and
,
- e.g., CREATE USER foo WITH PASSWORD 'secret'.
+ e.g., CREATE USER foo WITH PASSWORD 'secret',
+ command \password.
If no password has been set up for a user, the stored password
is null and password authentication will always fail for that user.
+ The availability of the different password-based authentication methods
+ depends on how a user's password on the server is encrypted (or hashed,
+ more accurately). This is controlled by the configuration
+ parameter at the time the
+ password is set. If a password was encrypted using
+ the scram-sha-256 setting, then it can be used for the
+ authentication methods scram-sha-256
+ and password (but password transmission will be in
+ plain text in the latter case). The authentication method
+ specification md5 will automatically switch to using
+ the scram-sha-256 method in this case, as explained
+ above, so it will also work. If a password was encrypted using
+ the md5 setting, then it can be used only for
+ the md5 and password authentication
+ method specifications (again, with the password transmitted in plain text
+ in the latter case). (Previous PostgreSQL releases supported storing the
+ password on the server in plain text. This is no longer possible.) To
+ check the currently stored password hashes, see the system
+ catalog pg_authid.
+
+
+ To upgrade an existing installation from md5
+ to scram-sha-256, after having ensured that all client
+ libraries in use are new enough to support SCRAM,
+ set password_encryption = 'scram-sha-256'
+ in postgresql.conf, make all users set new passwords,
+ and change the authentication method specifications
+ in pg_hba.conf to scram-sha-256.
+