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...
IT & Cybersecurity Package Join Premium for Full Access