XK0-005 · Question #647
The development team wants to prevent a file from being modified by all users in a Linux system, including the root account. Which of the following commands can be used to accomplish this objective?
The correct answer is C. chattr +i /app/conf/file. The chattr command is used to change file attributes on Linux systems that support extended attributes, such as ext2, ext3, ext4, btrfs, xfs, and others. File attributes are flags that modify the behavior of files and directories. To prevent a file from being modified by all…
Question
The development team wants to prevent a file from being modified by all users in a Linux system, including the root account. Which of the following commands can be used to accomplish this objective?
Options
- Achmod / app/conf/file
- Bsetenforce / app/ conf/ file
- Cchattr +i /app/conf/file
- Dchmod 0000 /app/conf/file
How the community answered
(58 responses)- A10% (6)
- B16% (9)
- C71% (41)
- D3% (2)
Explanation
The chattr command is used to change file attributes on Linux systems that support extended attributes, such as ext2, ext3, ext4, btrfs, xfs, and others. File attributes are flags that modify the behavior of files and directories. To prevent a file from being modified by all users in a Linux system, including the root account, the development team can use the chattr +i /app/conf/file command. This command will set the immutable attribute (+i) on the file /app/conf/file, which means that the file cannot be deleted, renamed, linked, appended, or written to by any user or process. To remove the immutable attribute, the development team can use the chattr -i /app/conf/file command.
Topics
Community Discussion
No community discussion yet for this question.