A systems administrator wants to prevent the current contents of a file from being overwritten and wants to allow new additions at the end of the file. Which of the following commands should the administrator use?
File attribute management is an important system administration skill included in Linux+ V8. In this scenario, the administrator needs to ensure that a file cannot be modified or truncated, while still allowing data to be appended.
The correct solution is chattr +a file, which sets the append-only attribute on the file. When this attribute is enabled, the file’s existing contents cannot be altered or deleted, but new data can be appended to the end of the file. This is commonly used for protecting log files from tampering while still allowing normal logging operations.
The other options are incorrect. setenforce controls SELinux enforcement mode and does not affect file write behavior. setfacl modifies access control lists but does not enforce append-only semantics. chmod +t applies the sticky bit, which is primarily used on directories to prevent users from deleting files they do not own.
Linux+ V8 documentation explicitly references chattr and immutable or append-only attributes as mechanisms for protecting critical files from accidental or malicious modification.
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit