※This sample exam is different from those that appear in the actual OSS-DB Exam.
2019/03/04
pg_hba.conf is a file describing the method of client authentication.
It searches from the top one that matches with the combination of the client of the connection source, the database name of the connection destination, and the user name at the time of connection, and the authentication method described on the first line found is used.
The first column is often local corresponding to a connection using Unix domain socket or host corresponding to TCP / IP connection.
The second column is the name of the database to connect to and the third column is the name of the database user at the time of connection, but all represents wildcards, representing all databases or all users respectively.
When it is host, the fourth column represents the originating client.
The fourth column of local and the fifth column of host are the authentication method and there are peer and ident to check whether the user name of the OS matches the user name of the DB and there are md 5 of password authentication and unconditionally. There are trust which allow connection, reject which unconditionally refuse connection.
The first line of the example of the pg_hba.conf is specified that the peer authenticate with the local, but because in the example of the scenario of TCP / IP connection, it is ignored.
On the second line, when connecting to the database called test from the IP address of 192.168.1.12, regardless of the name of the database user at the time of connection, it is allowed unconditional connection
The third line connection from the host on the network of 192.168.1.0/24 is, any database, regardless of user is performed the password authentication.
Choices of B and D is the second line of the system, A, C, and E are authenticated in the manner of a third row
Therefore, the correct answer is B and C.