/etc/sudoers contains the line `alice db1 = (postgres) /usr/bin/psql`. What does the word `postgres` in parentheses specify?

LPIC-1 Exam 102-500, objective 110. Security hard

Machine-checked — no person has signed for it. This question was read against the source cited below by an automated pass, which found no contradiction. That is a weaker claim than it sounds: the same kind of process wrote the question, so it can confirm its own mistake.

Treat it as a good draft rather than as settled fact, and read the source below before you rely on it. It is not used in mock exams here — only questions a person has signed for are.

How these questions are written — where each question comes from, what the verification ledger records, and what happens when one is found wrong.

The options

Correct The user that alice may run /usr/bin/psql as.

Correct. The parenthesised field is the Runas specification: it lists the target identities permitted, which alice selects with `sudo -u postgres psql`.

Not correct The host on which the rule applies.

Wrong. The host is the field before the equals sign, here db1. The rule is inert on any other host reading this sudoers file.

Not correct A group alice must belong to before the rule takes effect.

Wrong. Group membership on the left of a rule is written with a leading percent sign, as in %dba. Nothing inside the parentheses tests the invoking user's groups.

Not correct The user that owns /usr/bin/psql, which sudo verifies before running it.

Wrong. sudo does not check the ownership of the command against this field; it is the identity the command is executed as, not a constraint on the binary.

Why

A sudoers user specification reads `who where = (as_whom) what`: the invoking user or %group, then the host list, then an optional Runas specification in parentheses, then the commands. Omitting the parentheses defaults the target to root, which is why the common `alice ALL=(ALL) ALL` line is broader than it looks. A Runas field may also carry a group after a colon, as in (postgres:postgres), selected with sudo -g. Tags such as NOPASSWD: sit between the Runas field and the command list.

Where this comes from

Cited
manual page sudoers(5)

Practise this

Reading one question is not practice. The trainer will draw a short set from objective 110 and space the ones you get wrong.

Practise LPIC-1 Exam 102-500

More questions on this objective

All questions on Security

Practise LPIC-1 Exam 102-500