An administrator manages a custom compiled application located at /usr/local/bin/log_updater. This application needs to write to a log file at /var/log/app.log, which is owned by the appsvc user and group. To enhance security, regular users must be able to run the application, but they should not be added to the appsvc group or be granted direct write permissions to the log file. Which of the following commands will configure the application to run with the necessary permissions?
The correct commands are chown appsvc /usr/local/bin/log_updater && chmod u+s /usr/local/bin/log_updater. This solution works by leveraging the setuid bit.
chown appsvc ... changes the owner of the application to appsvc.
chmod u+s ... sets the setuid (Set User ID) permission bit on the executable file.
When a regular user executes a file with the setuid bit active, the process does not run with the user's own permissions. Instead, the process's Effective User ID (EUID) is set to the UID of the file's owner. In this case, the process's EUID becomes that of the appsvc user, granting it the necessary permissions to write to /var/log/app.log for the duration of its execution.
The other options are incorrect. Modifying sudoers grants permissions via the sudo command, which is a different mechanism. Adding the user to the appsvc group or using setfacl to grant direct file access are both explicitly forbidden by the scenario's requirements.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of the setuid bit in Linux?
Open an interactive chat with Bash
Why is using `chown` to change file ownership necessary here?
Open an interactive chat with Bash
Why weren't the other options correct in this scenario?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access