Bird
0
0

Given the following pg_hba.conf line: host all all 192.168.0.0/24 md5, what happens when a user connects from IP 192.168.0.15?

medium📝 query result Q4 of 15
PostgreSQL - Roles and Security
Given the following pg_hba.conf line: host all all 192.168.0.0/24 md5, what happens when a user connects from IP 192.168.0.15?
AConnection is rejected due to IP mismatch
BUser can connect without a password
CUser must provide a password hashed with MD5
DUser must use SCRAM authentication
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the IP range and method

    The IP 192.168.0.15 falls within 192.168.0.0/24 subnet, so this rule applies.
  2. Step 2: Understand the 'md5' method

    'md5' requires the user to provide a password hashed with MD5 for authentication.
  3. Final Answer:

    User must provide a password hashed with MD5 -> Option C
  4. Quick Check:

    IP in range + md5 = MD5 password required [OK]
Quick Trick: md5 requires MD5 hashed password for matching IP range [OK]
Common Mistakes:
  • Assuming no password needed
  • Confusing md5 with scram-sha-256
  • Thinking IP is outside range

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes