CompTIA DataSys+ (DS0-001)Database DeploymentEasy

A database administrator is deploying a new PostgreSQL database server on a Linux host. As part of the post-installation configuration, the administrator needs to ensure that only specific IP addresses and users can connect to the database. Which configuration file should be modified to achieve this?

  1. Apg_service.conf
  2. Bpg_hba.conf
  3. Cpg_ident.conf
  4. Dpostgresql.conf
Show answer & explanation

Correct answer: B. pg_hba.conf

The pg_hba.conf file in PostgreSQL is specifically designed for client authentication, allowing administrators to define which hosts, users, and databases can connect, and what authentication methods they must use.

Why the other options are wrong

  • A. This file is used for connection service definitions, simplifying connection strings for clients.
  • C. This file maps operating system user names to database user names, not IP-based access control.
  • D. This file contains general server configuration parameters, not client authentication rules.

PostgreSQL pg_hba.conf

The PostgreSQL Host-Based Authentication (HBA) configuration file controls client authentication, specifying which hosts can connect, which users they can connect as, and which authentication methods are required.

  • Controls client access to PostgreSQL.
  • Defines rules based on host, database, user, and authentication method.
  • Essential for database security and network access control.

Memory trick: PostgreSQL's HBA is the 'bouncer' at the database door, checking IDs.

More Database Deployment questions