nerdexam
CompTIACompTIA

XK0-005 · Question #541

XK0-005 Question #541: Real Exam Question with Answer & Explanation

The correct answer is A: chattr +a /opt/app/logs. The command chattr +a /opt/app/logs will ensure the log file can only be written into without removing previous entries. The chattr command is a tool for changing file attributes on Linux file systems. The +a option sets the append-only attribute, which means that the file can on

Security

Question

A Linux engineer has been notified about the possible deletion of logs from the file /opt/app/logs. The engineer needs to ensure the log file can only be written into without removing previous entries. Which of the following commands would be BEST to use to accomplish this task?

Options

  • Achattr +a /opt/app/logs
  • Bchattr +d /opt/app/logs
  • Cchattr +i /opt/app/logs
  • Dchattr +c /opt/app/logs

Explanation

The command chattr +a /opt/app/logs will ensure the log file can only be written into without removing previous entries. The chattr command is a tool for changing file attributes on Linux file systems. The +a option sets the append-only attribute, which means that the file can only be opened in append mode for writing. This prevents the file from being modified, deleted, or

Topics

#chattr#File attributes#Log management#File security

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions