A system administrator needs to secure the configuration file /etc/important.conf to prevent any modifications, including by root, because it contains sensitive system settings. Which command should the administrator execute to achieve this?
The chattr +i /etc/important.conf command is correct because it sets the immutable attribute on the file, which prevents any modifications to the file, even by the root user, until the attribute is removed. This is useful for protecting critical system files. The +a attribute only allows appending to the file, not preventing modifications. The +s attribute is used to mark a file for secure deletion, and +d is intended to optimize file deletion, none of which prevent modifications.
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` command do?
Open an interactive chat with Bash
Can the immutable attribute be removed once set?
Open an interactive chat with Bash
What are some practical scenarios where setting a file as immutable would be beneficial?