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...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .