A system administrator needs to protect a critical configuration file, /etc/resolv.conf, from any modification, renaming, or deletion. Even when logged in as the root user, any attempt to alter the file must be blocked. Which of the following commands will accomplish this?
The correct command is chattr +i /etc/resolv.conf. The chattr +i command sets the immutable attribute on a file. A file with the immutable attribute cannot be modified, deleted, or renamed, and no hard links can be created to it. This restriction applies to all users, including the root user. Only the superuser can set or remove this attribute.
chattr +a /etc/resolv.conf sets the append-only attribute, which allows data to be added to the end of the file but does not prevent it entirely from being modified.
chmod 000 /etc/resolv.conf removes all read, write, and execute permissions. However, the root user can still modify or delete the file, or simply change the permissions back.
chown nobody:nobody /etc/resolv.conf changes the ownership of the file, but this does not prevent the root user from modifying or deleting it.
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 does the `chattr +i` command do?
Open an interactive chat with Bash
How is `chattr +i` different from `chmod 000`?
Open an interactive chat with Bash
When should a system administrator use `chattr +i` on a file?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Security
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 .