0
0
PostgreSQLquery~20 mins

Password authentication methods in PostgreSQL - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Password Authentication Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding PostgreSQL password authentication methods

Which PostgreSQL password authentication method stores passwords in a hashed format using MD5 and requires the client to send an MD5-hashed password for verification?

Apassword
Bmd5
Ctrust
Dpeer
Attempts:
2 left
💡 Hint

Think about which method hashes the password before sending it over the network.

query_result
intermediate
2:00remaining
Result of authentication method in pg_hba.conf

Given the following line in pg_hba.conf:

host all all 192.168.1.0/24 scram-sha-256

What does this configuration enforce for connections from the 192.168.1.0/24 network?

ARequires SCRAM-SHA-256 password authentication
BAllows connections without password
CAllows only local socket connections
DRequires password sent in clear text
Attempts:
2 left
💡 Hint

Look at the authentication method specified at the end of the line.

📝 Syntax
advanced
2:00remaining
Identify the syntax error in pg_hba.conf entry

Which of the following pg_hba.conf lines contains a syntax error?

Ahost all all 10.0.0.0/8 md5
Blocal all all trust
Chostssl all all 0.0.0.0/0 scram-sha-256
Dhost all all 192.168.1.0/24 password md5
Attempts:
2 left
💡 Hint

Check the order and validity of authentication methods in the line.

optimization
advanced
2:00remaining
Optimizing password authentication for security and performance

You want to configure PostgreSQL to use the most secure password authentication method that is widely supported by clients, while minimizing performance overhead. Which method should you choose?

Ascram-sha-256
Bpassword
Cmd5
Dtrust
Attempts:
2 left
💡 Hint

Consider modern security standards and client support.

🔧 Debug
expert
2:00remaining
Debugging failed password authentication with SCRAM-SHA-256

A PostgreSQL server is configured to use scram-sha-256 authentication in pg_hba.conf. A client attempts to connect but receives an authentication failure. Which of the following is the most likely cause?

AThe <code>pg_hba.conf</code> file is missing the <code>hostssl</code> keyword
BThe client is connecting over a local socket
CThe user's password is stored using MD5 hashing, not SCRAM-SHA-256
DThe server is running on an unsupported PostgreSQL version
Attempts:
2 left
💡 Hint

Think about password storage format compatibility with authentication method.