CompTIA Linux+ XK0-006 (V8) Practice Question

A system administrator needs to allow users in the 'developers' group to restart a specific systemd service, dev-app.service, without entering a password. The administrator wants to use a centralized, fine-grained authorization framework instead of granting broad sudo privileges. Which of the following approaches correctly implements this requirement using Polkit?

  • Create a .pkla file in /etc/polkit-1/localauthority/50-local.d/ specifying the org.freedesktop.systemd1.manage-units action and the 'developers' group, with ResultActive=yes.

  • Create a JavaScript rule in /etc/polkit-1/rules.d/ that grants permission for the org.freedesktop.systemd1.manage-units action to the 'developers' group when the unit is dev-app.service, returning polkit.Result.YES.

  • Use visudo to add the line %developers ALL=(ALL) NOPASSWD: /usr/bin/systemctl restart dev-app.service to the /etc/sudoers file.

  • Configure a new service file in /etc/pam.d/ that uses the pam_succeed_if.so module to grant access to systemctl for members of the 'developers' group.

CompTIA Linux+ XK0-006 (V8)
Security
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot