21.5. Password Authentication (2024)

21.5.Password Authentication
Prev Up Chapter21.Client Authentication Home Next

There are several password-based authentication methods. These methods operate similarly but differ in how the users' passwords are stored on the server and how the password provided by a client is sent across the connection.

scram-sha-256

The method scram-sha-256 performs SCRAM-SHA-256 authentication, as described in RFC 7677. It is a challenge-response scheme that prevents password sniffing on untrusted connections and supports storing passwords on the server in a cryptographically hashed form that is thought to be secure.

This is the most secure of the currently provided methods, but it is not supported by older client libraries.

md5

The method md5 uses a custom less secure challenge-response mechanism. It prevents password sniffing and avoids storing passwords on the server in plain text but provides no protection if an attacker manages to steal the password hash from the server. Also, the MD5 hash algorithm is nowadays no longer considered secure against determined attacks.

The md5 method cannot be used with the db_user_namespace 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 separate from operating system user passwords. The password for each database user is stored in the pg_authid system catalog. Passwords can be managed with the SQL commands CREATE ROLE and ALTER ROLE, e.g., CREATE ROLE foo WITH LOGIN PASSWORD 'secret', or the psql 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 password_encryption 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.

Prev Up Next
21.4.Trust Authentication Home 21.6.GSSAPI Authentication
21.5. Password Authentication (2024)
Top Articles
Which is the best strategy in Olymp trade?
Work Components of Motivation | Organizational Behavior and Human Relations
Spn 1816 Fmi 9
Zabor Funeral Home Inc
Gamevault Agent
Mopaga Game
Craigslist Portales
<i>1883</i>'s Isabel May Opens Up About the <i>Yellowstone</i> Prequel
CA Kapil 🇦🇪 Talreja Dubai on LinkedIn: #businessethics #audit #pwc #evergrande #talrejaandtalreja #businesssetup…
Cvs Devoted Catalog
Lqse-2Hdc-D
Www.paystubportal.com/7-11 Login
The Binding of Isaac
Nitti Sanitation Holiday Schedule
Hijab Hookup Trendy
Burn Ban Map Oklahoma
Northern Whooping Crane Festival highlights conservation and collaboration in Fort Smith, N.W.T. | CBC News
Tygodnik Polityka - Polityka.pl
The best TV and film to watch this week - A Very Royal Scandal to Tulsa King
Apply for a credit card
Heart Ring Worth Aj
Yog-Sothoth
How to Download and Play Ultra Panda on PC ?
Talk To Me Showtimes Near Marcus Valley Grand Cinema
A Cup of Cozy – Podcast
Watertown Ford Quick Lane
Smartfind Express Login Broward
Ticket To Paradise Showtimes Near Cinemark Mall Del Norte
Darknet Opsec Bible 2022
Puffin Asmr Leak
Gus Floribama Shore Drugs
Ellafeet.official
Egg Crutch Glove Envelope
NIST Special Publication (SP) 800-37 Rev. 2 (Withdrawn), Risk Management Framework for Information Systems and Organizations: A System Life Cycle Approach for Security and Privacy
Phone number detective
Afspraak inzien
Pinellas Fire Active Calls
Dynavax Technologies Corp (DVAX)
Hebrew Bible: Torah, Prophets and Writings | My Jewish Learning
Htb Forums
Wayne State Academica Login
Husker Football
2023 Nickstory
Craigslist Boats Dallas
2007 Jaguar XK Low Miles for sale - Palm Desert, CA - craigslist
Luvsquad-Links
Sdn Fertitta 2024
Powerboat P1 Unveils 2024 P1 Offshore And Class 1 Race Calendar
Az Unblocked Games: Complete with ease | airSlate SignNow
Victoria Vesce Playboy
Latest Posts
Article information

Author: Virgilio Hermann JD

Last Updated:

Views: 5883

Rating: 4 / 5 (41 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Virgilio Hermann JD

Birthday: 1997-12-21

Address: 6946 Schoen Cove, Sipesshire, MO 55944

Phone: +3763365785260

Job: Accounting Engineer

Hobby: Web surfing, Rafting, Dowsing, Stand-up comedy, Ghost hunting, Swimming, Amateur radio

Introduction: My name is Virgilio Hermann JD, I am a fine, gifted, beautiful, encouraging, kind, talented, zealous person who loves writing and wants to share my knowledge and understanding with you.