nerdexam
CompTIA

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…

Security

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)
  • A
    10% (6)
  • B
    16% (9)
  • C
    71% (41)
  • D
    3% (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

#File attributes#chattr#File security#Linux commands

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice