Bird
0
0

Which line correctly sets password authentication to SCRAM in the pg_hba.conf file?

easy📝 Syntax Q12 of 15
PostgreSQL - Roles and Security
Which line correctly sets password authentication to SCRAM in the pg_hba.conf file?
Ahost all all 0.0.0.0/0 password
Bhost all all 0.0.0.0/0 md5
Chost all all 0.0.0.0/0 scram-sha-256
Dhost all all 0.0.0.0/0 trust
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct authentication method syntax

    The pg_hba.conf file uses lines like 'host all all address method' to set authentication.
  2. Step 2: Match method to SCRAM

    To use SCRAM, the method must be exactly 'scram-sha-256'.
  3. Final Answer:

    host all all 0.0.0.0/0 scram-sha-256 -> Option C
  4. Quick Check:

    SCRAM method line = host all all 0.0.0.0/0 scram-sha-256 [OK]
Quick Trick: SCRAM method is 'scram-sha-256' exactly in pg_hba.conf [OK]
Common Mistakes:
  • Using 'md5' instead of 'scram-sha-256' for SCRAM
  • Confusing 'password' with SCRAM
  • Omitting the IP address or using wrong format

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes