Bird
0
0

Which of the following is the correct syntax to specify SCRAM authentication in the pg_hba.conf file?

easy📝 Syntax Q3 of 15
PostgreSQL - Roles and Security
Which of the following is the correct syntax to specify SCRAM authentication in the pg_hba.conf file?
Ahost all all 0.0.0.0/0 trust
Bhost all all 0.0.0.0/0 scram-sha-256
Chost all all 0.0.0.0/0 md5
Dhost all all 0.0.0.0/0 password
Step-by-Step Solution
Solution:
  1. Step 1: Recall syntax for authentication methods in pg_hba.conf

    The format is: host database user address method.
  2. Step 2: Identify the correct method name for SCRAM

    SCRAM authentication is specified as 'scram-sha-256' in the method field.
  3. Final Answer:

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

    SCRAM syntax = scram-sha-256 [OK]
Quick Trick: Use 'scram-sha-256' exactly in pg_hba.conf for SCRAM [OK]
Common Mistakes:
  • Using 'password' instead of 'scram-sha-256'
  • Confusing 'md5' with SCRAM syntax
  • Omitting the method field

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes